asset

package
v0.0.0-...-0da46e6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AncestryPath

func AncestryPath(ancestors []string) string

AncestryPath returns the ancestry path from a given ancestors list

func CleanProtoValue

func CleanProtoValue(v *structpb.Value)

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 CleanStructValue(s *structpb.Struct)

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 ConvertResourceViaJSONToInterface

func ConvertResourceViaJSONToInterface(asset *validator.Asset) (interface{}, error)

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 IsK8S

func IsK8S(asset map[string]interface{}) bool

IsK8S returns true if the CAI asset is an asset from a kubernetes cluster.

func SanitizeAncestryPath

func SanitizeAncestryPath(asset *validator.Asset) error

SanitizeAncestryPath will populate the AncestryPath field from the ancestors list, or fix the pre-populated one if no ancestry list is provided.

func ValidateAsset

func ValidateAsset(asset *validator.Asset) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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