kube

package
v0.0.0-...-6ae6d5a Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace the standard namespace.
	DefaultNamespace = "default"

	// PodNamespaceFile the file path and name for pod namespace.
	PodNamespaceFile = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
)

Variables

This section is empty.

Functions

func CurrentCluster

func CurrentCluster(config *api.Config) (string, *api.Cluster)

CurrentCluster returns the current cluster.

func CurrentContext

func CurrentContext(config *api.Config) *api.Context

CurrentContext returns the current context.

func CurrentNamespace

func CurrentNamespace(config *api.Config) string

CurrentNamespace returns the current namespace in the context.

func CurrentServer

func CurrentServer(config *api.Config) string

CurrentServer returns the current context's server.

func LoadConfig

func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)

LoadConfig loads the Kubernetes configuration.

func Server

func Server(config *api.Config, context *api.Context) string

Server returns the server of the given context.

Types

type Kuber

type Kuber interface {
	SetKubeContext(string, *api.Config) (*api.Config, error)
	SetKubeNamespace(string, *api.Config) (*api.Config, error)
	SetKubeConfig(*api.Config) (*api.Config, error)
	LoadAPIConfig() (*api.Config, error)
	LoadAPIConfigFromPath(string) (*api.Config, error)
	LoadClientConfig() (*rest.Config, error)
	GetCurrentContext(*api.Config) *api.Context
	GetCurrentNamespace(*api.Config) string
}

func NewKuber

func NewKuber() Kuber

type Tracer

type Tracer struct {
	http.RoundTripper
}

Tracer implements http.RoundTripper. It prints each request and response/error to os.Stderr.

func (*Tracer) RoundTrip

func (t *Tracer) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip calls the nested RoundTripper while printing each request and response/error to os.Stderr on either side of the nested call.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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