mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
cli for status
This commit is contained in:
@@ -241,6 +241,46 @@ type ObjectMeta struct {
|
||||
Annotations map[string]string `yaml:"annotations,omitempty"`
|
||||
}
|
||||
|
||||
// GetIdentifier returns a ResourceIdentifier that includes
|
||||
// the information needed to uniquely identify a resource in a cluster.
|
||||
func (m *ResourceMeta) GetIdentifier() ResourceIdentifier {
|
||||
return ResourceIdentifier{
|
||||
Name: m.Name,
|
||||
Namespace: m.Namespace,
|
||||
APIVersion: m.APIVersion,
|
||||
Kind: m.Kind,
|
||||
}
|
||||
}
|
||||
|
||||
// ResourceIdentifier contains the information needed to uniquely
|
||||
// identify a resource in a cluster.
|
||||
type ResourceIdentifier struct {
|
||||
// Name is the name of the resource as set in metadata.name
|
||||
Name string `yaml:"name,omitempty"`
|
||||
// Namespace is the namespace of the resource as set in metadata.namespace
|
||||
Namespace string `yaml:"namespace,omitempty"`
|
||||
// ApiVersion is the apiVersion of the resource
|
||||
APIVersion string `yaml:"apiVersion,omitempty"`
|
||||
// Kind is the kind of the resource
|
||||
Kind string `yaml:"kind,omitempty"`
|
||||
}
|
||||
|
||||
func (r *ResourceIdentifier) GetName() string {
|
||||
return r.Name
|
||||
}
|
||||
|
||||
func (r *ResourceIdentifier) GetNamespace() string {
|
||||
return r.Namespace
|
||||
}
|
||||
|
||||
func (r *ResourceIdentifier) GetAPIVersion() string {
|
||||
return r.APIVersion
|
||||
}
|
||||
|
||||
func (r *ResourceIdentifier) GetKind() string {
|
||||
return r.Kind
|
||||
}
|
||||
|
||||
var ErrMissingMetadata = fmt.Errorf("missing Resource metadata")
|
||||
|
||||
// GetMeta returns the ResourceMeta for a RNode
|
||||
|
||||
Reference in New Issue
Block a user