Documentation ¶
Index ¶
- func CreateCR(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) error
- func CreateUnstructuredCR(ctx context.Context, restConfig *rest.Config, ...) error
- func GetLabel(un *unstructured.Unstructured, key string) (string, error)
- func GetSecret(ctx context.Context, client k8sClient.Client, namespace, secretName string) (*corev1.Secret, error)
- func GetUnstructuredCR(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) (*unstructured.Unstructured, error)
- func IsValidKubernetesManifestFile(fileName string) bool
- func IsValidKubernetesNamespace(name string) bool
- func ListUnstructuredCR(ctx context.Context, restConfig *rest.Config, apiGroup string, version string, ...) (*unstructured.UnstructuredList, error)
- 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 UpdateCR(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) error
- func UpdateUnstructuredCR(ctx context.Context, restConfig *rest.Config, ...) error
- type GenericObject
- func GetCR(ctx context.Context, restConfig *rest.Config, object *GenericObject, ...) (*GenericObject, error)
- func ListCR(ctx context.Context, restConfig *rest.Config, apiGroup string, version string, ...) ([]*GenericObject, error)
- func UnstructuredToObject(u *unstructured.Unstructured) (*GenericObject, error)
- type GenericStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUnstructuredCR ¶ added in v0.4.0
func CreateUnstructuredCR( ctx context.Context, restConfig *rest.Config, unstruc *unstructured.Unstructured, gvr schema.GroupVersionResource, namespace string, name string, ) error
func GetLabel ¶ added in v0.2.0
func GetLabel(un *unstructured.Unstructured, key string) (string, error)
GetLabel returns the label identified by "key"
func GetSecret ¶
func GetSecret(ctx context.Context, client k8sClient.Client, namespace, secretName string) (*corev1.Secret, error)
GetSecret gets secret using the kubernetes client
func GetUnstructuredCR ¶ added in v0.4.0
func GetUnstructuredCR( ctx context.Context, restConfig *rest.Config, object *GenericObject, pluralName string, ) (*unstructured.Unstructured, error)
func ListUnstructuredCR ¶ added in v0.4.0
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 UpdateCR ¶ added in v0.4.0
func UpdateCR( ctx context.Context, restConfig *rest.Config, object *GenericObject, pluralName string, ) error
update the CR in Kubernetes, and if successful, set the GenericObject to point to the result (i.e. goal is to have the right resourceVersion)
func UpdateUnstructuredCR ¶ added in v0.4.0
func UpdateUnstructuredCR( ctx context.Context, restConfig *rest.Config, unstruc *unstructured.Unstructured, gvr schema.GroupVersionResource, namespace string, name string, ) error
update the CR in Kubernetes, and if successful, set the unstruc to point to the result (i.e. goal is to have the right resourceVersion)
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)
func (*GenericObject) DeepCopy ¶ added in v0.4.0
func (obj *GenericObject) DeepCopy() *GenericObject
func (*GenericObject) DeepCopyObject ¶ added in v0.4.0
func (obj *GenericObject) DeepCopyObject() runtime.Object
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.