Documentation
¶
Overview ¶
Package kubeconfig reads the developer's existing kubeconfig.
There is no import step and no separate credential store: if kubectl works, kubeside works. The file is read-only input. kubeside never writes to it, never copies credentials out of it, and loads every context rather than only current-context, because multi-environment is the point of the product.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RESTConfigFor ¶
RESTConfigFor builds a client config for one context.
This is where exec credential plugins (aws eks get-token, gke-gcloud-auth-plugin, kubelogin, tsh) become live: clientcmd runs them as native child processes with the real environment, which is why kubeside is not affected by the sandboxing failures that plague packaged competitors.
Types ¶
type Config ¶
type Config struct {
Contexts []Context
Current string
Sources []string // files merged, in precedence order
}
Config is the merged view of every kubeconfig file in the chain.
func Load ¶
Load reads and merges the kubeconfig chain.
Exec credential plugins are deliberately not invoked here. Loading must stay cheap and side-effect free; plugins run later, per context, when a connection is actually made.
func (*Config) CurrentContext ¶
CurrentContext returns the context kubectl would use. It connects first, so the developer's usual workspace renders while other clusters handshake.
type Context ¶
type Context struct {
Name string // context name, personal and rename-prone
Cluster string // cluster nickname within the kubeconfig
Server string // API server URL; stable across renames, so shared config keys off it
User string
Namespace string // per-context default, seeds the namespace filter
IsCurrent bool
Insecure bool // insecure-skip-tls-verify, surfaced as a warning in the UI
// Exec describes the credential plugin this context authenticates with,
// when it uses one. Captured so that a rejected credential can name the
// command that would fix it instead of printing a bare error.
Exec *ExecConfig
}
Context is one kubeconfig context, flattened to what kubeside needs.
type ExecConfig ¶
ExecConfig is the kubeconfig exec block for a context.
func (*ExecConfig) Describe ¶
func (e *ExecConfig) Describe() string
Describe renders the configured credential command, used when no specific login hint is known so the developer at least sees what ran.
func (*ExecConfig) LoginHint ¶
func (e *ExecConfig) LoginHint() string
LoginHint returns the command a developer should run when this context's credentials are rejected, or "" when nothing useful can be said.
It never invents a command that is not implied by the kubeconfig. Guessing wrong here is worse than staying quiet: it sends someone to run something that cannot help.
type Options ¶
type Options struct {
// ExplicitPath is the --kubeconfig flag. Highest precedence.
ExplicitPath string
// Precedence overrides the KUBECONFIG chain. Tests set this directly;
// production leaves it nil so clientcmd reads the environment.
Precedence []string
}
Options selects which files to read. Zero value follows kubectl: the KUBECONFIG environment chain, falling back to ~/.kube/config.