kubernetes

package
v1.0.732 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func BytesToUtf8Lf added in v1.0.660

func BytesToUtf8Lf(file []byte) (string, error)

func GetClusterName added in v1.0.596

func GetClusterName(config *rest.Config) string

ExecutePodf runs the specified shell command inside a container of the specified pod

func GetUnstructuredObjects added in v1.0.660

func GetUnstructuredObjects(data []byte) ([]unstructured.Unstructured, error)

func NewClient

func NewClient(logger logger.Logger, kubeconfigPaths ...string) (kubernetes.Interface, *rest.Config, error)

func NewClientWithConfig

func NewClientWithConfig(logger logger.Logger, kubeConfig []byte) (kubernetes.Interface, *rest.Config, error)

Types

type DynamicClient added in v1.0.596

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

DynamicClient is an updated & stripped of kommons client

func NewKubeClient added in v1.0.596

func NewKubeClient(client kubernetes.Interface, config *rest.Config) *DynamicClient

func (*DynamicClient) ExecutePodf added in v1.0.597

func (c *DynamicClient) ExecutePodf(
	ctx context.Context,
	namespace, pod, container string,
	command ...string,
) (string, string, error)

func (*DynamicClient) FetchResources added in v1.0.596

func (c *DynamicClient) FetchResources(
	ctx context.Context,
	resources ...unstructured.Unstructured,
) ([]unstructured.Unstructured, error)

func (*DynamicClient) GetClientByGroupVersionKind added in v1.0.596

func (c *DynamicClient) GetClientByGroupVersionKind(
	group, version, kind string,
) (dynamic.NamespaceableResourceInterface, error)

func (*DynamicClient) GetClientByKind added in v1.0.596

func (c *DynamicClient) GetClientByKind(kind string) (dynamic.NamespaceableResourceInterface, error)

WARN: "Kind" is not specific enough. A cluster can have various resources with the same Kind. example: helmchrats.helm.cattle.io & helmcharts.source.toolkit.fluxcd.io both have HelmChart as the kind.

Use GetClientByGroupVersionKind instead.

func (*DynamicClient) GetDynamicClient added in v1.0.596

func (c *DynamicClient) GetDynamicClient() (dynamic.Interface, error)

GetDynamicClient creates a new k8s client

func (*DynamicClient) GetRestMapper added in v1.0.596

func (c *DynamicClient) GetRestMapper() (meta.RESTMapper, error)

Jump to

Keyboard shortcuts

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