@@ -32,6 +32,7 @@ import (
32
32
apierrors "k8s.io/apimachinery/pkg/api/errors"
33
33
"k8s.io/apimachinery/pkg/runtime"
34
34
"k8s.io/apimachinery/pkg/runtime/schema"
35
+ "k8s.io/apimachinery/pkg/types"
35
36
"k8s.io/apimachinery/pkg/util/sets"
36
37
"k8s.io/apimachinery/pkg/util/wait"
37
38
k8syaml "k8s.io/apimachinery/pkg/util/yaml"
@@ -252,7 +253,7 @@ func CreateCRDs(config *rest.Config, crds []*apiextensionsv1.CustomResourceDefin
252
253
crd := crd
253
254
log .V (1 ).Info ("installing CRD" , "crd" , crd .GetName ())
254
255
existingCrd := crd .DeepCopy ()
255
- err := cs .Get (context .TODO (), client.ObjectKey {Name : crd .GetName ()}, existingCrd )
256
+ err := cs .Get (context .TODO (), client.ObjectKey {NamespacedName : types. NamespacedName { Name : crd .GetName ()} }, existingCrd )
256
257
switch {
257
258
case apierrors .IsNotFound (err ):
258
259
if err := cs .Create (context .TODO (), crd ); err != nil {
@@ -263,7 +264,7 @@ func CreateCRDs(config *rest.Config, crds []*apiextensionsv1.CustomResourceDefin
263
264
default :
264
265
log .V (1 ).Info ("CRD already exists, updating" , "crd" , crd .GetName ())
265
266
if err := retry .RetryOnConflict (retry .DefaultBackoff , func () error {
266
- if err := cs .Get (context .TODO (), client.ObjectKey {Name : crd .GetName ()}, existingCrd ); err != nil {
267
+ if err := cs .Get (context .TODO (), client.ObjectKey {NamespacedName : types. NamespacedName { Name : crd .GetName ()} }, existingCrd ); err != nil {
267
268
return err
268
269
}
269
270
crd .SetResourceVersion (existingCrd .GetResourceVersion ())
0 commit comments