Add support for ctl covert with List

Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
This commit is contained in:
JoshVanL 2020-08-21 10:40:57 +01:00
parent 55566c2e01
commit 1c9e955407
No known key found for this signature in database
GPG Key ID: E7A7196576A219DA
2 changed files with 3 additions and 4 deletions

View File

@ -34,7 +34,6 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
"k8s.io/kubectl/pkg/util/templates"
cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
"github.com/jetstack/cert-manager/pkg/ctl"
)
@ -127,7 +126,7 @@ func (o *Options) Run() error {
builder := new(resource.Builder)
r := builder.
WithScheme(scheme, schema.GroupVersion{Group: cmapi.SchemeGroupVersion.Group, Version: runtime.APIVersionInternal}).
WithScheme(scheme).
LocalParam(true).FilenameParam(false, &o.FilenameOptions).Flatten().Do()
if err := r.Err(); err != nil {

View File

@ -48,8 +48,8 @@ func init() {
metainstall.Install(Scheme)
// This is used to add the List object type
coreGroupVersion := schema.GroupVersion{Group: "", Version: runtime.APIVersionInternal}
Scheme.AddKnownTypes(coreGroupVersion, &metainternalversion.List{})
listGroupVersion := schema.GroupVersionKind{Group: "", Version: runtime.APIVersionInternal, Kind: "List"}
Scheme.AddKnownTypeWithName(listGroupVersion, &metainternalversion.List{})
metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(kscheme.AddToScheme(Scheme))