Versions in this module Expand all Collapse all v4 v4.6.0 Dec 20, 2024 Changes in this version + const Apply + const CLIKubernetes + const CLIOpenShift + const ConfigMap + const ContainerToLocal + const Create + const Delete + const IgnoreContainer + const IgnoreNamespace + const IgnoreNode + const JSON + const LocalToContainer + const Namespace + const Node + const Pod + const Secret + const Storagebackendclaim + const StoragebackendclaimContent + const Unknown + const YAML + func DiscoverKubernetesCLI(detailPath string) (string, error) + func LoadSupportedCLI() []func() (string, error) + func RegisterClient(name string, client KubernetesClient) + type CommonCallHandler struct + func NewCommonCallHandler[T any](client KubernetesClient) *CommonCallHandler[T] + func (r *CommonCallHandler[T]) CheckObjectExist(ctx context.Context, namespace, nodeName, objectName string) (bool, error) + func (r *CommonCallHandler[T]) Create(t T) error + func (r *CommonCallHandler[T]) DeleteByNames(namespace string, names ...string) error + func (r *CommonCallHandler[T]) GetObject(ctx context.Context, namespace, nodeName string, objectName ...string) (T, error) + func (r *CommonCallHandler[T]) QueryByName(namespace, name string) (T, error) + func (r *CommonCallHandler[T]) QueryList(namespace string, names ...string) ([]T, error) + func (r *CommonCallHandler[T]) Update(t T) error + type CopyType byte + type Filter struct + type KubernetesCLI struct + func (k *KubernetesCLI) CLI() string + func (k *KubernetesCLI) CheckResourceExist(name, namespace string, resourceType ResourceType) (bool, error) + func (k *KubernetesCLI) CopyContainerFileToLocal(ctx context.Context, namespace, containerName, src, dst string, ...) ([]byte, error) + func (k *KubernetesCLI) DeleteFinalizersInResourceByQualifiedNames(qualifiedNames []string, namespace string) error + func (k *KubernetesCLI) DeleteResourceByQualifiedNames(qualifiedNames []string, namespace string) (string, error) + func (k *KubernetesCLI) ExecCmdInSpecifiedContainer(ctx context.Context, namespace, containerName, cmd string, podName ...string) ([]byte, error) + func (k *KubernetesCLI) GetConsoleLogs(ctx context.Context, namespace, containerName string, isHistoryLogs bool, ...) ([]byte, error) + func (k *KubernetesCLI) GetNameSpace() (string, error) + func (k *KubernetesCLI) GetObject(ctx context.Context, objectType ObjectType, namespace, nodeName string, ...) error + func (k *KubernetesCLI) GetResource(name []string, namespace, outputType string, resourceType ResourceType) ([]byte, error) + func (k *KubernetesCLI) OperateResourceByYaml(yaml, operate string, ignoreNotfound bool) error + type KubernetesCLIArgs struct + func NewKubernetesCLIArgs(client string) *KubernetesCLIArgs + func (k *KubernetesCLIArgs) Copy(ctx context.Context, containerPath, localPath string, cpType CopyType) ([]byte, error) + func (k *KubernetesCLIArgs) Exec(ctx context.Context, cmd string) ([]byte, error) + func (k *KubernetesCLIArgs) Get(ctx context.Context, data interface{}) error + func (k *KubernetesCLIArgs) Logs(ctx context.Context) ([]byte, error) + func (k *KubernetesCLIArgs) SelectObject(objectType ObjectType, objectName ...string) *KubernetesCLIArgs + func (k *KubernetesCLIArgs) WithHistoryLogs(isHistoryLog bool) *KubernetesCLIArgs + func (k *KubernetesCLIArgs) WithIgnoreNotFound() *KubernetesCLIArgs + func (k *KubernetesCLIArgs) WithOutPutFormat(outputType OutputType) *KubernetesCLIArgs + func (k *KubernetesCLIArgs) WithSpecifiedContainer(containerName string) *KubernetesCLIArgs + func (k *KubernetesCLIArgs) WithSpecifiedNamespace(namespace string) *KubernetesCLIArgs + func (k *KubernetesCLIArgs) WithSpecifiedNode(nodeName string) *KubernetesCLIArgs + type KubernetesClient interface + CLI func() string + CheckResourceExist func(name, namespace string, resourceType ResourceType) (bool, error) + CopyContainerFileToLocal func(ctx context.Context, namespace, containerName, src, dst string, ...) ([]byte, error) + DeleteFinalizersInResourceByQualifiedNames func(qualifiedNames []string, namespace string) error + DeleteResourceByQualifiedNames func(qualifiedNames []string, namespace string) (string, error) + ExecCmdInSpecifiedContainer func(ctx context.Context, namespace, containerName, cmd string, podName ...string) ([]byte, error) + GetConsoleLogs func(ctx context.Context, namespace, containerName string, isHistoryLogs bool, ...) ([]byte, error) + GetNameSpace func() (string, error) + GetObject func(ctx context.Context, objectType ObjectType, namespace, nodeName string, ...) error + GetResource func(name []string, namespace, outputType string, resourceType ResourceType) ([]byte, error) + OperateResourceByYaml func(yaml, operate string, ignoreNotfound bool) error + func LoadSupportedClient(name string) (KubernetesClient, error) + type ListResult struct + Items []T + type ObjectType string + type OutputType string + type ResourceType string + func GetResourceTypeByT[T any]() (ResourceType, error)