Documentation ¶
Overview ¶
Package util implements clusterctl utilty functions.
Index ¶
- func FixImages(objs []unstructured.Unstructured, ...) ([]unstructured.Unstructured, error)
- func GetObjectReferences(namespace string, args ...string) ([]corev1.ObjectReference, error)
- func InspectImages(objs []unstructured.Unstructured) ([]string, error)
- func IsClusterResource(kind string) bool
- func IsDeploymentWithManager(obj unstructured.Unstructured) bool
- func IsResourceNamespaced(kind string) bool
- type Cmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixImages ¶
func FixImages(objs []unstructured.Unstructured, alterImageFunc func(image string) (string, error)) ([]unstructured.Unstructured, error)
FixImages alters images using the give alter func NB. The implemented approach is specific for the provider components YAML & for the cert-manager manifest; it is not intended to cover all the possible objects used to deploy containers existing in Kubernetes.
func GetObjectReferences ¶ added in v0.4.0
func GetObjectReferences(namespace string, args ...string) ([]corev1.ObjectReference, error)
GetObjectReferences accepts arguments in resource/name form (e.g. 'resource/<resource_name>') and returns a ObjectReference for each resource/name.
func InspectImages ¶
func InspectImages(objs []unstructured.Unstructured) ([]string, error)
InspectImages identifies the container images required to install the objects defined in the objs. NB. The implemented approach is specific for the provider components YAML & for the cert-manager manifest; it is not intended to cover all the possible objects used to deploy containers existing in Kubernetes.
func IsClusterResource ¶
IsClusterResource returns true if the resource kind is cluster wide (not namespaced).
func IsDeploymentWithManager ¶ added in v0.4.1
func IsDeploymentWithManager(obj unstructured.Unstructured) bool
IsDeploymentWithManager return true if obj is a deployment containing a pod with at least one container named 'manager', that according to the clusterctl contract, identifies the provider's controller.
func IsResourceNamespaced ¶
IsResourceNamespaced returns true if the resource kind is namespaced.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd implements a wrapper on os/exec.cmd.
func (*Cmd) RunAndCapture ¶
RunAndCapture runs the command and captures any output.
func (*Cmd) RunWithEcho ¶
RunWithEcho runs the command and redirects its output to stdout and stderr.