kubeutil

package
v1.12.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

View Source
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

func AddAnnotations(o labelAnnotationObject, annos map[string]string)

AddAnnotations merges annotations into the object's annotations, overriding existing keys.

func AddLabels

func AddLabels(o labelAnnotationObject, labels map[string]string)

AddLabels merges labels into the object's labels, overriding existing keys.

func EscapeResourceNameToLabelValue

func EscapeResourceNameToLabelValue(resourceName string) string

EscapeResourceNameToLabelValue makes a resource name usable as a label value.

func ExtractRevisionNum

func ExtractRevisionNum(appRevision string, delimiter string) (int, error)

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

func IsNotFoundOrClusterNotExists(err error) bool

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.

Jump to

Keyboard shortcuts

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