Documentation
¶
Index ¶
- func GetClientSet(ctx context.Context) (*kubernetes.Clientset, error)
- func GetClientSetFromKubeconfig(ctx context.Context) (*kubernetes.Clientset, error)
- func GetInClusterClientSet(ctx context.Context) (*kubernetes.Clientset, error)
- func IsInClusterAuthenticationAvailable(ctx context.Context) bool
- func SortResourcesYaml(resourcesYaml string) (sortedResourcesYaml string, err error)
- type CommandExecutorKubernetes
- func (c *CommandExecutorKubernetes) CreateNamespaceByName(ctx context.Context, name string) (createdNamespace Namespace, err error)
- func (c *CommandExecutorKubernetes) DeleteNamespaceByName(ctx context.Context, name string) (err error)
- func (c *CommandExecutorKubernetes) GetCachedContextName() (cachedContextName string, err error)
- func (c *CommandExecutorKubernetes) GetCachedKubectlContext(ctx context.Context) (context string, err error)
- func (c *CommandExecutorKubernetes) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
- func (c *CommandExecutorKubernetes) GetKubectlContext(ctx context.Context) (context string, err error)
- func (c *CommandExecutorKubernetes) GetKubectlContexts() (contexts []KubectlContext, err error)
- func (c *CommandExecutorKubernetes) GetName() (name string, err error)
- func (c *CommandExecutorKubernetes) GetNamespaceByName(name string) (namespace Namespace, err error)
- func (c *CommandExecutorKubernetes) GetResourceByNames(resourceName string, resourceType string, namespaceName string) (resource Resource, err error)
- func (c *CommandExecutorKubernetes) ListNamespaceNames(ctx context.Context) (namespaceNames []string, err error)
- func (c *CommandExecutorKubernetes) ListNamespaces(ctx context.Context) (namespaces []Namespace, err error)
- func (c *CommandExecutorKubernetes) ListResourceNames(options *parameteroptions.ListKubernetesResourcesOptions) (resourceNames []string, err error)
- func (c *CommandExecutorKubernetes) ListResources(options *parameteroptions.ListKubernetesResourcesOptions) (resources []Resource, err error)
- func (c *CommandExecutorKubernetes) NamespaceByNameExists(ctx context.Context, name string) (exists bool, err error)
- func (c *CommandExecutorKubernetes) RunCommand(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (commandOutput *commandexecutor.CommandOutput, err error)
- func (c *CommandExecutorKubernetes) RunCommandAndGetStdoutAsLines(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (lines []string, err error)
- func (c *CommandExecutorKubernetes) SetCachedContextName(cachedContextName string) (err error)
- func (c *CommandExecutorKubernetes) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
- func (c *CommandExecutorKubernetes) SetName(name string) (err error)
- type CommandExecutorNamespace
- func (c *CommandExecutorNamespace) Create(ctx context.Context) (err error)
- func (c *CommandExecutorNamespace) CreateRole(ctx context.Context, createOptions *CreateRoleOptions) (createdRole Role, err error)
- func (c *CommandExecutorNamespace) DeleteRoleByName(ctx context.Context, name string) (err error)
- func (c *CommandExecutorNamespace) GetCachedKubectlContext(ctx context.Context) (context string, err error)
- func (c *CommandExecutorNamespace) GetClusterName() (clusterName string, err error)
- func (c *CommandExecutorNamespace) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
- func (c *CommandExecutorNamespace) GetKubectlContext(ctx context.Context) (contextName string, err error)
- func (c *CommandExecutorNamespace) GetKubernetesCluster() (kubernetesCluster KubernetesCluster, err error)
- func (c *CommandExecutorNamespace) GetName() (name string, err error)
- func (c *CommandExecutorNamespace) GetResourceByNames(resourceName string, resourceType string) (resource Resource, err error)
- func (c *CommandExecutorNamespace) GetRoleByName(name string) (role Role, err error)
- func (c *CommandExecutorNamespace) ListRoleNames(ctx context.Context) (roleNames []string, err error)
- func (c *CommandExecutorNamespace) RoleByNameExists(ctx context.Context, name string) (exists bool, err error)
- func (c *CommandExecutorNamespace) RunCommand(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (commandOutput *commandexecutor.CommandOutput, err error)
- func (c *CommandExecutorNamespace) RunCommandAndGetStdoutAsLines(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (lines []string, err error)
- func (c *CommandExecutorNamespace) SetKubernetesCluster(kubernetesCluster KubernetesCluster) (err error)
- func (c *CommandExecutorNamespace) SetName(name string) (err error)
- type CommandExecutorResource
- func (c *CommandExecutorResource) CreateByYamlString(ctx context.Context, options *CreateResourceOptions) (err error)
- func (c *CommandExecutorResource) Delete(ctx context.Context) (err error)
- func (c *CommandExecutorResource) EnsureNamespaceExists(ctx context.Context) (err error)
- func (c *CommandExecutorResource) Exists(ctx context.Context) (exists bool, err error)
- func (c *CommandExecutorResource) GetAsYamlString() (yamlString string, err error)
- func (c *CommandExecutorResource) GetClusterName() (clusterName string, err error)
- func (c *CommandExecutorResource) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
- func (c *CommandExecutorResource) GetKubectlContext(ctx context.Context) (contextName string, err error)
- func (c *CommandExecutorResource) GetName() (name string, err error)
- func (c *CommandExecutorResource) GetNamespace() (namespace Namespace, err error)
- func (c *CommandExecutorResource) GetNamespaceName() (namsepaceName string, err error)
- func (c *CommandExecutorResource) GetResourceAndTypeAndNamespaceAndClusterName() (resourceName string, resourceTypeName string, namespaceName string, ...)
- func (c *CommandExecutorResource) GetTypeName() (typeName string, err error)
- func (c *CommandExecutorResource) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
- func (c *CommandExecutorResource) SetName(name string) (err error)
- func (c *CommandExecutorResource) SetNamespace(namespace Namespace) (err error)
- func (c *CommandExecutorResource) SetTypeName(typeName string) (err error)
- type CommandExecutorRole
- type CreateResourceOptions
- type CreateRoleOptions
- func (c *CreateRoleOptions) GetName() (name string, err error)
- func (c *CreateRoleOptions) GetResorces() (resorces []string, err error)
- func (c *CreateRoleOptions) GetVerbs() (verbs []string, err error)
- func (c *CreateRoleOptions) SetName(name string) (err error)
- func (c *CreateRoleOptions) SetResorces(resorces []string) (err error)
- func (c *CreateRoleOptions) SetVerbs(verbs []string) (err error)
- type KubectlContext
- type KubernetesCluster
- func GetClusterByName(ctx context.Context, clusterName string) (KubernetesCluster, error)
- func GetCommandExecutorKubernetsByName(commandExecutor commandexecutor.CommandExecutor, clusterName string) (kubernetes KubernetesCluster, err error)
- func GetLocalCommandExecutorKubernetesByName(clusterName string) (kubernetes KubernetesCluster, err error)
- type KubernetesControlplaneHost
- func GetKubernetesControlplaneByHost(host hosts.Host) (kubernetesControlplaneHost *KubernetesControlplaneHost, err error)
- func GetKubernetesControlplaneByHostname(hostname string) (kubernetesControlplaneHost *KubernetesControlplaneHost, err error)
- func NewKubernetesControlplaneHost() (kubernetesControlplaneHost *KubernetesControlplaneHost)
- func (k *KubernetesControlplaneHost) CheckIsKubernetesControlplane(verbose bool) (isKubernetesControlplane bool, err error)
- func (k *KubernetesControlplaneHost) GetJoinCommandAsString(verbose bool) (joinCommand string, err error)
- func (k *KubernetesControlplaneHost) GetJoinCommandAsStringSlice(verbose bool) (joinCommand []string, err error)
- func (k *KubernetesControlplaneHost) IsKubernetesControlplane(verbose bool) (isKubernetesControlplane bool, err error)
- type KubernetesNodeHost
- type Namespace
- type NativeKubernetesCluster
- func (n *NativeKubernetesCluster) CreateNamespaceByName(ctx context.Context, namespaceName string) (createdNamespace Namespace, err error)
- func (n *NativeKubernetesCluster) DeleteNamespaceByName(ctx context.Context, namespaceName string) (err error)
- func (n *NativeKubernetesCluster) GetClientSet() (*kubernetes.Clientset, error)
- func (n *NativeKubernetesCluster) GetKubectlContext(ctx context.Context) (contextName string, err error)
- func (n *NativeKubernetesCluster) GetName() (name string, err error)
- func (n *NativeKubernetesCluster) GetNamespaceByName(name string) (namespace Namespace, err error)
- func (n *NativeKubernetesCluster) GetResourceByNames(resourceName string, resourceType string, namespaceName string) (resource Resource, err error)
- func (n *NativeKubernetesCluster) ListNamespaceNames(ctx context.Context) (namespaceNames []string, err error)
- func (n *NativeKubernetesCluster) ListNamespaces(ctx context.Context) (namespaces []Namespace, err error)
- func (n *NativeKubernetesCluster) ListResourceNames(options *parameteroptions.ListKubernetesResourcesOptions) (resourceNames []string, err error)
- func (n *NativeKubernetesCluster) ListResources(options *parameteroptions.ListKubernetesResourcesOptions) (resources []Resource, err error)
- func (n *NativeKubernetesCluster) NamespaceByNameExists(ctx context.Context, namespaceName string) (exist bool, err error)
- func (n *NativeKubernetesCluster) WaitUntilNamespaceCreated(ctx context.Context, namepaceName string) (err error)
- func (n *NativeKubernetesCluster) WaitUntilNamespaceDeleted(ctx context.Context, namepaceName string) (err error)
- type NativeNamespace
- func (n *NativeNamespace) Create(ctx context.Context) (err error)
- func (n *NativeNamespace) CreateRole(ctx context.Context, createOptions *CreateRoleOptions) (createdRole Role, err error)
- func (n *NativeNamespace) DeleteRoleByName(ctx context.Context, name string) (err error)
- func (n *NativeNamespace) GetClusterName() (clusterName string, err error)
- func (n *NativeNamespace) GetKubectlContext(ctx context.Context) (contextName string, err error)
- func (n *NativeNamespace) GetName() (name string, err error)
- func (n *NativeNamespace) GetResourceByNames(resourceName string, resourceType string) (resource Resource, err error)
- func (n *NativeNamespace) GetRoleByName(name string) (role Role, err error)
- func (n *NativeNamespace) ListRoleNames(ctx context.Context) (roleNames []string, err error)
- func (n *NativeNamespace) RoleByNameExists(ctx context.Context, name string) (exists bool, err error)
- type Resource
- type ResourceYamlEntry
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientSet ¶ added in v0.318.0
func GetClientSet(ctx context.Context) (*kubernetes.Clientset, error)
Get the kubernetes.Clientset to communicate with the kubernetes cluster.
If in cluster authentication is available (e.g. running in a pod in the cluster) the returned clientset uses this method.
Otherwise a clientset based on ~/.kube/config is returned.
func GetClientSetFromKubeconfig ¶ added in v0.318.0
func GetClientSetFromKubeconfig(ctx context.Context) (*kubernetes.Clientset, error)
Get a client set based on the ~/.kube/config
func GetInClusterClientSet ¶ added in v0.318.0
func GetInClusterClientSet(ctx context.Context) (*kubernetes.Clientset, error)
func IsInClusterAuthenticationAvailable ¶ added in v0.305.0
func SortResourcesYaml ¶
Sort resources in given multi yaml string. Resources are sorted by:
- Namespace
- Resource name
- Kind
Types ¶
type CommandExecutorKubernetes ¶
type CommandExecutorKubernetes struct {
// contains filtered or unexported fields
}
func NewCommandExecutorKubernetes ¶
func NewCommandExecutorKubernetes() (c *CommandExecutorKubernetes)
func (*CommandExecutorKubernetes) CreateNamespaceByName ¶
func (*CommandExecutorKubernetes) DeleteNamespaceByName ¶
func (c *CommandExecutorKubernetes) DeleteNamespaceByName(ctx context.Context, name string) (err error)
func (*CommandExecutorKubernetes) GetCachedContextName ¶
func (c *CommandExecutorKubernetes) GetCachedContextName() (cachedContextName string, err error)
func (*CommandExecutorKubernetes) GetCachedKubectlContext ¶
func (c *CommandExecutorKubernetes) GetCachedKubectlContext(ctx context.Context) (context string, err error)
func (*CommandExecutorKubernetes) GetCommandExecutor ¶
func (c *CommandExecutorKubernetes) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
func (*CommandExecutorKubernetes) GetKubectlContext ¶
func (c *CommandExecutorKubernetes) GetKubectlContext(ctx context.Context) (context string, err error)
func (*CommandExecutorKubernetes) GetKubectlContexts ¶
func (c *CommandExecutorKubernetes) GetKubectlContexts() (contexts []KubectlContext, err error)
func (*CommandExecutorKubernetes) GetName ¶
func (c *CommandExecutorKubernetes) GetName() (name string, err error)
Returns the kubernetes cluster name
func (*CommandExecutorKubernetes) GetNamespaceByName ¶
func (c *CommandExecutorKubernetes) GetNamespaceByName(name string) (namespace Namespace, err error)
func (*CommandExecutorKubernetes) GetResourceByNames ¶
func (*CommandExecutorKubernetes) ListNamespaceNames ¶
func (c *CommandExecutorKubernetes) ListNamespaceNames(ctx context.Context) (namespaceNames []string, err error)
func (*CommandExecutorKubernetes) ListNamespaces ¶
func (c *CommandExecutorKubernetes) ListNamespaces(ctx context.Context) (namespaces []Namespace, err error)
func (*CommandExecutorKubernetes) ListResourceNames ¶
func (c *CommandExecutorKubernetes) ListResourceNames(options *parameteroptions.ListKubernetesResourcesOptions) (resourceNames []string, err error)
func (*CommandExecutorKubernetes) ListResources ¶
func (c *CommandExecutorKubernetes) ListResources(options *parameteroptions.ListKubernetesResourcesOptions) (resources []Resource, err error)
func (*CommandExecutorKubernetes) NamespaceByNameExists ¶
func (*CommandExecutorKubernetes) RunCommand ¶
func (c *CommandExecutorKubernetes) RunCommand(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (commandOutput *commandexecutor.CommandOutput, err error)
func (*CommandExecutorKubernetes) RunCommandAndGetStdoutAsLines ¶
func (c *CommandExecutorKubernetes) RunCommandAndGetStdoutAsLines(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (lines []string, err error)
func (*CommandExecutorKubernetes) SetCachedContextName ¶
func (c *CommandExecutorKubernetes) SetCachedContextName(cachedContextName string) (err error)
func (*CommandExecutorKubernetes) SetCommandExecutor ¶
func (c *CommandExecutorKubernetes) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
func (*CommandExecutorKubernetes) SetName ¶
func (c *CommandExecutorKubernetes) SetName(name string) (err error)
type CommandExecutorNamespace ¶
type CommandExecutorNamespace struct {
// contains filtered or unexported fields
}
func NewCommandExecutorNamespace ¶
func NewCommandExecutorNamespace() (c *CommandExecutorNamespace)
func (*CommandExecutorNamespace) Create ¶
func (c *CommandExecutorNamespace) Create(ctx context.Context) (err error)
func (*CommandExecutorNamespace) CreateRole ¶
func (c *CommandExecutorNamespace) CreateRole(ctx context.Context, createOptions *CreateRoleOptions) (createdRole Role, err error)
func (*CommandExecutorNamespace) DeleteRoleByName ¶
func (c *CommandExecutorNamespace) DeleteRoleByName(ctx context.Context, name string) (err error)
func (*CommandExecutorNamespace) GetCachedKubectlContext ¶
func (c *CommandExecutorNamespace) GetCachedKubectlContext(ctx context.Context) (context string, err error)
func (*CommandExecutorNamespace) GetClusterName ¶
func (c *CommandExecutorNamespace) GetClusterName() (clusterName string, err error)
func (*CommandExecutorNamespace) GetCommandExecutor ¶
func (c *CommandExecutorNamespace) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
func (*CommandExecutorNamespace) GetKubectlContext ¶
func (c *CommandExecutorNamespace) GetKubectlContext(ctx context.Context) (contextName string, err error)
func (*CommandExecutorNamespace) GetKubernetesCluster ¶
func (c *CommandExecutorNamespace) GetKubernetesCluster() (kubernetesCluster KubernetesCluster, err error)
func (*CommandExecutorNamespace) GetName ¶
func (c *CommandExecutorNamespace) GetName() (name string, err error)
func (*CommandExecutorNamespace) GetResourceByNames ¶
func (c *CommandExecutorNamespace) GetResourceByNames(resourceName string, resourceType string) (resource Resource, err error)
func (*CommandExecutorNamespace) GetRoleByName ¶
func (c *CommandExecutorNamespace) GetRoleByName(name string) (role Role, err error)
func (*CommandExecutorNamespace) ListRoleNames ¶
func (c *CommandExecutorNamespace) ListRoleNames(ctx context.Context) (roleNames []string, err error)
func (*CommandExecutorNamespace) RoleByNameExists ¶
func (*CommandExecutorNamespace) RunCommand ¶
func (c *CommandExecutorNamespace) RunCommand(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (commandOutput *commandexecutor.CommandOutput, err error)
func (*CommandExecutorNamespace) RunCommandAndGetStdoutAsLines ¶
func (c *CommandExecutorNamespace) RunCommandAndGetStdoutAsLines(ctx context.Context, runCommandOptions *parameteroptions.RunCommandOptions) (lines []string, err error)
func (*CommandExecutorNamespace) SetKubernetesCluster ¶
func (c *CommandExecutorNamespace) SetKubernetesCluster(kubernetesCluster KubernetesCluster) (err error)
func (*CommandExecutorNamespace) SetName ¶
func (c *CommandExecutorNamespace) SetName(name string) (err error)
type CommandExecutorResource ¶
type CommandExecutorResource struct {
// contains filtered or unexported fields
}
func NewCommandExecutorResource ¶
func NewCommandExecutorResource() (c *CommandExecutorResource)
func (*CommandExecutorResource) CreateByYamlString ¶
func (c *CommandExecutorResource) CreateByYamlString(ctx context.Context, options *CreateResourceOptions) (err error)
func (*CommandExecutorResource) Delete ¶
func (c *CommandExecutorResource) Delete(ctx context.Context) (err error)
func (*CommandExecutorResource) EnsureNamespaceExists ¶
func (c *CommandExecutorResource) EnsureNamespaceExists(ctx context.Context) (err error)
func (*CommandExecutorResource) Exists ¶
func (c *CommandExecutorResource) Exists(ctx context.Context) (exists bool, err error)
func (*CommandExecutorResource) GetAsYamlString ¶
func (c *CommandExecutorResource) GetAsYamlString() (yamlString string, err error)
func (*CommandExecutorResource) GetClusterName ¶
func (c *CommandExecutorResource) GetClusterName() (clusterName string, err error)
func (*CommandExecutorResource) GetCommandExecutor ¶
func (c *CommandExecutorResource) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
func (*CommandExecutorResource) GetKubectlContext ¶
func (c *CommandExecutorResource) GetKubectlContext(ctx context.Context) (contextName string, err error)
func (*CommandExecutorResource) GetName ¶
func (c *CommandExecutorResource) GetName() (name string, err error)
func (*CommandExecutorResource) GetNamespace ¶
func (c *CommandExecutorResource) GetNamespace() (namespace Namespace, err error)
func (*CommandExecutorResource) GetNamespaceName ¶
func (c *CommandExecutorResource) GetNamespaceName() (namsepaceName string, err error)
func (*CommandExecutorResource) GetResourceAndTypeAndNamespaceAndClusterName ¶
func (*CommandExecutorResource) GetTypeName ¶
func (c *CommandExecutorResource) GetTypeName() (typeName string, err error)
func (*CommandExecutorResource) SetCommandExecutor ¶
func (c *CommandExecutorResource) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
func (*CommandExecutorResource) SetName ¶
func (c *CommandExecutorResource) SetName(name string) (err error)
func (*CommandExecutorResource) SetNamespace ¶
func (c *CommandExecutorResource) SetNamespace(namespace Namespace) (err error)
func (*CommandExecutorResource) SetTypeName ¶
func (c *CommandExecutorResource) SetTypeName(typeName string) (err error)
type CommandExecutorRole ¶
type CommandExecutorRole struct {
// contains filtered or unexported fields
}
func NewCommandExecutorRole ¶
func NewCommandExecutorRole() (c *CommandExecutorRole)
func (*CommandExecutorRole) GetName ¶
func (c *CommandExecutorRole) GetName() (name string, err error)
func (*CommandExecutorRole) GetNamespace ¶
func (c *CommandExecutorRole) GetNamespace() (namespace Namespace, err error)
func (*CommandExecutorRole) SetName ¶
func (c *CommandExecutorRole) SetName(name string) (err error)
func (*CommandExecutorRole) SetNamespace ¶
func (c *CommandExecutorRole) SetNamespace(namespace Namespace) (err error)
type CreateResourceOptions ¶ added in v0.308.0
type CreateResourceOptions struct { YamlString string // Do not check nor try to create missing namespaces. // Usefull if the user has no rights to list or create namespaces but requiers to ensure namespaces already exists. SkipNamespaceCreation bool }
func (CreateResourceOptions) GetYamlString ¶ added in v0.308.0
func (c CreateResourceOptions) GetYamlString() (string, error)
type CreateRoleOptions ¶
func NewCreateRoleOptions ¶
func NewCreateRoleOptions() (c *CreateRoleOptions)
func (*CreateRoleOptions) GetName ¶
func (c *CreateRoleOptions) GetName() (name string, err error)
func (*CreateRoleOptions) GetResorces ¶
func (c *CreateRoleOptions) GetResorces() (resorces []string, err error)
func (*CreateRoleOptions) GetVerbs ¶
func (c *CreateRoleOptions) GetVerbs() (verbs []string, err error)
func (*CreateRoleOptions) SetName ¶
func (c *CreateRoleOptions) SetName(name string) (err error)
func (*CreateRoleOptions) SetResorces ¶
func (c *CreateRoleOptions) SetResorces(resorces []string) (err error)
func (*CreateRoleOptions) SetVerbs ¶
func (c *CreateRoleOptions) SetVerbs(verbs []string) (err error)
type KubectlContext ¶
type KubectlContext struct {
// contains filtered or unexported fields
}
func NewKubectlContext ¶
func NewKubectlContext() (k *KubectlContext)
func (*KubectlContext) GetCluster ¶
func (k *KubectlContext) GetCluster() (cluster string, err error)
func (*KubectlContext) GetName ¶
func (k *KubectlContext) GetName() (name string, err error)
func (*KubectlContext) SetCluster ¶
func (k *KubectlContext) SetCluster(cluster string) (err error)
func (*KubectlContext) SetName ¶
func (k *KubectlContext) SetName(name string) (err error)
type KubernetesCluster ¶
type KubernetesCluster interface { CreateNamespaceByName(ctx context.Context, namespaceName string) (createdNamespace Namespace, err error) DeleteNamespaceByName(ctx context.Context, namespaceName string) (err error) GetKubectlContext(ctx context.Context) (contextName string, err error) GetName() (name string, err error) GetNamespaceByName(name string) (namespace Namespace, err error) GetResourceByNames(resourceName string, resourceType string, namespaceName string) (resource Resource, err error) ListNamespaces(ctx context.Context) (namespaces []Namespace, err error) ListNamespaceNames(ctx context.Context) (namespaceNames []string, err error) ListResources(options *parameteroptions.ListKubernetesResourcesOptions) (resources []Resource, err error) ListResourceNames(options *parameteroptions.ListKubernetesResourcesOptions) (resourceNames []string, err error) NamespaceByNameExists(ctx context.Context, namespaceName string) (exist bool, err error) }
func GetClusterByName ¶ added in v0.318.0
func GetClusterByName(ctx context.Context, clusterName string) (KubernetesCluster, error)
func GetCommandExecutorKubernetsByName ¶
func GetCommandExecutorKubernetsByName(commandExecutor commandexecutor.CommandExecutor, clusterName string) (kubernetes KubernetesCluster, err error)
func GetLocalCommandExecutorKubernetesByName ¶
func GetLocalCommandExecutorKubernetesByName(clusterName string) (kubernetes KubernetesCluster, err error)
type KubernetesControlplaneHost ¶
func GetKubernetesControlplaneByHost ¶
func GetKubernetesControlplaneByHost(host hosts.Host) (kubernetesControlplaneHost *KubernetesControlplaneHost, err error)
func GetKubernetesControlplaneByHostname ¶
func GetKubernetesControlplaneByHostname(hostname string) (kubernetesControlplaneHost *KubernetesControlplaneHost, err error)
func NewKubernetesControlplaneHost ¶
func NewKubernetesControlplaneHost() (kubernetesControlplaneHost *KubernetesControlplaneHost)
func (*KubernetesControlplaneHost) CheckIsKubernetesControlplane ¶
func (k *KubernetesControlplaneHost) CheckIsKubernetesControlplane(verbose bool) (isKubernetesControlplane bool, err error)
func (*KubernetesControlplaneHost) GetJoinCommandAsString ¶
func (k *KubernetesControlplaneHost) GetJoinCommandAsString(verbose bool) (joinCommand string, err error)
func (*KubernetesControlplaneHost) GetJoinCommandAsStringSlice ¶
func (k *KubernetesControlplaneHost) GetJoinCommandAsStringSlice(verbose bool) (joinCommand []string, err error)
func (*KubernetesControlplaneHost) IsKubernetesControlplane ¶
func (k *KubernetesControlplaneHost) IsKubernetesControlplane(verbose bool) (isKubernetesControlplane bool, err error)
type KubernetesNodeHost ¶
func GetKubernetesNodeByHost ¶
func GetKubernetesNodeByHost(host hosts.Host) (kubernetesNodeHost *KubernetesNodeHost, err error)
func GetKubernetesNodeByHostname ¶
func GetKubernetesNodeByHostname(hostname string) (kubernetesNodeHost *KubernetesNodeHost, err error)
func NewKubernetesNodeHost ¶
func NewKubernetesNodeHost() (kubernetesNodeHost *KubernetesNodeHost)
func (*KubernetesNodeHost) CheckIsKubernetesNode ¶
func (k *KubernetesNodeHost) CheckIsKubernetesNode(verbose bool) (isKubernetesNode bool, err error)
func (*KubernetesNodeHost) IsKubernetesNode ¶
func (k *KubernetesNodeHost) IsKubernetesNode(verbose bool) (isKubernetesNode bool, err error)
type Namespace ¶
type Namespace interface { Create(ctx context.Context) (err error) CreateRole(ctx context.Context, createOptions *CreateRoleOptions) (createdRole Role, err error) DeleteRoleByName(ctx context.Context, name string) (err error) GetClusterName() (clusterName string, err error) GetKubectlContext(ctx context.Context) (contextName string, err error) GetName() (name string, err error) GetResourceByNames(resourceName string, resourceType string) (resource Resource, err error) GetRoleByName(name string) (role Role, err error) ListRoleNames(ctx context.Context) (roleNames []string, err error) RoleByNameExists(ctx context.Context, name string) (exists bool, err error) }
type NativeKubernetesCluster ¶ added in v0.318.0
type NativeKubernetesCluster struct {
// contains filtered or unexported fields
}
func GetNativeKubernetesClusterByName ¶ added in v0.318.0
func GetNativeKubernetesClusterByName(ctx context.Context, clusterName string) (*NativeKubernetesCluster, error)
func (*NativeKubernetesCluster) CreateNamespaceByName ¶ added in v0.318.0
func (*NativeKubernetesCluster) DeleteNamespaceByName ¶ added in v0.318.0
func (n *NativeKubernetesCluster) DeleteNamespaceByName(ctx context.Context, namespaceName string) (err error)
func (*NativeKubernetesCluster) GetClientSet ¶ added in v0.318.0
func (n *NativeKubernetesCluster) GetClientSet() (*kubernetes.Clientset, error)
func (*NativeKubernetesCluster) GetKubectlContext ¶ added in v0.318.0
func (n *NativeKubernetesCluster) GetKubectlContext(ctx context.Context) (contextName string, err error)
func (*NativeKubernetesCluster) GetName ¶ added in v0.318.0
func (n *NativeKubernetesCluster) GetName() (name string, err error)
func (*NativeKubernetesCluster) GetNamespaceByName ¶ added in v0.318.0
func (n *NativeKubernetesCluster) GetNamespaceByName(name string) (namespace Namespace, err error)
func (*NativeKubernetesCluster) GetResourceByNames ¶ added in v0.318.0
func (*NativeKubernetesCluster) ListNamespaceNames ¶ added in v0.318.0
func (n *NativeKubernetesCluster) ListNamespaceNames(ctx context.Context) (namespaceNames []string, err error)
func (*NativeKubernetesCluster) ListNamespaces ¶ added in v0.318.0
func (n *NativeKubernetesCluster) ListNamespaces(ctx context.Context) (namespaces []Namespace, err error)
func (*NativeKubernetesCluster) ListResourceNames ¶ added in v0.318.0
func (n *NativeKubernetesCluster) ListResourceNames(options *parameteroptions.ListKubernetesResourcesOptions) (resourceNames []string, err error)
func (*NativeKubernetesCluster) ListResources ¶ added in v0.318.0
func (n *NativeKubernetesCluster) ListResources(options *parameteroptions.ListKubernetesResourcesOptions) (resources []Resource, err error)
func (*NativeKubernetesCluster) NamespaceByNameExists ¶ added in v0.318.0
func (*NativeKubernetesCluster) WaitUntilNamespaceCreated ¶ added in v0.318.0
func (n *NativeKubernetesCluster) WaitUntilNamespaceCreated(ctx context.Context, namepaceName string) (err error)
func (*NativeKubernetesCluster) WaitUntilNamespaceDeleted ¶ added in v0.318.0
func (n *NativeKubernetesCluster) WaitUntilNamespaceDeleted(ctx context.Context, namepaceName string) (err error)
type NativeNamespace ¶ added in v0.318.0
type NativeNamespace struct {
// contains filtered or unexported fields
}
func (*NativeNamespace) Create ¶ added in v0.318.0
func (n *NativeNamespace) Create(ctx context.Context) (err error)
func (*NativeNamespace) CreateRole ¶ added in v0.318.0
func (n *NativeNamespace) CreateRole(ctx context.Context, createOptions *CreateRoleOptions) (createdRole Role, err error)
func (*NativeNamespace) DeleteRoleByName ¶ added in v0.318.0
func (n *NativeNamespace) DeleteRoleByName(ctx context.Context, name string) (err error)
func (*NativeNamespace) GetClusterName ¶ added in v0.318.0
func (n *NativeNamespace) GetClusterName() (clusterName string, err error)
func (*NativeNamespace) GetKubectlContext ¶ added in v0.318.0
func (n *NativeNamespace) GetKubectlContext(ctx context.Context) (contextName string, err error)
func (*NativeNamespace) GetName ¶ added in v0.318.0
func (n *NativeNamespace) GetName() (name string, err error)
func (*NativeNamespace) GetResourceByNames ¶ added in v0.318.0
func (n *NativeNamespace) GetResourceByNames(resourceName string, resourceType string) (resource Resource, err error)
func (*NativeNamespace) GetRoleByName ¶ added in v0.318.0
func (n *NativeNamespace) GetRoleByName(name string) (role Role, err error)
func (*NativeNamespace) ListRoleNames ¶ added in v0.318.0
func (n *NativeNamespace) ListRoleNames(ctx context.Context) (roleNames []string, err error)
func (*NativeNamespace) RoleByNameExists ¶ added in v0.318.0
type Resource ¶
type Resource interface { CreateByYamlString(ctx context.Context, options *CreateResourceOptions) (err error) Delete(ctx context.Context) (err error) Exists(ctx context.Context) (exists bool, err error) GetAsYamlString() (yamlString string, err error) }
a generic representation of a kubernetes resource like a pod, ingress, role...
func GetCommandExecutorResource ¶
func GetCommandExecutorResource(commandExectutor commandexecutor.CommandExecutor, namespace Namespace, resourceName string, resourceType string) (resource Resource, err error)
type ResourceYamlEntry ¶
type ResourceYamlEntry struct {
Content string
}
func UnmarshalResourceYaml ¶
func UnmarshalResourceYaml(resourceYaml string) (resources []*ResourceYamlEntry, err error)
func (*ResourceYamlEntry) Kind ¶
func (r *ResourceYamlEntry) Kind() (name string)
func (*ResourceYamlEntry) Name ¶
func (r *ResourceYamlEntry) Name() (name string)
func (*ResourceYamlEntry) Namespace ¶
func (r *ResourceYamlEntry) Namespace() (namespace string)
func (*ResourceYamlEntry) Validate ¶
func (r *ResourceYamlEntry) Validate() (err error)
Source Files
¶
- Authentication.go
- CommandExecutorKubernetes.go
- CommandExecutorNamespace.go
- CommandExecutorResource.go
- CommandExecutorRole.go
- CreateResourceOptions.go
- CreateRoleOptions.go
- KubectlContext.go
- KubernetesCluster.go
- KubernetesControlplaneHost.go
- KubernetesNodeHost.go
- Namespace.go
- NativeKubernetesCluster.go
- NativeNamespace.go
- Resource.go
- ResourcesYaml.go
- Role.go
Click to show internal directories.
Click to hide internal directories.