From e73ef7c3f24ee612421b62963f443ff1a1e790dc Mon Sep 17 00:00:00 2001 From: Jean-Marc ANDRE Date: Sat, 25 Mar 2023 18:23:39 +0100 Subject: [PATCH] reworked Steps --- api/v1alpha1/backupconfiguration_types.go | 9 +++++++-- api/v1alpha1/zz_generated.deepcopy.go | 17 ++++++++++++++++- test/02-backupconf.yaml | 8 ++++---- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/api/v1alpha1/backupconfiguration_types.go b/api/v1alpha1/backupconfiguration_types.go index c315ef2..7d8ffe1 100644 --- a/api/v1alpha1/backupconfiguration_types.go +++ b/api/v1alpha1/backupconfiguration_types.go @@ -63,9 +63,14 @@ const ( ) type Step struct { - Name string `json:"name"` // +optional - Finalize *bool `json:"finalize"` + Finalize *string `json:"finalize,omitempty"` + // +optional + Initialize *string `json:"initialize,omitempty"` + // +optional + Backup *string `json:"backup,omitempty"` + // +optional + Restore *string `json:"restore,omitempty"` } type TargetContainer struct { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index a4b093e..b93466a 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -591,7 +591,22 @@ func (in *Step) DeepCopyInto(out *Step) { *out = *in if in.Finalize != nil { in, out := &in.Finalize, &out.Finalize - *out = new(bool) + *out = new(string) + **out = **in + } + if in.Initialize != nil { + in, out := &in.Initialize, &out.Initialize + *out = new(string) + **out = **in + } + if in.Backup != nil { + in, out := &in.Backup, &out.Backup + *out = new(string) + **out = **in + } + if in.Restore != nil { + in, out := &in.Restore, &out.Restore + *out = new(string) **out = **in } } diff --git a/test/02-backupconf.yaml b/test/02-backupconf.yaml index da007bc..8d5150c 100644 --- a/test/02-backupconf.yaml +++ b/test/02-backupconf.yaml @@ -116,9 +116,8 @@ spec: containers: - name: apache steps: - - name: maintenance-on - - name: maintenance-off - finalize: true + - initialize: maintenance-on + - finalize: maintenance-off paths: - /data - backupType: Job @@ -127,7 +126,8 @@ spec: containers: - name: postgres job: - - name: pg + - backup: backup-pg + restore: restore-pg # - kind: Job # name: backup-pg # steps: