Documentation ¶
Index ¶
- func FQN(ns, n string) string
- func GetDefaultContainer(m metav1.ObjectMeta, spec v1.PodSpec) (string, bool)
- func MetaFQN(m metav1.ObjectMeta) string
- type ContextKey
- type Factory
- type GVR
- func (g GVR) AsResourceName() string
- func (g GVR) FQN(n string) string
- func (g GVR) G() string
- func (g GVR) GR() *schema.GroupResource
- func (g GVR) GV() schema.GroupVersion
- func (g GVR) GVK() schema.GroupVersionKind
- func (g GVR) GVR() schema.GroupVersionResource
- func (g GVR) R() string
- func (g GVR) RG() (string, string)
- func (g GVR) String() string
- func (g GVR) SubResource() string
- func (g GVR) V() string
- type GVRs
- type Generic
- type NonResource
- type Pod
- func (p *Pod) Containers(path string, includeInit bool) ([]string, error)
- func (p *Pod) Get(ctx context.Context, path string) (runtime.Object, error)
- func (p *Pod) GetInstance(fqn string) (*v1.Pod, error)
- func (p *Pod) GetPodSpec(path string) (*v1.PodSpec, error)
- func (p *Pod) IsHappy(po v1.Pod) bool
- func (p *Pod) List(ctx context.Context, ns string) ([]runtime.Object, error)
- func (p *Pod) Pod(fqn string) (string, error)
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultContainer ¶
GetDefaultContainer returns a container name if specified in an annotation.
func MetaFQN ¶
func MetaFQN(m metav1.ObjectMeta) string
MetaFQN returns a fully qualified resource name.
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey represents context key.
const ( KeyFactory ContextKey = "factory" KeyLabels ContextKey = "labels" KeyFields ContextKey = "fields" KeyTable ContextKey = "table" KeyDir ContextKey = "dir" KeyPath ContextKey = "path" KeySubject ContextKey = "subject" KeyGVR ContextKey = "gvr" KeyForwards ContextKey = "forwards" KeyContainers ContextKey = "containers" KeyBenchCfg ContextKey = "benchcfg" KeyAliases ContextKey = "aliases" KeyUID ContextKey = "uid" KeySubjectKind ContextKey = "subjectKind" KeySubjectName ContextKey = "subjectName" KeyNamespace ContextKey = "namespace" KeyCluster ContextKey = "cluster" KeyApp ContextKey = "app" KeyStyles ContextKey = "styles" KeyMetrics ContextKey = "metrics" KeyHasMetrics ContextKey = "has-metrics" KeyToast ContextKey = "toast" KeyWithMetrics ContextKey = "withMetrics" KeyViewConfig ContextKey = "viewConfig" KeyWait ContextKey = "wait" )
A collection of context keys.
type Factory ¶
type Factory interface { // Get fetch a give resource. Get(gvr, path string, wait bool, sel labels.Selector) (runtime.Object, error) // List fetch a collection of resources. List(gvr, ns string, wait bool, sel labels.Selector) ([]runtime.Object, error) // ForResource fetch an informer for a given resource. ForResource(ns, gvr string) (informers.GenericInformer, error) // CanForResource fetch an informer for a given resource if authorized CanForResource(ns, gvr string, verbs []string) (informers.GenericInformer, error) // WaitForCacheSync synchronize the cache. WaitForCacheSync() }
type GVR ¶
type GVR struct {
// contains filtered or unexported fields
}
GVR represents a kubernetes resource schema as a string. Format is group/version/resources:subresource.
func FromGVAndR ¶
FromGVAndR builds a gvr from a group/version and resource.
func NewGVRFromMeta ¶
func NewGVRFromMeta(a metav1.APIResource) GVR
NewGVRFromMeta builds a gvr from resource metadata.
func (GVR) AsResourceName ¶
AsResourceName returns a resource . separated descriptor in the shape of kind.version.group.
func (GVR) GV ¶
func (g GVR) GV() schema.GroupVersion
GV returns the group version scheme representation.
func (GVR) GVK ¶
func (g GVR) GVK() schema.GroupVersionKind
GVK returns a full schema representation.
func (GVR) GVR ¶
func (g GVR) GVR() schema.GroupVersionResource
GVR returns a full schema representation.
func (GVR) SubResource ¶
SubResource returns a sub resource if available.
type Generic ¶
type Generic struct {
NonResource
}
type NonResource ¶
type NonResource struct { Factory // contains filtered or unexported fields }
NonResource represents a non k8s resource.
func (*NonResource) GetFactory ¶
func (n *NonResource) GetFactory() Factory
func (*NonResource) Init ¶
func (n *NonResource) Init(f Factory, gvr GVR)
Init initializes the resource.
type Pod ¶
type Pod struct {
Resource
}
Pod represents a pod resource.
func (*Pod) Containers ¶
Containers returns all container names on pod.
func (*Pod) GetInstance ¶
GetInstance returns a pod instance.
func (*Pod) GetPodSpec ¶
GetPodSpec returns a pod spec given a resource.