Documentation ¶
Index ¶
- func CreateResource(ctx context.Context, c client.Client, obj *unstructured.Unstructured) error
- func DeleteResource(ctx context.Context, c client.Client, obj *unstructured.Unstructured) error
- func GetLabel(un *unstructured.Unstructured, key string) (string, error)
- func GetLiveResource(ctx context.Context, object *unstructured.Unstructured, pluralName string) (*unstructured.Unstructured, error)
- func GetResource(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, ...) (*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 ListLiveResource(ctx context.Context, apiGroup string, version string, pluralName string, ...) (*unstructured.UnstructuredList, error)
- func ListResources(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, ...) (*unstructured.UnstructuredList, error)
- func NewKubectl() kube.Kubectl
- func NewPodDisruptionBudget(name, namespace string, maxUnavailable int32, ...) *policyv1.PodDisruptionBudget
- func PatchResource(ctx context.Context, c client.Client, obj *unstructured.Unstructured, ...) error
- func SetDynamicClient(restConfig *rest.Config) error
- func SetLabel(target *unstructured.Unstructured, key, val string) error
- func StartConfigMapWatcher(ctx context.Context, config *rest.Config) error
- func UpdateResource(ctx context.Context, c client.Client, obj *unstructured.Unstructured) error
- type GenericStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResource ¶ added in v0.8.0
func CreateResource(ctx context.Context, c client.Client, obj *unstructured.Unstructured) error
CreateResource creates the resource in the kubernetes cluster
func DeleteResource ¶ added in v0.8.0
func DeleteResource(ctx context.Context, c client.Client, obj *unstructured.Unstructured) error
DeleteResource deletes the resource from the kubernetes cluster
func GetLabel ¶ added in v0.2.0
func GetLabel(un *unstructured.Unstructured, key string) (string, error)
GetLabel returns the label identified by "key"
func GetLiveResource ¶ added in v0.8.0
func GetLiveResource( ctx context.Context, object *unstructured.Unstructured, pluralName string, ) (*unstructured.Unstructured, error)
GetLiveResource converts the generic object to unstructured object and fetches the resource from the API server
func GetResource ¶
func GetResource(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, namespacedName k8stypes.NamespacedName) (*unstructured.Unstructured, error)
GetResource retrieves the resource from the informer cache, if it's not found then it fetches from the API server.
func GetSecret ¶
func GetSecret(ctx context.Context, client k8sClient.Client, namespace, secretName string) (*corev1.Secret, error)
GetSecret gets secret using the kubernetes client
func ListLiveResource ¶ added in v0.8.0
func ListResources ¶ added in v0.8.0
func ListResources(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, opts ...client.ListOption) (*unstructured.UnstructuredList, error)
ListResources retrieves the list of resources from the informer cache, if it's not found then it fetches from the API server.
func NewKubectl ¶
func NewPodDisruptionBudget ¶ added in v0.2.0
func NewPodDisruptionBudget(name, namespace string, maxUnavailable int32, ownerReference []metav1.OwnerReference) *policyv1.PodDisruptionBudget
func PatchResource ¶ added in v0.8.0
func PatchResource( ctx context.Context, c client.Client, obj *unstructured.Unstructured, patch string, patchType k8stypes.PatchType, ) error
func SetDynamicClient ¶ added in v0.8.0
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 UpdateResource ¶ added in v0.8.0
func UpdateResource(ctx context.Context, c client.Client, obj *unstructured.Unstructured) error
UpdateResource updates the resource in the kubernetes cluster
Types ¶
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 *unstructured.Unstructured) (GenericStatus, error)