diff --git a/controller/linodeobjectstoragebucket_controller_test.go b/controller/linodeobjectstoragebucket_controller_test.go index 2633a5591..c5b746af7 100644 --- a/controller/linodeobjectstoragebucket_controller_test.go +++ b/controller/linodeobjectstoragebucket_controller_test.go @@ -56,13 +56,12 @@ var _ = Describe("LinodeObjectStorageBucket controller", func() { }, Spec: infrav1.LinodeObjectStorageBucketSpec{ Cluster: "cluster", - Label: util.Pointer("sample"), }, } recorder := record.NewFakeRecorder(3) - secretName := fmt.Sprintf(scope.AccessKeyNameTemplate, *obj.Spec.Label) + secretName := fmt.Sprintf(scope.AccessKeyNameTemplate, obj.Name) var secret corev1.Secret var mockCtrl *gomock.Controller @@ -89,7 +88,7 @@ var _ = Describe("LinodeObjectStorageBucket controller", func() { createBucketCall := mockClient.EXPECT(). CreateObjectStorageBucket(gomock.Any(), gomock.Any()). Return(&linodego.ObjectStorageBucket{ - Label: *obj.Spec.Label, + Label: obj.Name, Cluster: obj.Spec.Cluster, Created: util.Pointer(time.Now()), Hostname: "hostname", @@ -107,7 +106,7 @@ var _ = Describe("LinodeObjectStorageBucket controller", func() { return false } - return createOpt.Label == fmt.Sprintf("%s-%s", *obj.Spec.Label, permission) + return createOpt.Label == fmt.Sprintf("%s-%s", obj.Name, permission) }), ). Return(&linodego.ObjectStorageKey{ID: idx}, nil). diff --git a/go.mod b/go.mod index d4d47f935..5332697b8 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 + k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/cluster-api v1.6.2 sigs.k8s.io/controller-runtime v0.17.2 ) @@ -76,7 +77,6 @@ require ( k8s.io/component-base v0.29.0 // indirect k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect