fix configmap backup during upgrade (#2219)

This commit is contained in:
Adrian Stobbe 2023-08-14 09:16:46 +02:00 committed by GitHub
parent c7bbf90989
commit 1af13878a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -337,7 +337,7 @@ func (u *Upgrader) BackupConfigMap(ctx context.Context, name string) error {
}
backup := cm.DeepCopy()
backup.ObjectMeta = metav1.ObjectMeta{}
backup.Name = fmt.Sprintf("%s-backup", backup.Name)
backup.Name = fmt.Sprintf("%s-backup", name)
if _, err := u.stableInterface.CreateConfigMap(ctx, backup); err != nil {
if _, err := u.stableInterface.UpdateConfigMap(ctx, backup); err != nil {
return fmt.Errorf("updating backup config map: %w", err)