Skip to content

Commit

Permalink
Change order for upsert
Browse files Browse the repository at this point in the history
  • Loading branch information
aamgayle committed Oct 23, 2023
1 parent f7e9cb4 commit 9da2a50
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/controller/keyvault/ingress_secret_provider_class_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ func TestIngressSecretProviderClassReconcilerIntegrationWithoutSPCLabels(t *test
}},
},
}

require.NoError(t, util.Upsert(ctx, i.client, spc))
assert.Equal(t, 0, len(spc.Labels))

beforeErrCount = testutils.GetErrMetricCount(t, ingressSecretProviderControllerName)
beforeRequestCount = testutils.GetReconcileMetricCount(t, ingressSecretProviderControllerName, metrics.LabelSuccess)
Expand All @@ -207,6 +204,16 @@ func TestIngressSecretProviderClassReconcilerIntegrationWithoutSPCLabels(t *test

require.NoError(t, c.Get(ctx, client.ObjectKeyFromObject(spc), spc))

require.NoError(t, util.Upsert(ctx, i.client, spc))
assert.Equal(t, 0, len(spc.Labels))

beforeErrCount = testutils.GetErrMetricCount(t, ingressSecretProviderControllerName)
beforeRequestCount = testutils.GetReconcileMetricCount(t, ingressSecretProviderControllerName, metrics.LabelSuccess)
_, err = i.Reconcile(ctx, req)
require.NoError(t, err)
require.Equal(t, testutils.GetErrMetricCount(t, ingressSecretProviderControllerName), beforeErrCount)
require.Greater(t, testutils.GetReconcileMetricCount(t, ingressSecretProviderControllerName, metrics.LabelSuccess), beforeRequestCount)

expected := &secv1.SecretProviderClass{
Spec: secv1.SecretProviderClassSpec{
Provider: "azure",
Expand Down

0 comments on commit 9da2a50

Please sign in to comment.