From 12f6ae074a47aad8f18569f6787033199ed70580 Mon Sep 17 00:00:00 2001 From: Miles-Garnsey Date: Wed, 13 Dec 2023 12:41:23 +1100 Subject: [PATCH] More debugging. --- pkg/medusa/refresh_secrets.go | 2 +- test/e2e/medusa_test.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/medusa/refresh_secrets.go b/pkg/medusa/refresh_secrets.go index 95223e5dc..f9d3629b5 100644 --- a/pkg/medusa/refresh_secrets.go +++ b/pkg/medusa/refresh_secrets.go @@ -17,7 +17,6 @@ import ( func RefreshSecrets(dc *cassdcapi.CassandraDatacenter, ctx context.Context, client client.Client, logger logr.Logger, requeueDelay time.Duration) error { logger.Info(fmt.Sprintf("Restore complete for DC %#v, Refreshing secrets", dc.ObjectMeta)) userSecrets := []string{} - for _, user := range dc.Spec.Users { userSecrets = append(userSecrets, user.SecretName) } @@ -26,6 +25,7 @@ func RefreshSecrets(dc *cassdcapi.CassandraDatacenter, ctx context.Context, clie } else { userSecrets = append(userSecrets, dc.Spec.SuperuserSecretName) } + logger.Info(fmt.Sprintf("refreshing user secrets for %v", userSecrets)) // Both Reaper and medusa secrets go into the userSecrets, so they don't need special handling. for _, i := range userSecrets { secret := &corev1.Secret{} diff --git a/test/e2e/medusa_test.go b/test/e2e/medusa_test.go index b78d7c354..a115d42d1 100644 --- a/test/e2e/medusa_test.go +++ b/test/e2e/medusa_test.go @@ -202,6 +202,7 @@ func verifyRestoreJobFinished(t *testing.T, ctx context.Context, f *framework.E2 err := f.Get(ctx, dcKey, dc) if err != nil { t.Log(err) + return false } superUserSecret := dc.Spec.SuperuserSecretName if dc.Spec.SuperuserSecretName == "" { @@ -214,6 +215,9 @@ func verifyRestoreJobFinished(t *testing.T, ctx context.Context, f *framework.E2 return false } _, exists := secret.Annotations[k8ssandraapi.RefreshAnnotation] + if !exists { + t.Logf("%#v", *secret) + } return exists }, polling.medusaRestoreDone.timeout, polling.medusaRestoreDone.interval, "superuser secret wasn't updated with refresh annotation")