Added field validation tags
This commit is contained in:
parent
e83e18d575
commit
1424178873
@ -36,6 +36,7 @@ type Step struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Target struct {
|
type Target struct {
|
||||||
|
// +kubebuilder:validation:Enum=Deployment;Task
|
||||||
Kind string `json:"kind"`
|
Kind string `json:"kind"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
// +optional
|
// +optional
|
||||||
@ -45,6 +46,7 @@ type Target struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Paths []string `json:"paths,omitempty"`
|
Paths []string `json:"paths,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
|
// +kubebuilder:validation:MinItems=1
|
||||||
Steps []Step `json:"steps,omitempty"`
|
Steps []Step `json:"steps,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +65,10 @@ type BackupConfigurationSpec struct {
|
|||||||
|
|
||||||
// Foo is an example field of BackupConfiguration. Edit BackupConfiguration_types.go to remove/update
|
// Foo is an example field of BackupConfiguration. Edit BackupConfiguration_types.go to remove/update
|
||||||
Repository `json:"repository"`
|
Repository `json:"repository"`
|
||||||
Schedule string `json:"schedule"`
|
|
||||||
|
// +optional
|
||||||
|
Schedule string `json:"schedule,omitempty"`
|
||||||
|
// +kubebuilder:validation:MinItems=1
|
||||||
Targets []Target `json:"targets"`
|
Targets []Target `json:"targets"`
|
||||||
// +optional
|
// +optional
|
||||||
Keep `json:"keep,omitempty"`
|
Keep `json:"keep,omitempty"`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user