Skip to content

Commit

Permalink
Fix tests so that they always retrieve the right secret.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Dec 13, 2023
1 parent ce86d76 commit 6ab0e17
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/e2e/medusa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,17 @@ func verifyRestoreJobFinished(t *testing.T, ctx context.Context, f *framework.E2
}, polling.medusaRestoreDone.timeout, polling.medusaRestoreDone.interval, "restore didn't finish within timeout")

require.Eventually(func() bool {
dc := &cassdcapi.CassandraDatacenter{}
err := f.Get(ctx, dcKey, dc)
if err != nil {
t.Log(err)
}
superUserSecret := dc.Spec.SuperuserSecretName
if dc.Spec.SuperuserSecretName == "" {
superUserSecret = cassdcapi.CleanupForKubernetes(dcKey.Name) + "-superuser"
}
secret := &corev1.Secret{}
err := f.Get(ctx, framework.NewClusterKey(restoreClusterKey.K8sContext, restoreClusterKey.Namespace, "test-superuser"), secret)
err = f.Get(ctx, framework.NewClusterKey(restoreClusterKey.K8sContext, restoreClusterKey.Namespace, superUserSecret), secret)
if err != nil {
t.Log(err)
return false
Expand Down

0 comments on commit 6ab0e17

Please sign in to comment.