validation

package
v1.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 25 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddValidator

func AddValidator(schema apiextensionsv1.CustomResourceDefinition) error

AddSchema manually add an OpenAPI schema for a CRD

func AddWarning

func AddWarning(warnings *[]string, path field.Path, message string, groupVersionKind schema.GroupVersionKind, name string)

AddWarning is a helper function so all warnings have the same formating

func ApplySchemaDefaults

func ApplySchemaDefaults(raw map[string]any) (map[string]any, error)

func ApplySchemaDefaultsStr

func ApplySchemaDefaultsStr(yamlString string) (string, error)

func CheckBaseURLImmutability

func CheckBaseURLImmutability(oldProvider BaseURLProvider, newProvider BaseURLProvider, reasons *[]string)

func CheckURLImmutability

func CheckURLImmutability(oldURL, newURL model.URL, allErrs *field.ErrorList, path *field.Path)

func LoadSchemasForCRD

func LoadSchemasForCRD(cfg *rest.Config, namespace, name string) error

LoadSchemaForCRD extracts OpenAPI schemas for a specific CRD from a Kubernetes cluster

func ValidateBaseURL

func ValidateBaseURL(baseURL string) error

ValidateBaseURL Checks if the baseURL is https and has a path

func ValidateIngressRouteURLsContainsBaseURL

func ValidateIngressRouteURLsContainsBaseURL(urls model.IngressRouteURLs, baseURL model.URL, path *field.Path) *field.Error

func ValidateIngressRouteURLsNotRemoved

func ValidateIngressRouteURLsNotRemoved(oldURLs, newURLs model.IngressRouteURLs, allErrs *field.ErrorList, path *field.Path)

func ValidateLabelsOnCreate

func ValidateLabelsOnCreate(labels map[string]string) *field.Error

ValidateLabelsOnCCreate Checks labels on creation

func ValidateLabelsOnUpdate

func ValidateLabelsOnUpdate(oldLabels, newLabels map[string]string, allErrs *field.ErrorList)

ValidateLabelsOnUpdate Checks if the old and new label set are exactly the same

func ValidateSchema

func ValidateSchema(yamlString string) error

ValidateSchema validates incoming data against a OpenAPI specification

Types

type BaseURLProvider

type BaseURLProvider interface {
	GetBaseUrl() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL