From e01671b22f40992e9e761841ef0055f82cba2f5a Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Mon, 6 Jan 2025 22:38:57 +0100 Subject: [PATCH] update the velero backup annotation when updating kotsadm --- pkg/kotsadm/objects/kotsadm_objects.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/kotsadm/objects/kotsadm_objects.go b/pkg/kotsadm/objects/kotsadm_objects.go index 8697e2adf8..9c683e94c2 100644 --- a/pkg/kotsadm/objects/kotsadm_objects.go +++ b/pkg/kotsadm/objects/kotsadm_objects.go @@ -163,6 +163,8 @@ func UpdateKotsadmDeployment(existingDeployment *appsv1.Deployment, desiredDeplo existingDeployment.Spec.Template.Spec.Containers[containerIdx].VolumeMounts = desiredVolumeMounts existingDeployment.Spec.Template.Spec.Containers[containerIdx].Env = desiredDeployment.Spec.Template.Spec.Containers[0].Env + existingDeployment.Spec.Template.Annotations["pre.hook.backup.velero.io/command"] = `["/scripts/backup.sh"]` + return nil } @@ -727,6 +729,8 @@ func UpdateKotsadmStatefulSet(existingStatefulset *appsv1.StatefulSet, desiredSt existingStatefulset.Spec.Template.Spec.Containers[containerIdx].VolumeMounts = desiredVolumeMounts existingStatefulset.Spec.Template.Spec.Containers[containerIdx].Env = desiredStatefulSet.Spec.Template.Spec.Containers[0].Env + existingStatefulset.Spec.Template.Annotations["pre.hook.backup.velero.io/command"] = `["/scripts/backup.sh"]` + return nil }