Documentation
¶
Index ¶
- func ApplyContextDefaults(cmd *cobra.Command) error
- func EnsureContext() error
- func GetStoredKubeConfigValues() (string, string, error)
- func IsConfigFileExists() bool
- func LoadStoredConfig() (*configContext.StoredConfig, error)
- func SaveStoredConfig(cfg *configContext.StoredConfig) error
- type ConfigContextImpl
- func (c *ConfigContextImpl) GetContexts() error
- func (c *ConfigContextImpl) GetCurrentContext() error
- func (c *ConfigContextImpl) SetContext(params api.SetContextParams) error
- func (c *ConfigContextImpl) SetControlPlane(params api.SetControlPlaneParams) error
- func (c *ConfigContextImpl) UseContext(params api.UseContextParams) error
- type DefaultContextValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyContextDefaults ¶
ApplyContextDefaults loads the stored config and sets default flag values from the current context, if not already provided.
func EnsureContext ¶
func EnsureContext() error
EnsureContext creates and sets a default context if none exists.
func GetStoredKubeConfigValues ¶
GetStoredKubeConfigValues is a stub function to maintain compatibility TODO: Remove this once all direct Kubernetes access is removed from CLI
func IsConfigFileExists ¶
func IsConfigFileExists() bool
IsConfigFileExists checks if the configuration file exists
func LoadStoredConfig ¶
func LoadStoredConfig() (*configContext.StoredConfig, error)
LoadStoredConfig loads the configuration from disk
func SaveStoredConfig ¶
func SaveStoredConfig(cfg *configContext.StoredConfig) error
SaveStoredConfig persists the configuration to disk
Types ¶
type ConfigContextImpl ¶
type ConfigContextImpl struct{}
ConfigContextImpl implements context-related commands.
func NewConfigContextImpl ¶
func NewConfigContextImpl() *ConfigContextImpl
NewConfigContextImpl creates a new instance of ConfigContextImpl.
func (*ConfigContextImpl) GetContexts ¶
func (c *ConfigContextImpl) GetContexts() error
GetContexts prints all available contexts with their details.
func (*ConfigContextImpl) GetCurrentContext ¶
func (c *ConfigContextImpl) GetCurrentContext() error
GetCurrentContext prints the current context details.
func (*ConfigContextImpl) SetContext ¶
func (c *ConfigContextImpl) SetContext(params api.SetContextParams) error
SetContext creates or updates a configuration context with the given parameters.
func (*ConfigContextImpl) SetControlPlane ¶ added in v0.3.0
func (c *ConfigContextImpl) SetControlPlane(params api.SetControlPlaneParams) error
SetControlPlane sets the control plane configuration
func (*ConfigContextImpl) UseContext ¶
func (c *ConfigContextImpl) UseContext(params api.UseContextParams) error
UseContext sets the current context to the context with the given name.