From e234c49d87f2d46ee79a818d68c026d9c95ea0be Mon Sep 17 00:00:00 2001 From: Mykola Morhun Date: Thu, 3 Aug 2023 12:26:18 +0300 Subject: [PATCH] Add type to upload secret (#49) --- controllers/component_image_controller.go | 1 + controllers/component_image_controller_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/controllers/component_image_controller.go b/controllers/component_image_controller.go index 64b05bc..3292dcb 100644 --- a/controllers/component_image_controller.go +++ b/controllers/component_image_controller.go @@ -441,6 +441,7 @@ func (r *ComponentReconciler) createRemoteSecretUploadSecret(ctx context.Context remotesecretv1beta1.RemoteSecretNameAnnotation: remoteSecretName, }, }, + Type: corev1.SecretTypeDockerConfigJson, StringData: generateDockerconfigSecretData(imageURL, robotAccount), } if err := r.Client.Create(ctx, uploadSecret); err != nil { diff --git a/controllers/component_image_controller_test.go b/controllers/component_image_controller_test.go index 1be4489..16e9058 100644 --- a/controllers/component_image_controller_test.go +++ b/controllers/component_image_controller_test.go @@ -178,6 +178,7 @@ var _ = Describe("Component image controller", func() { Expect(uploadSecret.Labels[remotesecretv1beta1.UploadSecretLabel]).To(Equal("remotesecret")) Expect(uploadSecret.Annotations[remotesecretv1beta1.RemoteSecretNameAnnotation]).To(Equal(remoteSecretKey.Name)) + Expect(uploadSecret.Type).To(Equal(corev1.SecretTypeDockerConfigJson)) uploadSecretDockerconfigJson := string(uploadSecret.Data[corev1.DockerConfigJsonKey]) var authDataJson interface{}