Skip to content

Commit

Permalink
api: make timeout an int
Browse files Browse the repository at this point in the history
This is for compatibility with other consumers of recipes.

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
Co-Authored-by: Jose A. Rivera <jarrpa@redhat.com>
  • Loading branch information
2 people authored and ShyamsundarR committed Sep 18, 2024
1 parent 179ee37 commit bd385d7
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions api/v1alpha1/recipe_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,8 @@ type Hook struct {
// +kubebuilder:validation:Enum=fail;continue
// +kubebuilder:default=fail
OnError string `json:"onError,omitempty"`
// Default timeout applied to custom and built-in operations. If not specified, equals to 30s.
//+kubebuilder:validation:Format=duration
//+optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
// Default timeout in seconds applied to custom and built-in operations. If not specified, equals to 30s.
Timeout int `json:"timeout,omitempty"`
// Set of operations that the hook can be invoked for
//+listType=map
//+listMapKey=name
Expand All @@ -162,10 +160,8 @@ type Operation struct {
Command []string `json:"command"`
// How to handle command returning with non-zero exit code. Defaults to Fail.
OnError string `json:"onError,omitempty"`
// How long to wait for the command to execute
//+kubebuilder:validation:Format=duration
//+optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
// How long to wait for the command to execute, in seconds
Timeout int `json:"timeout,omitempty"`
// Name of another operation that reverts the effect of this operation (e.g. quiesce vs. unquiesce)
InverseOp string `json:"inverseOp,omitempty"`
}
Expand All @@ -178,10 +174,8 @@ type Check struct {
Condition string `json:"condition,omitempty"`
// How to handle when check does not become true. Defaults to Fail.
OnError string `json:"onError,omitempty"`
// How long to wait for the check to execute
//+kubebuilder:validation:Format=duration
//+optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
// How long to wait for the check to execute, in seconds
Timeout int `json:"timeout,omitempty"`
}

// RecipeStatus defines the observed state of Recipe
Expand Down

0 comments on commit bd385d7

Please sign in to comment.