Skip to content

Commit bcf5926

Browse files
Md. Emruz Hossaintamalsaha
authored andcommitted
Fix offline backup (#537)
This PR fixes #535 Fixed: - [x] Fixed `ScaledownCronJob` does not scale up workload to 1 replica properly. - [x] Fixed wait until workload scaled down and pod force deletion for satefulset/daemonset. Issue to fix: - [x] backup count of repository crd get updated from second backup only, when status sub-resource is enabled. - [x] can not get snapshot. Error: ``` kubectl get snapshots --all-namespaces No resources found. Error from server: no pod found for workload stash-demo ``` - [x] Update test - [x] Update Snapshot doc to specify in which situation user will fail to list `Snapshot`
1 parent 5049a63 commit bcf5926

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backup.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,14 @@ func NewCmdBackup() *cobra.Command {
8787
log.Fatal(err)
8888
}
8989

90-
if replica > 1 || !util.HasOldReplicaAnnotation(kubeClient, opt.Namespace, opt.Workload) {
91-
log.Infof("Skipping backup. Reason: Backup type offline and replica > 1")
90+
if replica > 1 {
91+
log.Infof("Skipping backup...\n" +
92+
"Reason: Backup type offline and replica > 1\n" +
93+
"Backup has taken by another replica or scheduled CronJob hasn't run yet.")
94+
} else if !util.HasOldReplicaAnnotation(kubeClient, opt.Namespace, opt.Workload) {
95+
log.Infof("Skipping backup...\n" +
96+
"Reason: Backup type offline and workload does not have 'old-replica' annotation.\n" +
97+
"Backup will be taken at next scheduled time.")
9298
} else {
9399
log.Infoln("Running backup once")
94100
if err = ctrl.Backup(); err != nil {

0 commit comments

Comments
 (0)