Documentation ¶
Index ¶
- func CollectObjects(namespace string, clients Clients, components []string) ([]*unstructured.Unstructured, error)
- func RebuildObject(m map[string]interface{}) (map[string]interface{}, error)
- func RunApply(config ApplyConfig, opts ...ApplyOpts) error
- func RunDelete(config DeleteConfig, opts ...DeleteOpts) error
- func RunShow(config ShowConfig, opts ...ShowOpts) error
- func SetMetaDataAnnotation(obj metav1.Object, key, value string)
- func SetMetaDataLabel(obj metav1.Object, key, value string)
- func ShowYAML(out io.Writer, apiObjects []*unstructured.Unstructured) error
- type Apply
- type ApplyConfig
- type ApplyOpts
- type Clients
- type Delete
- type DeleteConfig
- type DeleteOpts
- type ObjectInfo
- type ResourceClient
- type ResourceInfo
- type Show
- type ShowConfig
- type ShowOpts
- type UnstructuredSlice
- type Upserter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectObjects ¶ added in v0.11.0
func CollectObjects(namespace string, clients Clients, components []string) ([]*unstructured.Unstructured, error)
CollectObjects collects objects in a cluster namespace.
func RebuildObject ¶ added in v0.11.0
RebuildObject rebuilds the ksonnet generated object from an object on the cluster.
func RunApply ¶
func RunApply(config ApplyConfig, opts ...ApplyOpts) error
RunApply runs apply against a cluster given a configuration.
func RunDelete ¶
func RunDelete(config DeleteConfig, opts ...DeleteOpts) error
RunDelete runs delete against a cluster for a given configuration.
func RunShow ¶
func RunShow(config ShowConfig, opts ...ShowOpts) error
RunShow shows objects for a given configuration.
func SetMetaDataAnnotation ¶ added in v0.11.0
SetMetaDataAnnotation sets an annotation value
func SetMetaDataLabel ¶ added in v0.11.0
SetMetaDataLabel sets a label value
func ShowYAML ¶ added in v0.11.0
func ShowYAML(out io.Writer, apiObjects []*unstructured.Unstructured) error
ShowYAML shows YAML objects.
Types ¶
type Apply ¶
type Apply struct { ApplyConfig // contains filtered or unexported fields }
Apply applies objects to the cluster
type ApplyConfig ¶
type ApplyConfig struct { App app.App ClientConfig *client.Config ComponentNames []string Create bool DryRun bool EnvName string GcTag string SkipGc bool }
ApplyConfig is configuration for Apply.
type Clients ¶ added in v0.12.0
type Clients struct {
// contains filtered or unexported fields
}
Clients is a tuple of Kubernetes clients: dynamic.ClientPool, discovery.DiscoveryInterface.
type Delete ¶
type Delete struct { DeleteConfig // contains filtered or unexported fields }
Delete deletes objects from the cluster.
type DeleteConfig ¶
type DeleteConfig struct { App app.App ClientConfig *client.Config ComponentNames []string EnvName string GracePeriod int64 }
DeleteConfig is configuration for Delete.
type ObjectInfo ¶
type ObjectInfo interface {
ResourceName(d discovery.ServerResourcesInterface, o runtime.Object) string
}
ObjectInfo can retrieve information about an object.
type ResourceClient ¶
type ResourceClient interface { Create() (*unstructured.Unstructured, error) Delete(options *metav1.DeleteOptions) error Get(options metav1.GetOptions) (*unstructured.Unstructured, error) Patch(pt types.PatchType, data []byte) (*unstructured.Unstructured, error) }
ResourceClient is a wrapper for a resource client.
type ResourceInfo ¶ added in v0.11.0
ResourceInfo holds information about cluster resources.
type Show ¶
type Show struct { ShowConfig // contains filtered or unexported fields }
Show shows objects.
type ShowConfig ¶
type ShowConfig struct { App app.App ComponentNames []string EnvName string Format string Out io.Writer }
ShowConfig is configuration for Show.
type UnstructuredSlice ¶ added in v0.12.0
type UnstructuredSlice []*unstructured.Unstructured
UnstructuredSlice is a sortable slice of k8s unstructured.Unstructured objects
func (UnstructuredSlice) Len ¶ added in v0.12.0
func (u UnstructuredSlice) Len() int
func (UnstructuredSlice) Less ¶ added in v0.12.0
func (u UnstructuredSlice) Less(i, j int) bool
func (UnstructuredSlice) Sort ¶ added in v0.12.0
func (u UnstructuredSlice) Sort()
Sort sorts an UnstructuredSlice
func (UnstructuredSlice) Swap ¶ added in v0.12.0
func (u UnstructuredSlice) Swap(i, j int)
type Upserter ¶ added in v0.12.0
type Upserter interface { // Upsert updates or creates an object. Upsert(*unstructured.Unstructured) (string, error) }
Upserter updates or creates objects.