kubeconfig

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package kubeconfig provides the ability to create, read, and manage the kubeconfig file/bytes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeConfig

type KubeConfig struct {
	Path  string
	Bytes []byte
}

KubeConfig contains a bytearray representing the kubeconfig and a path to a file in which this kubeconfig is written. It makes sure that this path is only written to once and read from as little as possible.

func FromBytes

func FromBytes(bytes []byte, path string, forceWrite bool) (*KubeConfig, error)

FromBytes creates a kubeConfig struct from byte array and writes it to the given path if the file doesn't exist.

func FromPath

func FromPath(path string) (*KubeConfig, error)

FromPath Loads a KubeConfig from a file path.

func (*KubeConfig) GetConfig

func (k *KubeConfig) GetConfig() (*rest.Config, error)

GetConfig returns a kubernetes rest configuration from the KubeConfig.

Jump to

Keyboard shortcuts

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