Documentation ¶
Index ¶
- func CreateCRD(templ *templates.ConstraintTemplate, schema *apiextensions.JSONSchemaProps) (*apiextensions.CustomResourceDefinition, error)
- func CreateSchema(templ *templates.ConstraintTemplate, target MatchSchemaProvider) *apiextensions.JSONSchemaProps
- func ValidateCR(cr *unstructured.Unstructured, crd *apiextensions.CustomResourceDefinition) error
- func ValidateCRD(ctx context.Context, crd *apiextensions.CustomResourceDefinition) error
- func ValidateTargets(templ *templates.ConstraintTemplate) error
- type MatchSchemaProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCRD ¶
func CreateCRD(templ *templates.ConstraintTemplate, schema *apiextensions.JSONSchemaProps) (*apiextensions.CustomResourceDefinition, error)
CreateCRD takes a template and a schema and converts it to a CRD.
func CreateSchema ¶
func CreateSchema(templ *templates.ConstraintTemplate, target MatchSchemaProvider) *apiextensions.JSONSchemaProps
CreateSchema combines the schema of the match target and the ConstraintTemplate parameters to form the schema of the actual constraint resource.
func ValidateCR ¶
func ValidateCR(cr *unstructured.Unstructured, crd *apiextensions.CustomResourceDefinition) error
ValidateCR validates the provided custom resource against its CustomResourceDefinition.
func ValidateCRD ¶
func ValidateCRD(ctx context.Context, crd *apiextensions.CustomResourceDefinition) error
ValidateCRD calls the CRD package's validation on an internal representation of the CRD.
func ValidateTargets ¶
func ValidateTargets(templ *templates.ConstraintTemplate) error
ValidateTargets ensures that the targets field has the appropriate values.
Types ¶
type MatchSchemaProvider ¶
type MatchSchemaProvider interface { // MatchSchema returns the JSON Schema for the `match` field of a constraint MatchSchema() apiextensions.JSONSchemaProps }
Click to show internal directories.
Click to hide internal directories.