reworked Steps

This commit is contained in:
Jean-Marc ANDRE 2023-03-25 18:23:39 +01:00
parent b7747b635d
commit e73ef7c3f2
3 changed files with 27 additions and 7 deletions

View File

@ -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 {

View File

@ -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
}
}

View File

@ -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: