Skip to content

Commit

Permalink
More debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Dec 13, 2023
1 parent 18101b9 commit 12f6ae0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/medusa/refresh_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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{}
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/medusa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand All @@ -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")

Expand Down

0 comments on commit 12f6ae0

Please sign in to comment.