Documentation
¶
Index ¶
- Constants
- func ParseGroupVersion(apiVersion string) (group, version string)
- type Gvk
- type ResId
- func (id ResId) EffectiveNamespace() string
- func (id ResId) Equals(o ResId) bool
- func (id ResId) GvknEquals(o ResId) bool
- func (id ResId) IsEmpty() bool
- func (id ResId) IsInDefaultNs() bool
- func (id ResId) IsNsEquals(o ResId) bool
- func (id ResId) IsSelectedBy(selector ResId) bool
- func (id ResId) LegacySortString() string
- func (id ResId) String() string
Constants ¶
const ( TotallyNotANamespace = "_non_namespaceable_" DefaultNamespace = "default" )
Variables ¶
This section is empty.
Functions ¶
func ParseGroupVersion ¶
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"` // contains filtered or unexported fields }
Gvk identifies a Kubernetes API type. https://git.k8s.io/design-proposals-archive/api-machinery/api-group.md
func GvkFromNode ¶ added in v0.10.20
func GvkFromString ¶
GvkFromString makes a Gvk from the output of Gvk.String().
func (Gvk) ApiVersion ¶
ApiVersion returns the combination of Group and Version
func (Gvk) AsTypeMeta ¶ added in v0.10.20
AsTypeMeta returns a yaml.TypeMeta from x's information.
func (Gvk) IsClusterScoped ¶ added in v0.10.20
IsClusterScoped returns true if the Gvk is certainly cluster scoped with respect to the available openapi data.
func (Gvk) IsLessThan ¶
IsLessThan returns true if self is less than the argument.
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 ¶
StringWoEmptyField returns a string representation of the GVK. Non-exist fields will be omitted. This is called when generating a filename for the resource.
type ResId ¶
type ResId struct { // Gvk of the resource. Gvk `json:",inline,omitempty" yaml:",inline,omitempty"` // Name of the resource. Name string `json:"name,omitempty" yaml:"name,omitempty"` // Namespace the resource belongs to, if it can belong to a namespace. 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) IsEmpty ¶ added in v0.13.0
IsEmpty returns true of all of the id's fields are empty strings
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.
func (ResId) IsSelectedBy ¶
IsSelectedBy returns true if self is selected by the argument.
func (ResId) LegacySortString ¶ added in v0.13.3
LegacySortString returns an older version of String() that LegacyOrderTransformer depends on to keep its ordering stable across Kustomize versions