-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
- Loading branch information
1 parent
839fbc1
commit ffde0e8
Showing
15 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package v1alpha1 | ||
|
||
// Condition represents parameters for waiting on a specific condition of a resource. | ||
type Condition struct { | ||
// Name defines the specific condition to wait for, e.g., "Available", "Ready". | ||
Name string `json:"name"` | ||
|
||
// Value defines the specific condition status to wait for, e.g., "True", "False". | ||
// +optional | ||
Value *string `json:"value,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package v1alpha1 | ||
|
||
// Deletion represents parameters for waiting on a resource's deletion. | ||
type Deletion struct{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package v1alpha1 | ||
|
||
// For specifies the condition to wait for. | ||
type For struct { | ||
// Deletion specifies parameters for waiting on a resource's deletion. | ||
// +optional | ||
Deletion *Deletion `json:"deletion,omitempty"` | ||
|
||
// Condition specifies the condition to wait for. | ||
// +optional | ||
Condition *Condition `json:"condition,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package test | ||
|
||
import ( | ||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1" | ||
"k8s.io/apimachinery/pkg/util/validation/field" | ||
) | ||
|
||
func ValidateBinding(path *field.Path, obj v1alpha1.Binding) field.ErrorList { | ||
var errs field.ErrorList | ||
if err := obj.CheckName(); err != nil { | ||
errs = append(errs, field.Invalid(path.Child("name"), obj.Name, err.Error())) | ||
} | ||
return errs | ||
} | ||
|
||
func ValidateBindings(path *field.Path, objs ...v1alpha1.Binding) field.ErrorList { | ||
var errs field.ErrorList | ||
for i, obj := range objs { | ||
errs = append(errs, ValidateBinding(path.Index(i), obj)...) | ||
} | ||
return errs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters