k8s

package
v0.0.0-...-0585a07 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetDeployment(ctx context.Context, name, namespace string) (*kappsv1.Deployment, error)
	UpdateDeployment(ctx context.Context, deployment *kappsv1.Deployment) error
	DeleteDeployment(ctx context.Context, name, namespace string) error
	GetSecret(ctx context.Context, name, namespace string) (*kcorev1.Secret, error)
	GetConfigMap(ctx context.Context, name, namespace string) (*kcorev1.ConfigMap, error)
	DeleteResource(ctx context.Context, object client.Object) error
	PatchApply(ctx context.Context, object client.Object) error
}

func NewKubeClient

func NewKubeClient(client client.Client, fieldManager string,
	dynamicClient dynamic.Interface,
) Client

type KubeClient

type KubeClient struct {
	// contains filtered or unexported fields
}

func (*KubeClient) DeleteDeployment

func (c *KubeClient) DeleteDeployment(ctx context.Context, name, namespace string) error

func (*KubeClient) DeleteResource

func (c *KubeClient) DeleteResource(ctx context.Context, object client.Object) error

func (*KubeClient) GetConfigMap

func (c *KubeClient) GetConfigMap(ctx context.Context, name, namespace string) (*kcorev1.ConfigMap, error)

GetConfigMap returns a ConfigMap based on the given name and namespace.

func (*KubeClient) GetDeployment

func (c *KubeClient) GetDeployment(ctx context.Context, name, namespace string) (*kappsv1.Deployment, error)

func (*KubeClient) GetSecret

func (c *KubeClient) GetSecret(ctx context.Context, name, namespace string) (*kcorev1.Secret, error)

GetSecret returns the secret with the given name.

func (*KubeClient) PatchApply

func (c *KubeClient) PatchApply(ctx context.Context, object client.Object) error

PatchApply uses the server-side apply to create/update the resource. The object must define `GVK` (i.e. object.TypeMeta).

func (*KubeClient) UpdateDeployment

func (c *KubeClient) UpdateDeployment(ctx context.Context, deployment *kappsv1.Deployment) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL