Documentation ¶
Overview ¶
Package syntax package provides validation checks for syntax errors in Nomos resource directories.
For the purpose of this package, we define a "syntax error" to be a configuration error which can be determined by looking at a single Resource. Examples of syntax errors include invalid names or missing required properties. This is as opposed to "semantic errors", which would include errors such as detecting that two Resources of the same Kind share the same name.
Index ¶
- Constants
- func IllegalFieldsInConfigError(resource client.Object, field id.DisallowedField) status.Error
- func IllegalKindInNamespacesError(resources ...client.Object) status.Error
- func IllegalSystemResourcePlacementError(resource client.Object) status.Error
- func InvalidDirectoryNameError(dir cmpath.Relative) status.Error
- func IsSystemOnly(gvk schema.GroupVersionKind) bool
- func ReservedDirectoryNameError(dir cmpath.Relative) status.Error
Constants ¶
const IllegalFieldsInConfigErrorCode = "1045"
IllegalFieldsInConfigErrorCode is the error code for IllegalFieldsInConfigError
const IllegalKindInNamespacesErrorCode = "1038"
IllegalKindInNamespacesErrorCode is the error code for IllegalKindInNamespacesError
const IllegalSystemResourcePlacementErrorCode = "1033"
IllegalSystemResourcePlacementErrorCode is the error code for IllegalSystemResourcePlacementError
const InvalidDirectoryNameErrorCode = "1028"
InvalidDirectoryNameErrorCode is the error code for InvalidDirectoryNameError
Variables ¶
This section is empty.
Functions ¶
func IllegalFieldsInConfigError ¶
IllegalFieldsInConfigError reports that an object has an illegal field set.
func IllegalKindInNamespacesError ¶
IllegalKindInNamespacesError reports that an object has been illegally defined in namespaces/
func IllegalSystemResourcePlacementError ¶
IllegalSystemResourcePlacementError reports that a configmanagement.gke.io object has been defined outside of system/
func InvalidDirectoryNameError ¶
InvalidDirectoryNameError represents an illegal usage of a reserved name.
func IsSystemOnly ¶
func IsSystemOnly(gvk schema.GroupVersionKind) bool
IsSystemOnly returns true if the GVK is only allowed in the system/ directory. It returns true iff the object is allowed in system/, but no other directories.
Types ¶
This section is empty.