Documentation ¶
Index ¶
Constants ¶
const ( TotallyNotANamespace = "_non_namespaceable_" DefaultNamespace = "default" )
Variables ¶
This section is empty.
Functions ¶
func ParseGroupVersion ¶ added in v0.6.0
ParseGroupVersion parses a KRM metadata apiVersion field.
Types ¶
type Gvk ¶
type Gvk struct { Group string `json:"group,omitempty" yaml:"group,omitempty"` Version string `json:"version,omitempty" yaml:"version,omitempty"` Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` }
Gvk identifies a Kubernetes API type. https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
func GvkFromString ¶
GvkFromString makes a Gvk from the output of Gvk.String().
func (Gvk) ApiVersion ¶ added in v0.6.8
ApiVersion returns the combination of Group and Version
func (Gvk) IsLessThan ¶
IsLessThan returns true if self is less than the argument.
func (Gvk) IsNamespaceableKind ¶
IsNamespaceableKind returns true if x is a namespaceable Gvk Implements https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#not-all-objects-are-in-a-namespace
func (Gvk) IsSelected ¶
IsSelected returns true if `selector` selects `x`; otherwise, false. If `selector` and `x` are the same, return true. If `selector` is nil, it is considered a wildcard match, returning true. If selector fields are empty, they are considered wildcards matching anything in the corresponding fields, e.g.
this item:
<Group: "extensions", Version: "v1beta1", Kind: "Deployment">
is selected by
<Group: "", Version: "", Kind: "Deployment">
but rejected by
<Group: "apps", Version: "", Kind: "Deployment">
func (Gvk) StringWoEmptyField ¶ added in v0.6.3
StringWoEmptyField returns a string representation of the GVK. Non-exist fields will be omitted.
type ResId ¶
type ResId struct { // Gvk of the resource. 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 NewResIdKindOnly ¶
NewResIdKindOnly creates a new ResId.
func NewResIdWithNamespace ¶
NewResIdWithNamespace creates new ResId in a given namespace.
func (ResId) EffectiveNamespace ¶
EffectiveNamespace returns a non-ambiguous, non-empty namespace for use in reporting and equality tests.
func (ResId) Equals ¶
Equals returns true if the other id matches namespace/Group/Version/Kind/name.
func (ResId) GvknEquals ¶
GvknEquals returns true if the other id matches Group/Version/Kind/name.
func (ResId) GvknString ¶
GvknString of ResId based on GVK and name
func (ResId) IsInDefaultNs ¶
IsInDefaultNs returns true if id is a namespaceable ResId and the Namespace is either not set or set to DefaultNamespace.
func (ResId) IsNsEquals ¶
IsNsEquals returns true if the id is in the same effective namespace.