Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Make init and exec restore hooks omitempty in restore hookSpec #2793

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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