kubeclient

package
v3.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 12 Imported by: 38

Documentation

Index

Constants

View Source
const (
	// PodNamespaceFile the file path and name for pod namespace
	PodNamespaceFile = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"

	DefaultKubeConfigFile = "config"
	DefaultKubeConfigPath = ".kube"
)

Variables

This section is empty.

Functions

func CurrentContext

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

CurrentContext returns the current context

func CurrentNamespace

func CurrentNamespace() (string, error)

CurrentNamespace returns the current namespace in the context

func LoadConfig

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

LoadConfig loads the Kubernetes configuration

Types

type Factory

type Factory interface {
	// CreateKubeConfig creates the kubernetes configuration
	CreateKubeConfig() (*rest.Config, error)
	CreateKubeConfigFromCustomLocation(string, string) (*rest.Config, error)
}

Factory is the interface defined for Kubernetes, Jenkins X, and Tekton REST APIs

func NewFactory

func NewFactory() Factory

NewFactory creates a factory with the default Kubernetes resources defined

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.

Jump to

Keyboard shortcuts

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