util

package
v0.0.0-...-23ccc0c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanVerbResource

func CanVerbResource(cli dynamic.Interface, gvr schema.GroupVersionResource, verb string, namespace string) (bool, error)

CanVerbResource will create a SelfSubjectAccessReview for a given resource, verb, and namespace and return whether or not a user/ServiceAccount has the permissions to "verb" (get, list, watch, etc.) the given resource in the given namespace. A namespace value of ""(empty) will result in checking permissions in all namespaces (cluster-scoped)

func DeduplicateList

func DeduplicateList(objs []runtime.Object) ([]runtime.Object, error)

DeduplicateList is meant to remove duplicate objects from a list of objects

func DefaultOpts

func DefaultOpts(config *rest.Config, opts cache.Options) (cache.Options, error)

func HashObject

func HashObject(obj interface{}) string

HashObject calculates a hash from an object

func IsAPINamespaced

func IsAPINamespaced(obj runtime.Object, scheme *runtime.Scheme, restmapper apimeta.RESTMapper) (bool, error)

IsAPINamespaced returns true if the object is namespace scoped. For unstructured objects the gvk is found from the object itself.

func IsAPINamespacedWithGVK

func IsAPINamespacedWithGVK(gk schema.GroupVersionKind, scheme *runtime.Scheme, restmapper apimeta.RESTMapper) (bool, error)

IsAPINamespacedWithGVK returns true if the object having the provided GVK is namespace scoped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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