Skip to content

Commit

Permalink
🐛 Make init and exec restore hooks as omitempty in restore hookSpec (v…
Browse files Browse the repository at this point in the history
…mware-tanzu#2793)

Signed-off-by: Ashish Amarnath <[email protected]>
  • Loading branch information
ashish-amarnath authored and georgettica committed Jan 26, 2021
1 parent 8727f9c commit d5eae3d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions changelogs/unreleased/2793-ashish-amarnath
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Make init and exec restore hooks as optional in restore hookSpec

3 changes: 0 additions & 3 deletions config/crd/bases/velero.io_restores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1466,9 +1466,6 @@ spec:
to complete.
type: string
type: object
required:
- exec
- init
type: object
type: array
required:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/crds/crds.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/apis/velero/v1/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ type RestoreResourceHookSpec struct {
// RestoreResourceHook defines a restore hook for a resource.
type RestoreResourceHook struct {
// Exec defines an exec restore hook.
Exec *ExecRestoreHook `json:"exec"`
Exec *ExecRestoreHook `json:"exec,omitempty"`

// Init defines an init restore hook.
Init *InitRestoreHook `json:"init"`
Init *InitRestoreHook `json:"init,omitempty"`
}

// ExecRestoreHook is a hook that uses pod exec API to execute a command inside a container in a pod
Expand Down

0 comments on commit d5eae3d

Please sign in to comment.