Documentation
¶
Index ¶
- func AddAnnotation(o client.Object, key, value string)
- func AddLabel(o client.Object, key, value string)
- func DeleteYaml(ctx context.Context, c client.Client, yaml []byte) error
- func ObjectsToClientObjects[T client.Object](objs []T) []client.Object
- func YamlToClientObjects(yamlObjects []byte) ([]client.Object, error)
- type KubeClient
- func (c *KubeClient) Create(ctx context.Context, obj kubernetes.Object) error
- func (c *KubeClient) Delete(ctx context.Context, obj kubernetes.Object) error
- func (c *KubeClient) DeleteAllOf(ctx context.Context, obj kubernetes.Object, ...) error
- func (c *KubeClient) Get(ctx context.Context, name, namespace string, obj kubernetes.Object) error
- func (c *KubeClient) List(ctx context.Context, list kubernetes.ObjectList) error
- func (c *KubeClient) Update(ctx context.Context, obj kubernetes.Object) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAnnotation ¶ added in v0.13.0
AddAnnotation adds an annotation to the given object. If the annotation already exists, it overwrites its value.
func AddLabel ¶ added in v0.15.0
AddLabel adds a label to the given object. If the label already exists, it overwrites its value.
func ObjectsToClientObjects ¶ added in v0.12.0
Types ¶
type KubeClient ¶
type KubeClient struct {
// contains filtered or unexported fields
}
Kubeclient implements kubernetes.Client interface using a client.Client as the underlying implementation.
func NewKubeClient ¶
func NewKubeClient(client client.Client) *KubeClient
func (*KubeClient) Create ¶ added in v0.15.2
func (c *KubeClient) Create(ctx context.Context, obj kubernetes.Object) error
Create saves the object obj in the Kubernetes cluster.
func (*KubeClient) Delete ¶ added in v0.15.2
func (c *KubeClient) Delete(ctx context.Context, obj kubernetes.Object) error
Delete deletes the given obj from Kubernetes cluster.
func (*KubeClient) DeleteAllOf ¶ added in v0.15.2
func (c *KubeClient) DeleteAllOf(ctx context.Context, obj kubernetes.Object, opts ...kubernetes.DeleteAllOfOption) error
DeleteAllOf deletes all objects of the given type matching the given options.
func (*KubeClient) Get ¶
func (c *KubeClient) Get(ctx context.Context, name, namespace string, obj kubernetes.Object) error
Get retrieves an obj for the given name and namespace from the Kubernetes Cluster.
func (*KubeClient) List ¶ added in v0.15.2
func (c *KubeClient) List(ctx context.Context, list kubernetes.ObjectList) error
List retrieves list of objects. On a successful call, Items field in the list will be populated with the result returned from the server.
func (*KubeClient) Update ¶ added in v0.15.2
func (c *KubeClient) Update(ctx context.Context, obj kubernetes.Object) error
Update updates the given obj in the Kubernetes cluster.