resid

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TotallyNotANamespace = "_non_namespaceable_"
	DefaultNamespace     = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ResId

type ResId struct {
	// Gvk of the resource.
	gvk.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"`

	// Name of the resource before transformation.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`

	// Namespace the resource belongs to.
	// An untransformed resource has no namespace.
	// A fully transformed resource has the namespace
	// from the top most overlay.
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
}

ResId is an identifier of a k8s resource object.

func FromString

func FromString(s string) ResId

func NewResId

func NewResId(k gvk.Gvk, n string) ResId

NewResId creates new ResId.

func NewResIdKindOnly

func NewResIdKindOnly(k string, n string) ResId

NewResIdKindOnly creates a new ResId.

func NewResIdWithNamespace

func NewResIdWithNamespace(k gvk.Gvk, n, ns string) ResId

NewResIdWithNamespace creates new ResId in a given namespace.

func (ResId) EffectiveNamespace

func (id ResId) EffectiveNamespace() string

EffectiveNamespace returns a non-ambiguous, non-empty namespace for use in reporting and equality tests.

func (ResId) Equals

func (id ResId) Equals(o ResId) bool

Equals returns true if the other id matches namespace/Group/Version/Kind/name.

func (ResId) GvknEquals

func (id ResId) GvknEquals(o ResId) bool

GvknEquals returns true if the other id matches Group/Version/Kind/name.

func (ResId) GvknString

func (id ResId) GvknString() string

GvknString of ResId based on GVK and name

func (ResId) IsInDefaultNs

func (id ResId) IsInDefaultNs() bool

IsInDefaultNs returns true if id is a namespaceable ResId and the Namespace is either not set or set to DefaultNamespace.

func (ResId) IsNsEquals

func (id ResId) IsNsEquals(o ResId) bool

IsNsEquals returns true if the id is in the same effective namespace.

func (ResId) String

func (id ResId) String() string

String of ResId based on GVK, name and prefix

Jump to

Keyboard shortcuts

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