kubectlconfig

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct{}

Cluster represents a single cluster definition inside a ConfigFile.

type ConfigFile

type ConfigFile struct {
	Path           string    `yaml:"-"`
	APIVersion     string    `yaml:"apiVersion"`
	Kind           string    `yaml:"kind"`
	CurrentContext string    `yaml:"current-context"`
	Clusters       []Cluster `yaml:"clusters"`
	Contexts       []Context `yaml:"contexts"`
}

ConfigFile represents the content of a kubeconfig file. Additionally, this also holds the path of that file inside the Path field.

func FindAllFiles

func FindAllFiles(ctx context.Context, filesystem afero.Fs, root string) ([]ConfigFile, error)

func LoadConfigFile

func LoadConfigFile(ctx context.Context, filesystem afero.Fs, path string) (*ConfigFile, error)

LoadConfigFile tries to load a ConfigFile from the given path inside a filesystem.

func (*ConfigFile) HasContext

func (c *ConfigFile) HasContext(name string) bool

HasContext checks all the contexts defined in the configfile for one with the given name.

type Context

type Context struct {
	Name string `yaml:"name"`
}

Context represents a single context definition inside a ConfigFile.

type Environment

type Environment struct {
	KubeConfig string
	Context    string
}

Environment is an abstraction to the environment settings that are supported by kubeselect.

func LoadEnvironment

func LoadEnvironment(ctx context.Context, filesystem afero.Fs, environ []string) (*Environment, error)

Loads an environment based on the given slice of environment variables. Internally, this also does some validation for which filesystem access is required.

Jump to

Keyboard shortcuts

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