Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResultsTextTable ¶
ResultsTextTable returns a pretty table that summarizes the results of a kubectl apply run.
Types ¶
type KubeMetadata ¶
type KubeMetadata struct { Name string `json:"name"` Namespace string `json:"namespace"` ResourceVersion string `json:"resourceVersion"` CreationTimestamp string `json:"creationTimestamp"` }
KubeMetadata is basic metadata about an object or list.
type Result ¶
type Result struct { Name string Namespace string Kind string CreatedAt time.Time OldVersion string NewVersion string // contains filtered or unexported fields }
Result represents the result of running "kubectl apply" for a single manifest.
func ObjsToResults ¶
func ObjsToResults( oldObjs []TypedKubeObj, newObjs []TypedKubeObj, ) ([]Result, error)
ObjsToResults diffs old and new object slices to generate a slice of apply results for display to the user.
func (Result) CreatedTimestamp ¶
CreatedTimestamp returns the creation time of the resource associated with this result.
type TypedKubeObj ¶
type TypedKubeObj struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` KubeMetadata `json:"metadata"` Items []TypedKubeObj `json:"items"` }
TypedKubeObj is a typed object that is returned by the kube API. We're using this instead of the formal types from the kube API because it's more flexible and doesn't require registering all types in a scheme, etc.
func KubeJSONToObjects ¶
func KubeJSONToObjects(contents []byte) ([]TypedKubeObj, error)
KubeJSONToObjects converts the results of "kubectl apply ... -o json" into a slice of Kubernetes objects.