Documentation ¶
Index ¶
- Variables
- func CoversImage(ctx context.Context, document, target string) (bool, error)
- func Parse(_ context.Context, document string) ([]*unstructured.Unstructured, error)
- func ParseClusterImagePolicies(ctx context.Context, document string) (cips []*v1beta1.ClusterImagePolicy, warns error, err error)
- func UnsafeParseClusterImagePolicies(ctx context.Context, document string) (cips []*v1beta1.ClusterImagePolicy, err error)
- func Validate(ctx context.Context, document string) (warns error, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyDocument is the error returned when no document body is // specified. ErrEmptyDocument = errors.New("document is required to create policy") // ErrUnknownType is the error returned when a type contained in the policy // is unrecognized. ErrUnknownType = errors.New("unknown type") )
Functions ¶
func CoversImage ¶
CoversImage parses the given policy document, and checks if the target image matches any of the image globs included in the policy.
func Parse ¶
func Parse(_ context.Context, document string) ([]*unstructured.Unstructured, error)
Parse decodes a provided YAML document containing zero or more objects into a collection of unstructured.Unstructured objects.
func ParseClusterImagePolicies ¶
func ParseClusterImagePolicies(ctx context.Context, document string) (cips []*v1beta1.ClusterImagePolicy, warns error, err error)
ParseClusterImagePolicies returns ClusterImagePolicy objects found in the policy document.
func UnsafeParseClusterImagePolicies ¶
func UnsafeParseClusterImagePolicies(ctx context.Context, document string) (cips []*v1beta1.ClusterImagePolicy, err error)
UnsafeParseClusterImagePolicies returns ClusterImagePolicy objects found in the policy document, without validating if the policy is valid.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.