Tests ensure OIDCProvider secrets exist

... whenever one is successfully created.
This commit is contained in:
aram price 2020-12-15 18:26:27 -08:00
parent 0758ecfea8
commit 78df80f128

View File

@ -285,8 +285,8 @@ func CreateTestOIDCProvider(ctx context.Context, t *testing.T, issuer string, ce
}, 60*time.Second, 1*time.Second, "expected the OIDCProvider to have status %q", expectStatus) }, 60*time.Second, 1*time.Second, "expected the OIDCProvider to have status %q", expectStatus)
require.Equal(t, expectStatus, result.Status.Status) require.Equal(t, expectStatus, result.Status.Status)
// If the expected status is success, also wait for the secrets to be created. // If the OIDCProvider was successfully created, ensure all secrets are present before continuing
if expectStatus == configv1alpha1.SuccessOIDCProviderStatusCondition { if result.Status.Status == configv1alpha1.SuccessOIDCProviderStatusCondition {
assert.Eventually(t, func() bool { assert.Eventually(t, func() bool {
var err error var err error
result, err = opcs.Get(ctx, opc.Name, metav1.GetOptions{}) result, err = opcs.Get(ctx, opc.Name, metav1.GetOptions{})