kube

package
v1.219.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildClusterConfig

func BuildClusterConfig(info *awsCloud.EKSClusterInfo, alias, identityName string) *clientcmdapi.Config

BuildClusterConfig creates a kubeconfig api.Config for a single EKS cluster.

func DefaultKubeconfigPath

func DefaultKubeconfigPath() (string, error)

DefaultKubeconfigPath returns the XDG-compliant default kubeconfig path. Returns ~/.config/atmos/kube/config.

Types

type KubeconfigManager

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

KubeconfigManager manages kubeconfig files for EKS clusters.

func NewKubeconfigManager

func NewKubeconfigManager(customPath, modeStr string) (*KubeconfigManager, error)

NewKubeconfigManager creates a manager with the given path and permissions. If customPath is empty, uses XDG default (~/.config/atmos/kube/config). If modeStr is empty, defaults to "0600".

func (*KubeconfigManager) GetPath

func (m *KubeconfigManager) GetPath() string

GetPath returns the kubeconfig file path.

func (*KubeconfigManager) ListClusterARNs

func (m *KubeconfigManager) ListClusterARNs() ([]string, error)

ListClusterARNs returns all cluster ARN keys from the kubeconfig file. Returns nil if the file does not exist.

func (*KubeconfigManager) RemoveClusterConfig

func (m *KubeconfigManager) RemoveClusterConfig(clusterARN, contextName, userName string) error

RemoveClusterConfig removes a cluster, context, and user from the kubeconfig. Idempotent: returns nil if entries do not exist.

func (*KubeconfigManager) WriteClusterConfig

func (m *KubeconfigManager) WriteClusterConfig(info *awsCloud.EKSClusterInfo, alias, identityName, updateMode string) (bool, error)

WriteClusterConfig generates and writes kubeconfig for an EKS cluster. Returns changed=true when the on-disk file was modified, and changed=false when the existing kubeconfig already matches the desired state (no write performed). Callers can use this to suppress noisy success messages on repeated invocations that produce identical output.

Jump to

Keyboard shortcuts

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