Documentation ¶
Index ¶
- Constants
- func CombineResourceGroup(resource, group []string) string
- func DescribeEvents(el *corev1.EventList, w PrefixWriter)
- func DescribeLimitRanges(limitRanges *corev1.LimitRangeList, w PrefixWriter)
- func DescribePodTemplate(template *corev1.PodTemplateSpec, w PrefixWriter)
- func DescribeProbe(probe *corev1.Probe) string
- func DescribeResourceQuotas(quotas *corev1.ResourceQuotaList, w PrefixWriter)
- func SortedResourceNames(list corev1.ResourceList) []corev1.ResourceName
- type CSINodeDescriber
- type CertificateSigningRequestDescriber
- type ClusterRoleBindingDescriber
- type ClusterRoleDescriber
- type ConfigMapDescriber
- type CronJobDescriber
- type DaemonSetDescriber
- type DeploymentDescriber
- type DescriberFunc
- type DescriberSettings
- type Describers
- type EndpointSliceDescriber
- type EndpointsDescriber
- type EnvVarResolverFunc
- type ErrNoDescriber
- type HorizontalPodAutoscalerDescriber
- type IngressClassDescriber
- type IngressDescriber
- type JobDescriber
- type LeaseDescriber
- type LimitRangeDescriber
- type NamespaceDescriber
- type NetworkPolicyDescriber
- type NodeDescriber
- type ObjectDescriber
- type PersistentVolumeClaimDescriber
- type PersistentVolumeDescriber
- type PodDescriber
- type PodDisruptionBudgetDescriber
- type PodSecurityPolicyDescriber
- type PrefixWriter
- type PriorityClassDescriber
- type ReplicaSetDescriber
- type ReplicationControllerDescriber
- type ResourceDescriber
- func Describer(restClientGetter genericclioptions.RESTClientGetter, mapping *meta.RESTMapping) (ResourceDescriber, error)
- func DescriberFor(kind schema.GroupKind, clientConfig *rest.Config) (ResourceDescriber, bool)
- func GenericDescriberFor(mapping *meta.RESTMapping, clientConfig *rest.Config) (ResourceDescriber, bool)
- type ResourceQuotaDescriber
- type RoleBindingDescriber
- type RoleDescriber
- type SecretDescriber
- type ServiceAccountDescriber
- type ServiceDescriber
- type SortableResourceNames
- type SortableResourceQuotas
- type SortableVolumeDevices
- type SortableVolumeMounts
- type StatefulSetDescriber
- type StorageClassDescriber
Constants ¶
const ( LEVEL_0 = iota LEVEL_1 LEVEL_2 LEVEL_3 LEVEL_4 )
Each level has 2 spaces for PrefixWriter
const ( // LoadBalancerWidth is the width how we describe load balancer LoadBalancerWidth = 16 // LabelNodeRolePrefix is a label prefix for node roles // It's copied over to here until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112 LabelNodeRolePrefix = "node-role.kubernetes.io/" // NodeLabelRole specifies the role of a node NodeLabelRole = "kubernetes.io/role" )
Variables ¶
This section is empty.
Functions ¶
func CombineResourceGroup ¶ added in v0.18.0
func DescribeEvents ¶ added in v0.18.0
func DescribeEvents(el *corev1.EventList, w PrefixWriter)
func DescribeLimitRanges ¶ added in v0.18.0
func DescribeLimitRanges(limitRanges *corev1.LimitRangeList, w PrefixWriter)
DescribeLimitRanges merges a set of limit range items into a single tabular description
func DescribePodTemplate ¶ added in v0.18.0
func DescribePodTemplate(template *corev1.PodTemplateSpec, w PrefixWriter)
func DescribeProbe ¶ added in v0.18.0
DescribeProbe is exported for consumers in other API groups that have probes
func DescribeResourceQuotas ¶ added in v0.18.0
func DescribeResourceQuotas(quotas *corev1.ResourceQuotaList, w PrefixWriter)
DescribeResourceQuotas merges a set of quota items into a single tabular description of all quotas
func SortedResourceNames ¶ added in v0.18.0
func SortedResourceNames(list corev1.ResourceList) []corev1.ResourceName
SortedResourceNames returns the sorted resource names of a resource list.
Types ¶
type CSINodeDescriber ¶ added in v0.18.0
func (*CSINodeDescriber) Describe ¶ added in v0.18.0
func (c *CSINodeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type CertificateSigningRequestDescriber ¶ added in v0.18.0
type CertificateSigningRequestDescriber struct {
// contains filtered or unexported fields
}
func (*CertificateSigningRequestDescriber) Describe ¶ added in v0.18.0
func (p *CertificateSigningRequestDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ClusterRoleBindingDescriber ¶ added in v0.18.0
ClusterRoleBindingDescriber generates information about a node.
func (*ClusterRoleBindingDescriber) Describe ¶ added in v0.18.0
func (d *ClusterRoleBindingDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ClusterRoleDescriber ¶ added in v0.18.0
ClusterRoleDescriber generates information about a node.
func (*ClusterRoleDescriber) Describe ¶ added in v0.18.0
func (d *ClusterRoleDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ConfigMapDescriber ¶ added in v0.18.0
ConfigMapDescriber generates information about a ConfigMap
func (*ConfigMapDescriber) Describe ¶ added in v0.18.0
func (d *ConfigMapDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type CronJobDescriber ¶ added in v0.18.0
type CronJobDescriber struct {
// contains filtered or unexported fields
}
CronJobDescriber generates information about a cron job and the jobs it has created.
func (*CronJobDescriber) Describe ¶ added in v0.18.0
func (d *CronJobDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type DaemonSetDescriber ¶ added in v0.18.0
DaemonSetDescriber generates information about a daemon set and the pods it has created.
func (*DaemonSetDescriber) Describe ¶ added in v0.18.0
func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type DeploymentDescriber ¶ added in v0.18.0
type DeploymentDescriber struct {
// contains filtered or unexported fields
}
DeploymentDescriber generates information about a deployment.
func (*DeploymentDescriber) Describe ¶ added in v0.18.0
func (dd *DeploymentDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type DescriberFunc ¶
type DescriberFunc func(restClientGetter genericclioptions.RESTClientGetter, mapping *meta.RESTMapping) (ResourceDescriber, error)
DescriberFunc gives a way to display the specified RESTMapping type
var ( // DescriberFn gives a way to easily override the function for unit testing if needed DescriberFn DescriberFunc = Describer )
type DescriberSettings ¶
type DescriberSettings struct {
ShowEvents bool
}
DescriberSettings holds display configuration for each object describer to control what is printed.
type Describers ¶ added in v0.18.0
type Describers struct {
// contains filtered or unexported fields
}
Describers implements ObjectDescriber against functions registered via Add. Those functions can be strongly typed. Types are exactly matched (no conversion or assignable checks).
func (*Describers) Add ¶ added in v0.18.0
func (d *Describers) Add(fns ...interface{}) error
Add adds one or more describer functions to the Describer. The passed function must match the signature:
func(...) (string, error)
Any number of arguments may be provided.
func (*Describers) DescribeObject ¶ added in v0.18.0
func (d *Describers) DescribeObject(exact interface{}, extra ...interface{}) (string, error)
DescribeObject implements ObjectDescriber and will attempt to print the provided object to a string, if at least one describer function has been registered with the exact types passed, or if any describer can print the exact object in its first argument (the remainder will be provided empty values). If no function registered with Add can satisfy the passed objects, an ErrNoDescriber will be returned TODO: reorder and partial match extra.
type EndpointSliceDescriber ¶ added in v0.18.0
EndpointSliceDescriber generates information about an EndpointSlice.
func (*EndpointSliceDescriber) Describe ¶ added in v0.18.0
func (d *EndpointSliceDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type EndpointsDescriber ¶ added in v0.18.0
EndpointsDescriber generates information about an Endpoint.
func (*EndpointsDescriber) Describe ¶ added in v0.18.0
func (d *EndpointsDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type EnvVarResolverFunc ¶ added in v0.18.0
func EnvValueRetriever ¶ added in v0.18.0
func EnvValueRetriever(pod *corev1.Pod) EnvVarResolverFunc
EnvValueFrom is exported for use by describers in other packages
type ErrNoDescriber ¶
type ErrNoDescriber struct {
Types []string
}
ErrNoDescriber is a structured error indicating the provided object or objects cannot be described.
func (ErrNoDescriber) Error ¶
func (e ErrNoDescriber) Error() string
Error implements the error interface.
type HorizontalPodAutoscalerDescriber ¶ added in v0.18.0
type HorizontalPodAutoscalerDescriber struct {
// contains filtered or unexported fields
}
HorizontalPodAutoscalerDescriber generates information about a horizontal pod autoscaler.
func (*HorizontalPodAutoscalerDescriber) Describe ¶ added in v0.18.0
func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type IngressClassDescriber ¶ added in v0.18.0
type IngressClassDescriber struct {
// contains filtered or unexported fields
}
func (*IngressClassDescriber) Describe ¶ added in v0.18.0
func (i *IngressClassDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type IngressDescriber ¶ added in v0.18.0
type IngressDescriber struct {
// contains filtered or unexported fields
}
func (*IngressDescriber) Describe ¶ added in v0.18.0
func (i *IngressDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type JobDescriber ¶ added in v0.18.0
JobDescriber generates information about a job and the pods it has created.
func (*JobDescriber) Describe ¶ added in v0.18.0
func (d *JobDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type LeaseDescriber ¶ added in v0.19.0
type LeaseDescriber struct {
// contains filtered or unexported fields
}
type LimitRangeDescriber ¶ added in v0.18.0
LimitRangeDescriber generates information about a limit range
func (*LimitRangeDescriber) Describe ¶ added in v0.18.0
func (d *LimitRangeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type NamespaceDescriber ¶ added in v0.18.0
NamespaceDescriber generates information about a namespace
func (*NamespaceDescriber) Describe ¶ added in v0.18.0
func (d *NamespaceDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type NetworkPolicyDescriber ¶ added in v0.18.0
NetworkPolicyDescriber generates information about a networkingv1.NetworkPolicy
func (*NetworkPolicyDescriber) Describe ¶ added in v0.18.0
func (d *NetworkPolicyDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type NodeDescriber ¶ added in v0.18.0
NodeDescriber generates information about a node.
func (*NodeDescriber) Describe ¶ added in v0.18.0
func (d *NodeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ObjectDescriber ¶
type ObjectDescriber interface {
DescribeObject(object interface{}, extra ...interface{}) (output string, err error)
}
ObjectDescriber is an interface for displaying arbitrary objects with extra information. Use when an object is in hand (on disk, or already retrieved). Implementers may ignore the additional information passed on extra, or use it by default. ObjectDescribers may return ErrNoDescriber if no suitable describer is found.
var DefaultObjectDescriber ObjectDescriber
DefaultObjectDescriber can describe the default Kubernetes objects.
type PersistentVolumeClaimDescriber ¶ added in v0.18.0
func (*PersistentVolumeClaimDescriber) Describe ¶ added in v0.18.0
func (d *PersistentVolumeClaimDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PersistentVolumeDescriber ¶ added in v0.18.0
func (*PersistentVolumeDescriber) Describe ¶ added in v0.18.0
func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PodDescriber ¶ added in v0.18.0
PodDescriber generates information about a pod and the replication controllers that create it.
func (*PodDescriber) Describe ¶ added in v0.18.0
func (d *PodDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PodDisruptionBudgetDescriber ¶ added in v0.18.0
func (*PodDisruptionBudgetDescriber) Describe ¶ added in v0.18.0
func (p *PodDisruptionBudgetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PodSecurityPolicyDescriber ¶ added in v0.18.0
PodSecurityPolicyDescriber generates information about a PodSecuritypolicyv1beta1.
func (*PodSecurityPolicyDescriber) Describe ¶ added in v0.18.0
func (d *PodSecurityPolicyDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type PrefixWriter ¶ added in v0.18.0
type PrefixWriter interface { // Write writes text with the specified indentation level. Write(level int, format string, a ...interface{}) // WriteLine writes an entire line with no indentation level. WriteLine(a ...interface{}) // Flush forces indentation to be reset. Flush() }
PrefixWriter can write text at various indentation levels.
func NewNestedPrefixWriter ¶ added in v0.19.0
func NewNestedPrefixWriter(out PrefixWriter, indent int) PrefixWriter
NewPrefixWriter creates a new PrefixWriter.
func NewPrefixWriter ¶ added in v0.18.0
func NewPrefixWriter(out io.Writer) PrefixWriter
NewPrefixWriter creates a new PrefixWriter.
type PriorityClassDescriber ¶ added in v0.18.0
PriorityClassDescriber generates information about a PriorityClass.
func (*PriorityClassDescriber) Describe ¶ added in v0.18.0
func (s *PriorityClassDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ReplicaSetDescriber ¶ added in v0.18.0
ReplicaSetDescriber generates information about a ReplicaSet and the pods it has created.
func (*ReplicaSetDescriber) Describe ¶ added in v0.18.0
func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ReplicationControllerDescriber ¶ added in v0.18.0
ReplicationControllerDescriber generates information about a replication controller and the pods it has created.
func (*ReplicationControllerDescriber) Describe ¶ added in v0.18.0
func (d *ReplicationControllerDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ResourceDescriber ¶ added in v0.18.0
type ResourceDescriber interface {
Describe(namespace, name string, describerSettings DescriberSettings) (output string, err error)
}
ResourceDescriber generates output for the named resource or an error if the output could not be generated. Implementers typically abstract the retrieval of the named object from a remote server.
func Describer ¶
func Describer(restClientGetter genericclioptions.RESTClientGetter, mapping *meta.RESTMapping) (ResourceDescriber, error)
Describer returns a Describer for displaying the specified RESTMapping type or an error.
func DescriberFor ¶ added in v0.18.0
DescriberFor returns the default describe functions for each of the standard Kubernetes types.
func GenericDescriberFor ¶ added in v0.18.0
func GenericDescriberFor(mapping *meta.RESTMapping, clientConfig *rest.Config) (ResourceDescriber, bool)
GenericDescriberFor returns a generic describer for the specified mapping that uses only information available from runtime.Unstructured
type ResourceQuotaDescriber ¶ added in v0.18.0
ResourceQuotaDescriber generates information about a resource quota
func (*ResourceQuotaDescriber) Describe ¶ added in v0.18.0
func (d *ResourceQuotaDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type RoleBindingDescriber ¶ added in v0.18.0
RoleBindingDescriber generates information about a node.
func (*RoleBindingDescriber) Describe ¶ added in v0.18.0
func (d *RoleBindingDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type RoleDescriber ¶ added in v0.18.0
RoleDescriber generates information about a node.
func (*RoleDescriber) Describe ¶ added in v0.18.0
func (d *RoleDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type SecretDescriber ¶ added in v0.18.0
SecretDescriber generates information about a secret
func (*SecretDescriber) Describe ¶ added in v0.18.0
func (d *SecretDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ServiceAccountDescriber ¶ added in v0.18.0
ServiceAccountDescriber generates information about a service.
func (*ServiceAccountDescriber) Describe ¶ added in v0.18.0
func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type ServiceDescriber ¶ added in v0.18.0
ServiceDescriber generates information about a service.
func (*ServiceDescriber) Describe ¶ added in v0.18.0
func (d *ServiceDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type SortableResourceNames ¶ added in v0.18.0
type SortableResourceNames []corev1.ResourceName
func (SortableResourceNames) Len ¶ added in v0.18.0
func (list SortableResourceNames) Len() int
func (SortableResourceNames) Less ¶ added in v0.18.0
func (list SortableResourceNames) Less(i, j int) bool
func (SortableResourceNames) Swap ¶ added in v0.18.0
func (list SortableResourceNames) Swap(i, j int)
type SortableResourceQuotas ¶ added in v0.18.0
type SortableResourceQuotas []corev1.ResourceQuota
func (SortableResourceQuotas) Len ¶ added in v0.18.0
func (list SortableResourceQuotas) Len() int
func (SortableResourceQuotas) Less ¶ added in v0.18.0
func (list SortableResourceQuotas) Less(i, j int) bool
func (SortableResourceQuotas) Swap ¶ added in v0.18.0
func (list SortableResourceQuotas) Swap(i, j int)
type SortableVolumeDevices ¶ added in v0.18.0
type SortableVolumeDevices []corev1.VolumeDevice
func (SortableVolumeDevices) Len ¶ added in v0.18.0
func (list SortableVolumeDevices) Len() int
func (SortableVolumeDevices) Less ¶ added in v0.18.0
func (list SortableVolumeDevices) Less(i, j int) bool
func (SortableVolumeDevices) Swap ¶ added in v0.18.0
func (list SortableVolumeDevices) Swap(i, j int)
type SortableVolumeMounts ¶ added in v0.18.0
type SortableVolumeMounts []corev1.VolumeMount
func (SortableVolumeMounts) Len ¶ added in v0.18.0
func (list SortableVolumeMounts) Len() int
func (SortableVolumeMounts) Less ¶ added in v0.18.0
func (list SortableVolumeMounts) Less(i, j int) bool
func (SortableVolumeMounts) Swap ¶ added in v0.18.0
func (list SortableVolumeMounts) Swap(i, j int)
type StatefulSetDescriber ¶ added in v0.18.0
type StatefulSetDescriber struct {
// contains filtered or unexported fields
}
func (*StatefulSetDescriber) Describe ¶ added in v0.18.0
func (p *StatefulSetDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)
type StorageClassDescriber ¶ added in v0.18.0
func (*StorageClassDescriber) Describe ¶ added in v0.18.0
func (s *StorageClassDescriber) Describe(namespace, name string, describerSettings DescriberSettings) (string, error)