Documentation ¶
Index ¶
- func BytesToUnstructured(data []byte) (*unstructured.Unstructured, error)
- func CRDsInstalled(apiserverClient apiserver.Interface) error
- func ContainsKind(list []string, kind string) bool
- func GetKindFromGVK(str string) (string, string)
- func GetObjectWithTombstone(obj interface{}) interface{}
- func GroupVersionMatches(groupVersion, serverResourceGroupVersion string) bool
- func HigherThanKubernetesVersion(client discovery.ServerVersionInterface, log logr.Logger, ...) bool
- func IsSubresource(resourceName string) bool
- func LabelSelectorContainsWildcard(v *metav1.LabelSelector) bool
- func NewUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured
- func NewUnstructuredWithSpec(apiVersion, kind, namespace, name string, spec map[string]interface{}) *unstructured.Unstructured
- func ObjToUnstructured(obj interface{}) (*unstructured.Unstructured, error)
- func ParseKindSelector(input string) (string, string, string, string)
- func RedactSecret(resource *unstructured.Unstructured) (unstructured.Unstructured, error)
- func SplitSubresource(s string) (kind string, subresource string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToUnstructured ¶ added in v1.9.0
func BytesToUnstructured(data []byte) (*unstructured.Unstructured, error)
BytesToUnstructured converts the resource to unstructured format
func CRDsInstalled ¶ added in v1.9.0
CRDsInstalled checks if the Kyverno CRDs are installed or not
func ContainsKind ¶
ContainsKind - check if kind is in list
func GetKindFromGVK ¶
GetKindFromGVK - get kind and APIVersion from GVK
func GetObjectWithTombstone ¶
func GetObjectWithTombstone(obj interface{}) interface{}
func GroupVersionMatches ¶ added in v1.9.0
GroupVersionMatches - check if the given group version matches the server resource group version. If the group version contains a wildcard, it will match any version, but the group must match. Returns false if the supplied group version is empty, that condition should be checked before calling this function.
func HigherThanKubernetesVersion ¶ added in v1.9.0
func HigherThanKubernetesVersion(client discovery.ServerVersionInterface, log logr.Logger, major, minor, patch int) bool
HigherThanKubernetesVersion compare Kubernetes client version to user given version
func IsSubresource ¶ added in v1.9.0
IsSubresource returns true if the resource is a subresource
func LabelSelectorContainsWildcard ¶
func LabelSelectorContainsWildcard(v *metav1.LabelSelector) bool
func NewUnstructured ¶
func NewUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured
func NewUnstructuredWithSpec ¶
func NewUnstructuredWithSpec(apiVersion, kind, namespace, name string, spec map[string]interface{}) *unstructured.Unstructured
func ObjToUnstructured ¶ added in v1.9.0
func ObjToUnstructured(obj interface{}) (*unstructured.Unstructured, error)
func ParseKindSelector ¶ added in v1.10.0
func RedactSecret ¶ added in v1.9.0
func RedactSecret(resource *unstructured.Unstructured) (unstructured.Unstructured, error)
RedactSecret masks keys of data and metadata.annotation fields of Secrets.
func SplitSubresource ¶
SplitSubresource - split subresource from kind
Types ¶
This section is empty.