Documentation ¶
Index ¶
- func ApplyCRSpec(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) error
- func CreateCR(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) error
- func GetLabel(un *unstructured.Unstructured, key string) (string, error)
- func GetResource(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) (*unstructured.Unstructured, error)
- func GetSecret(ctx context.Context, client k8sClient.Client, namespace, secretName string) (*corev1.Secret, error)
- func IsValidKubernetesManifestFile(fileName string) bool
- func IsValidKubernetesNamespace(name string) bool
- func NewKubectl() kube.Kubectl
- func NewPodDisruptionBudget(name, namespace string, maxUnavailable int32, ...) *policyv1.PodDisruptionBudget
- func ObjectToUnstructured(object *GenericObject) (*unstructured.Unstructured, error)
- func SetLabel(target *unstructured.Unstructured, key, val string) error
- func StartConfigMapWatcher(ctx context.Context, config *rest.Config) error
- func UpdateStatus(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) error
- type GenericObject
- type GenericStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyCRSpec ¶
func ApplyCRSpec(ctx context.Context, restConfig *rest.Config, object *GenericObject, pluralName string) error
ApplyCRSpec either creates or updates an object identified by the RawExtension, using the new definition, first checking to see if there's a difference in Spec before applying TODO: use CreateCR and UpdateCR instead
func GetLabel ¶ added in v0.2.0
func GetLabel(un *unstructured.Unstructured, key string) (string, error)
GetLabel returns the label identified by "key"
func GetResource ¶
func GetResource( ctx context.Context, restConfig *rest.Config, object *GenericObject, pluralName string, ) (*unstructured.Unstructured, error)
func GetSecret ¶
func GetSecret(ctx context.Context, client k8sClient.Client, namespace, secretName string) (*corev1.Secret, error)
GetSecret gets secret using the kubernetes client
func NewKubectl ¶
func NewPodDisruptionBudget ¶ added in v0.2.0
func NewPodDisruptionBudget(name, namespace string, maxUnavailable int32, ownerReference []metav1.OwnerReference) *policyv1.PodDisruptionBudget
func ObjectToUnstructured ¶
func ObjectToUnstructured(object *GenericObject) (*unstructured.Unstructured, error)
func SetLabel ¶ added in v0.2.0
func SetLabel(target *unstructured.Unstructured, key, val string) error
SetLabel sets the label identified by "key" on an unstructured object
func StartConfigMapWatcher ¶
StartConfigMapWatcher will start a watcher for configmaps with the given label key and value
func UpdateStatus ¶ added in v0.2.0
Types ¶
type GenericObject ¶
type GenericObject struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec runtime.RawExtension `json:"spec"` Status runtime.RawExtension `json:"status,omitempty"` }
func GetCR ¶
func GetCR(ctx context.Context, restConfig *rest.Config, object *GenericObject, pluralName string) (*GenericObject, error)
look up a Resource
func UnstructuredToObject ¶
func UnstructuredToObject(u *unstructured.Unstructured) (*GenericObject, error)
type GenericStatus ¶
type GenericStatus struct { Phase string `json:"phase,omitempty"` Conditions []metav1.Condition `json:"conditions,omitempty"` ObservedGeneration int64 `json:"observedGeneration,omitempty"` }
func ParseStatus ¶
func ParseStatus(obj *GenericObject) (GenericStatus, error)
Click to show internal directories.
Click to hide internal directories.