Documentation ¶
Index ¶
- Constants
- Variables
- func ClusterMetadataNameCollisionError(gk schema.GroupKind, name string, duplicates ...client.Object) status.Error
- func DeprecatedGroupKindError(resource client.Object, expected schema.GroupVersionKind) status.Error
- func IllegalClusterSelectorAnnotationError(resource client.Object, annotation string) status.Error
- func IllegalHierarchicalKind(resource client.Object) status.Error
- func IllegalManagementAnnotationError(resource client.Object, value string) status.Error
- func IllegalNamespace(resource client.Object) status.Error
- func IllegalNamespaceOnClusterScopedResourceError(resource client.Object) status.Error
- func IllegalNamespaceSelectorAnnotationError(resource client.Object) status.Error
- func InvalidCRDNameError(resource client.Object, expected string) status.Error
- func InvalidMetadataNameError(resource client.Object) status.Error
- func InvalidNamespaceError(o client.Object) status.Error
- func ManagedResourceInUnmanagedNamespace(namespace string, resources ...client.Object) status.Error
- func MissingNamespaceOnNamespacedResourceError(resource client.Object) status.Error
- func MissingObjectNameError(resource client.Object) status.Error
- func NamespaceAndSelectorResourceError(resource client.Object) status.Error
- func NamespaceCollisionError(name string, duplicates ...client.Object) status.Error
- func NamespaceMetadataNameCollisionError(gk schema.GroupKind, namespace string, name string, ...) status.Error
- func SelectorMetadataNameCollisionError(kind string, name string, duplicates ...client.Object) status.Error
- func UnsupportedCRDRemovalError(resource client.Object) status.Error
- func UnsupportedObjectError(resource client.Object) status.Error
- func ValidManagementAnnotation(o ast.FileObject) status.Error
- func ValidateCRDName(o ast.FileObject) status.Error
- type Validator
Constants ¶
const BadScopeErrCode = "1058"
BadScopeErrCode is the error code indicating that a resource has been declared in a Namespace repository that shouldn't be there.
const DeprecatedGroupKindErrorCode = "1050"
DeprecatedGroupKindErrorCode is the error code for DeprecatedGroupKindError.
const IllegalHierarchicalKindErrorCode = "1032"
IllegalHierarchicalKindErrorCode is the error code for illegalHierarchicalKindErrors.
const IllegalManagementAnnotationErrorCode = "1005"
IllegalManagementAnnotationErrorCode is the error code for IllegalManagementAnnotationError.
const IllegalNamespaceErrorCode = "1034"
IllegalNamespaceErrorCode is the error code for illegal Namespace definitions.
const IllegalNamespaceOnClusterScopedResourceErrorCode = "1052"
IllegalNamespaceOnClusterScopedResourceErrorCode represents a cluster-scoped resource illegally declaring metadata.namespace.
const IllegalSelectorAnnotationErrorCode = "1004"
IllegalSelectorAnnotationErrorCode is the error code for IllegalNamespaceAnnotationError
const InvalidCRDNameErrorCode = "1048"
InvalidCRDNameErrorCode is the error code for InvalidCRDNameError.
const InvalidDirectoryNameErrorCode = "1055"
InvalidDirectoryNameErrorCode is the error code for InvalidDirectoryNameError
const InvalidMetadataNameErrorCode = "1036"
InvalidMetadataNameErrorCode is the error code for InvalidMetadataNameError
const ManagedResourceInUnmanagedNamespaceErrorCode = "1056"
ManagedResourceInUnmanagedNamespaceErrorCode is the error code for illegal managed resources in unmanaged Namespaces.
const MissingNamespaceOnNamespacedResourceErrorCode = "1053"
MissingNamespaceOnNamespacedResourceErrorCode represents a namespace-scoped resource NOT declaring metadata.namespace.
const MissingObjectNameErrorCode = "1031"
MissingObjectNameErrorCode is the error code for MissingObjectNameError
const NameCollisionErrorCode = "1029"
NameCollisionErrorCode is the error code for ObjectNameCollisionError
const UnsupportedCRDRemovalErrorCode = "1047"
UnsupportedCRDRemovalErrorCode is the error code for UnsupportedCRDRemovalError
const UnsupportedObjectErrorCode = "1043"
UnsupportedObjectErrorCode is the error code for UnsupportedObjectError
Variables ¶
var BadScopeErrBuilder = status.NewErrorBuilder(BadScopeErrCode)
BadScopeErrBuilder is an error build for errors related to the object scope errors
Functions ¶
func ClusterMetadataNameCollisionError ¶
func ClusterMetadataNameCollisionError(gk schema.GroupKind, name string, duplicates ...client.Object) status.Error
ClusterMetadataNameCollisionError reports that multiple cluster-scoped objects of the same Kind and namespace have the same metadata.name.
func DeprecatedGroupKindError ¶
func DeprecatedGroupKindError(resource client.Object, expected schema.GroupVersionKind) status.Error
DeprecatedGroupKindError reports usage of a deprecated version of a specific Group/Kind.
func IllegalClusterSelectorAnnotationError ¶
IllegalClusterSelectorAnnotationError reports that a Cluster or ClusterSelector declares the cluster-selector annotation.
func IllegalHierarchicalKind ¶
IllegalHierarchicalKind reports that a type is not permitted if hierarchical parsing is disabled.
func IllegalManagementAnnotationError ¶
IllegalManagementAnnotationError represents an illegal management annotation value. Error implements error.
func IllegalNamespace ¶
IllegalNamespace reports that the controller Namespaces MUST NOT be declared.
func IllegalNamespaceOnClusterScopedResourceError ¶
IllegalNamespaceOnClusterScopedResourceError reports that a cluster-scoped resource MUST NOT declare metadata.namespace.
func IllegalNamespaceSelectorAnnotationError ¶
IllegalNamespaceSelectorAnnotationError reports that a cluster-scoped object declares the namespace-selector annotation.
func InvalidCRDNameError ¶
InvalidCRDNameError reports a CRD with an invalid name in the repo.
func InvalidMetadataNameError ¶
InvalidMetadataNameError represents the usage of a non-RFC1123 compliant metadata.name
func InvalidNamespaceError ¶
InvalidNamespaceError reports using an illegal Namespace.
func ManagedResourceInUnmanagedNamespace ¶
ManagedResourceInUnmanagedNamespace represents managed resources illegally declared in an unmanaged Namespace.
func MissingNamespaceOnNamespacedResourceError ¶
MissingNamespaceOnNamespacedResourceError reports a namespace-scoped resource MUST declare metadata.namespace. when parsing in non-hierarchical mode.
func MissingObjectNameError ¶
MissingObjectNameError reports that an object has no name.
func NamespaceAndSelectorResourceError ¶
NamespaceAndSelectorResourceError reports that a namespace-scoped resource illegally declares both metadata.namespace and has the namespace-selector annotation.
func NamespaceCollisionError ¶
NamespaceCollisionError reports multiple declared Namespaces with the same name.
func NamespaceMetadataNameCollisionError ¶
func NamespaceMetadataNameCollisionError(gk schema.GroupKind, namespace string, name string, duplicates ...client.Object) status.Error
NamespaceMetadataNameCollisionError reports that multiple namespace-scoped objects of the same Kind and namespace have the same metadata name
func SelectorMetadataNameCollisionError ¶
func SelectorMetadataNameCollisionError(kind string, name string, duplicates ...client.Object) status.Error
SelectorMetadataNameCollisionError reports that multiple ClusterSelectors or NamespaceSelectors have the same metadata.name.
func UnsupportedCRDRemovalError ¶
UnsupportedCRDRemovalError reports than a CRD was removed, but its corresponding CRs weren't.
func UnsupportedObjectError ¶
UnsupportedObjectError reports than an unsupported object is in the namespaces/ sub-directories or clusters/ directory.
func ValidManagementAnnotation ¶
func ValidManagementAnnotation(o ast.FileObject) status.Error
ValidManagementAnnotation returns an Error if the user-specified management annotation is invalid.
func ValidateCRDName ¶
func ValidateCRDName(o ast.FileObject) status.Error
ValidateCRDName returns an error
Types ¶
type Validator ¶
type Validator interface { // Validate returns a MultiError if the passed FileObjects fail validation. Validate([]ast.FileObject) status.MultiError }
Validator implementors validate a set of non-hierarchical configuration.
Source Files ¶
- crd_name_validator.go
- crd_removal_validator.go
- deprecated_group_kind_validator.go
- duplicate_name_validator.go
- hierarchical_kind_validator.go
- illegal_crd_validator.go
- illegal_namespace_validator.go
- managed_namespace_validator.go
- management_annotation_validator.go
- name_validator.go
- namespace_validator.go
- scope_validator.go
- selector_annotation_validator.go
- validator.go