Documentation
¶
Overview ¶
Package kubeutil holds the small object helpers the resourcekeeper library needs, copied from pkg/oam/util and pkg/utils so the library depends on neither. Behaviour matches the originals, which kubeutil_test.go checks.
Index ¶
- Constants
- func AddAnnotations(o labelAnnotationObject, annos map[string]string)
- func AddLabels(o labelAnnotationObject, labels map[string]string)
- func EscapeResourceNameToLabelValue(resourceName string) string
- func ExtractRevisionNum(appRevision string, delimiter string) (int, error)
- func IsClusterScope(gvk schema.GroupVersionKind, mapper meta.RESTMapper) (bool, error)
- func IsNotFoundOrClusterNotExists(err error) bool
- func RemoveAnnotations(o labelAnnotationObject, removeKeys []string)
- func RemoveLabels(o labelAnnotationObject, removeKeys []string)
Constants ¶
const ErrBadRevision = "bad revision name"
ErrBadRevision is returned by ExtractRevisionNum for a name without a -v<N> suffix.
Variables ¶
This section is empty.
Functions ¶
func AddAnnotations ¶
AddAnnotations merges annotations into the object's annotations, overriding existing keys.
func EscapeResourceNameToLabelValue ¶
EscapeResourceNameToLabelValue makes a resource name usable as a label value.
func ExtractRevisionNum ¶
ExtractRevisionNum returns N from a revision name ending <delimiter>vN.
func IsClusterScope ¶
func IsClusterScope(gvk schema.GroupVersionKind, mapper meta.RESTMapper) (bool, error)
IsClusterScope reports whether gvk is a cluster-scoped kind.
func IsNotFoundOrClusterNotExists ¶
IsNotFoundOrClusterNotExists reports a NotFound error, or cluster-gateway's error for a cluster that does not exist (matched on its message, as pkg/multicluster does).
func RemoveAnnotations ¶
func RemoveAnnotations(o labelAnnotationObject, removeKeys []string)
RemoveAnnotations removes the given annotation keys.
func RemoveLabels ¶
func RemoveLabels(o labelAnnotationObject, removeKeys []string)
RemoveLabels removes the given label keys.
Types ¶
This section is empty.