diff --git a/pkg/controller/keyvault/ingress_secret_provider_class.go b/pkg/controller/keyvault/ingress_secret_provider_class.go index 44ca51d8..92d642ee 100644 --- a/pkg/controller/keyvault/ingress_secret_provider_class.go +++ b/pkg/controller/keyvault/ingress_secret_provider_class.go @@ -92,7 +92,7 @@ func (i *IngressSecretProviderClassReconciler) Reconcile(ctx context.Context, re ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("keyvault-%s", ing.Name), Namespace: ing.Namespace, - Labels: util.MergeMaps(manifests.GetTopLevelLabels(), map[string]string{"fake": "test"}), + Labels: manifests.GetTopLevelLabels(), OwnerReferences: []metav1.OwnerReference{{ APIVersion: ing.APIVersion, Controller: util.BoolPtr(true), diff --git a/pkg/controller/keyvault/ingress_secret_provider_class_test.go b/pkg/controller/keyvault/ingress_secret_provider_class_test.go index 16a8fd57..7e54e8c0 100644 --- a/pkg/controller/keyvault/ingress_secret_provider_class_test.go +++ b/pkg/controller/keyvault/ingress_secret_provider_class_test.go @@ -201,7 +201,7 @@ func TestIngressSecretProviderClassReconcilerIntegrationWithoutSPCLabels(t *test // Update it to blank labels spc.Labels = map[string]string{} require.NoError(t, i.client.Update(ctx, spc)) - assert.Equal(t, 0, len(spc.Labels)) + assert.Equal(t, len(manifests.GetTopLevelLabels()), len(spc.Labels)) // Remove the cert annotation from the ingress ing.Annotations = map[string]string{} @@ -213,7 +213,7 @@ func TestIngressSecretProviderClassReconcilerIntegrationWithoutSPCLabels(t *test require.Equal(t, testutils.GetErrMetricCount(t, ingressSecretProviderControllerName), beforeErrCount) require.Greater(t, testutils.GetReconcileMetricCount(t, ingressSecretProviderControllerName, metrics.LabelSuccess), beforeRequestCount) - // Prove secret class was not removed after second reconcile + // Prove secret class was not removed require.False(t, errors.IsNotFound(c.Get(ctx, client.ObjectKeyFromObject(spc), spc))) assert.Equal(t, 0, len(spc.Labels)) require.NoError(t, c.Get(ctx, client.ObjectKeyFromObject(spc), spc))