kubernetes

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrObjectHasParents = fmt.Errorf("This object has parents")

ErrObjectHasParents is returned when the resource being created is the child of another resource

View Source
var ErrObjectHasZeroReplicas = fmt.Errorf("This object has zero replicas")

ErrObjectHasZeroReplicas is returned when the resource being created has zero replicas

Functions

This section is empty.

Types

type Auths

type Auths struct {
	Registries RegistriesStruct `json:"auths"`
}

Auths struct contains an embedded RegistriesStruct of name auths

type RegistriesStruct

type RegistriesStruct map[string]RegistryCredentials

RegistriesStruct is a map of registries to their credentials

type RegistryCredentials

type RegistryCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Auth     string `json:"auth"`
}

RegistryCredentials defines the fields stored per registry in an docker config secret

type Wrapper

type Wrapper struct {
	kubernetes.Interface
}

Wrapper is a wrapper around kubeclientset that includes some helper functions for applying behaviour to kube resources

func NewKubeClientsetWrapper

func NewKubeClientsetWrapper(kubeClientset kubernetes.Interface) *Wrapper

NewKubeClientsetWrapper creates a wrapper from the kubeclientset passed in

func (*Wrapper) GetBasicCredentials

func (w *Wrapper) GetBasicCredentials(namespace, name string) (string, string, error)

GetBasicCredentials retrieves username, password from a named secret

func (*Wrapper) GetPodSpec

func (w *Wrapper) GetPodSpec(ar *admissionv1.AdmissionRequest) (string, *corev1.PodSpec, error)

GetPodSpec retrieves the podspec from the admission request passed in

func (*Wrapper) GetSecretKey

func (w *Wrapper) GetSecretKey(namespace, secretName string) ([]byte, error)

GetSecretKey obtains the "key" data from the named secret

func (*Wrapper) GetSecretToken

func (w *Wrapper) GetSecretToken(namespace, secretName, registry string) (string, string, error)

GetSecretToken retrieve the token (password field) for the given namespace/secret/registry

type WrapperInterface

type WrapperInterface interface {
	kubernetes.Interface
	GetPodSpec(*admissionv1.AdmissionRequest) (string, *corev1.PodSpec, error)
	GetSecretToken(namespace, secretName, registry string) (string, string, error)
	GetSecretKey(namespace, secretName string) ([]byte, error)
	GetBasicCredentials(namespace, secretName string) (string, string, error)
}

WrapperInterface is the interface for a wrapper around kubeclientset that includes some helper functions for applying behaviour to kube resources

Jump to

Keyboard shortcuts

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