common

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGitBranchOrPolicyPaths added in v1.9.0

func GetGitBranchOrPolicyPaths(gitBranch, repoURL string, policyPaths ...string) (string, string)

func GetKindsFromPolicy

func GetKindsFromPolicy(out io.Writer, policy kyvernov1.PolicyInterface, subresources []v1alpha1.Subresource, dClient dclient.Interface) sets.Set[string]

func GetKindsFromRule

GetKindsFromRule will return the kinds from policy match block

func GetPatchedAndGeneratedResource added in v1.8.0

func GetPatchedAndGeneratedResource(resourceBytes []byte) (unstructured.Unstructured, error)

GetPatchedAndGeneratedResource converts raw bytes to unstructured object

func GetResourceAccordingToResourcePath

func GetResourceAccordingToResourcePath(
	out io.Writer,
	fs billy.Filesystem,
	resourcePaths []string,
	cluster bool,
	policies []kyvernov1.PolicyInterface,
	validatingAdmissionPolicies []admissionregistrationv1alpha1.ValidatingAdmissionPolicy,
	dClient dclient.Interface,
	namespace string,
	policyReport bool,
	policyResourcePath string,
) (resources []*unstructured.Unstructured, err error)

GetResourceAccordingToResourcePath - get resources according to the resource path

func GetResources

func GetResources(
	out io.Writer,
	policies []kyvernov1.PolicyInterface,
	validatingAdmissionPolicies []admissionregistrationv1alpha1.ValidatingAdmissionPolicy,
	resourcePaths []string,
	dClient dclient.Interface,
	cluster bool,
	namespace string,
	policyReport bool,
) ([]*unstructured.Unstructured, error)

GetResources gets matched resources by the given policies the resources are fetched from - local paths to resources, if given - the k8s cluster, if given

func GetResourcesWithTest

func GetResourcesWithTest(out io.Writer, fs billy.Filesystem, policies []kyvernov1.PolicyInterface, resourcePaths []string, policyResourcePath string) ([]*unstructured.Unstructured, error)

GetResourcesWithTest with gets matched resources by the given policies

Types

type KyvernoResources added in v1.10.5

type KyvernoResources struct {
	// contains filtered or unexported fields
}

func (*KyvernoResources) FetchResourcesFromPolicy added in v1.10.5

func (r *KyvernoResources) FetchResourcesFromPolicy(out io.Writer, resourcePaths []string, dClient dclient.Interface, namespace string, policyReport bool) ([]*unstructured.Unstructured, error)

type ValidatingAdmissionResources added in v1.10.5

type ValidatingAdmissionResources struct {
	// contains filtered or unexported fields
}

func (*ValidatingAdmissionResources) FetchResourcesFromPolicy added in v1.10.5

func (r *ValidatingAdmissionResources) FetchResourcesFromPolicy(out io.Writer, resourcePaths []string, dClient dclient.Interface, namespace string, policyReport bool) ([]*unstructured.Unstructured, error)

Jump to

Keyboard shortcuts

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