Documentation ¶
Index ¶
- func AncestryPath(ancestors []string) string
- func CleanProtoValue(v *structpb.Value)
- func CleanStructValue(s *structpb.Struct)
- func ConvertCAIToK8s(asset map[string]interface{}) (*unstructured.Unstructured, error)
- func ConvertResourceViaJSONToInterface(asset *validator.Asset) (interface{}, error)
- func ConvertToAdmissionRequest(asset map[string]interface{}) (*admissionv1beta1.AdmissionRequest, error)
- func IsK8S(asset map[string]interface{}) bool
- func SanitizeAncestryPath(asset *validator.Asset) error
- func ValidateAsset(asset *validator.Asset) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AncestryPath ¶
AncestryPath returns the ancestry path from a given ancestors list
func CleanProtoValue ¶
CleanProtoValue recursively updates proto Values that have a nil .Kind field to be a NullValue to avoid issues with the jsonpb.Marshaler. This issue arose when calling GCV from python.
func CleanStructValue ¶
func ConvertCAIToK8s ¶
func ConvertCAIToK8s(asset map[string]interface{}) (*unstructured.Unstructured, error)
ConvertCAIToK8s will convert a supported CAI Asset to a K8S resource and populate any omitted fields.
func ConvertToAdmissionRequest ¶
func ConvertToAdmissionRequest(asset map[string]interface{}) (*admissionv1beta1.AdmissionRequest, error)
ConvertToAdmissionRequest converts a CAI asset containing a K8S type to an AdmissionRequest which is the format that the Gatekeeper Constraint Framework target expects.
func SanitizeAncestryPath ¶
SanitizeAncestryPath will populate the AncestryPath field from the ancestors list, or fix the pre-populated one if no ancestry list is provided.
func ValidateAsset ¶
Types ¶
This section is empty.