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

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
This commit is contained in:
Ashish Amarnath
2020-08-11 10:13:41 -07:00
committed by GitHub
parent 4364a813c1
commit 9b9bb62968
4 changed files with 5 additions and 6 deletions
@@ -0,0 +1,2 @@
Make init and exec restore hooks as optional in restore hookSpec
-3
View File
@@ -1466,9 +1466,6 @@ spec:
to complete.
type: string
type: object
required:
- exec
- init
type: object
type: array
required:
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -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