plugin

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run added in v0.7.0

func Run(o *Options, args []string) error

Types

type Options added in v0.7.0

func NewOptions added in v0.7.0

func NewOptions() *Options

func (Options) AddFlags added in v0.7.0

func (o Options) AddFlags(flags *pflag.FlagSet)

type RenderOptions added in v0.7.0

type RenderOptions struct {
	IncludeOwners             bool
	IncludeEvents             bool
	IncludeMatchingServices   bool
	IncludeMatchingIngresses  bool
	IncludeApplicationDetails bool
	IncludeRolloutDiffs       bool
	Shallow                   bool
	Local                     bool
}

RenderOptions holds the options specific to kubectl-status.

func (RenderOptions) IncludesEnabled added in v0.7.0

func (r RenderOptions) IncludesEnabled() bool

IncludesEnabled is for templates to use.

type RenderableObject added in v0.7.0

type RenderableObject struct {
	unstructured.Unstructured
	// contains filtered or unexported fields
}

RenderableObject is the object passed to the templates, also provides methods to run queries against Kubernetes API. It is an unstructured.Unstructured (so it has the Object field that keeps the Object) but there a numerous helper methods that already helps with the templates.

func (RenderableObject) Annotations added in v0.7.0

func (r RenderableObject) Annotations() (annotations map[string]interface{})

func (RenderableObject) Include added in v0.7.0

func (r RenderableObject) Include(templateName string, data interface{}) (string, error)

func (RenderableObject) IncludeRenderableObject added in v0.7.0

func (r RenderableObject) IncludeRenderableObject(obj RenderableObject) (output string)

func (RenderableObject) Kind added in v0.7.0

func (r RenderableObject) Kind() (kind string)

func (RenderableObject) KubeGet added in v0.7.0

func (r RenderableObject) KubeGet(namespace string, args ...string) (out []RenderableObject)

func (RenderableObject) KubeGetByLabelsMap added in v0.7.0

func (r RenderableObject) KubeGetByLabelsMap(namespace, resourceType string, labels map[string]interface{}) (out []RenderableObject)

KubeGetByLabelsMap returns results similar to this:

> kubectl get -n {namespace} {resourceType} -l {labels_key=label_val,...}

func (RenderableObject) KubeGetEvents added in v0.7.0

func (r RenderableObject) KubeGetEvents() RenderableObject

func (RenderableObject) KubeGetFirst added in v0.7.0

func (r RenderableObject) KubeGetFirst(namespace string, args ...string) RenderableObject

KubeGetFirst returns a new RenderableObject with a nil Object when no object found.

func (RenderableObject) KubeGetIngressesMatchingService added in v0.7.0

func (r RenderableObject) KubeGetIngressesMatchingService(namespace, svcName string) (out []RenderableObject)

func (RenderableObject) KubeGetNodeStatsSummary added in v0.7.0

func (r RenderableObject) KubeGetNodeStatsSummary(nodeName string) map[string]interface{}

func (RenderableObject) KubeGetNonTerminatedPodsOnNode added in v0.7.0

func (r RenderableObject) KubeGetNonTerminatedPodsOnNode(nodeName string) (podList []RenderableObject)

KubeGetNonTerminatedPodsOnNode returns details of all pods which are not in terminal status

func (RenderableObject) KubeGetOwners added in v0.7.0

func (r RenderableObject) KubeGetOwners() (out []RenderableObject)

KubeGetOwners returns the list of objects which are listed in the Owner references of an object.

func (RenderableObject) KubeGetResourcesOwnedOf added in v0.7.0

func (r RenderableObject) KubeGetResourcesOwnedOf(resourceOrKind string) (out []RenderableObject)

KubeGetResourcesOwnedOf is meant to be called from templates. It returns a RenderableObject list for all resources which have provided kind or resource type with the current object listed in the ownerReferences.

func (RenderableObject) KubeGetServicesMatchingLabels added in v0.7.0

func (r RenderableObject) KubeGetServicesMatchingLabels(namespace string, labels map[string]interface{}) (out []RenderableObject)

func (RenderableObject) KubeGetUnifiedDiffString added in v0.7.0

func (r RenderableObject) KubeGetUnifiedDiffString(resourceOrKind, namespace, nameA, nameB string) string

KubeGetUnifiedDiffString generates a unified diff between given 2 resources and ignores several keys which are known to be creating noise in diff, see the removeFieldsThatCreateDiffNoise function to see which fields are being dropped.

func (RenderableObject) Labels added in v0.7.0

func (r RenderableObject) Labels() (labels map[string]interface{})

func (RenderableObject) Metadata added in v0.7.0

func (r RenderableObject) Metadata() (metadata map[string]interface{})

func (RenderableObject) Name added in v0.7.0

func (r RenderableObject) Name() string

func (RenderableObject) Namespace added in v0.7.0

func (r RenderableObject) Namespace() string

func (RenderableObject) RenderOptions added in v0.7.0

func (r RenderableObject) RenderOptions() *RenderOptions

func (RenderableObject) RolloutStatus added in v0.7.0

func (r RenderableObject) RolloutStatus(obj RenderableObject) map[string]interface{}

TODO: write one test that verifies this RolloutStatus returns a map[string]interface{} with 3 keys: done: bool, message, error: string

func (RenderableObject) Spec added in v0.7.0

func (r RenderableObject) Spec() (spec map[string]interface{})

func (RenderableObject) Status added in v0.7.0

func (r RenderableObject) Status() (status map[string]interface{})

func (RenderableObject) StatusConditions added in v0.7.0

func (r RenderableObject) StatusConditions() (conditions []interface{})

func (RenderableObject) String added in v0.7.0

func (r RenderableObject) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳