k8sutil

package
v0.0.0-...-f6a88fe Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KubeConfigLocation string
	DefaultConfig      *rest.Config
)

Functions

func CreateKubeconfigSecret

func CreateKubeconfigSecret(name string, namespace string, kubeconfig []byte) (err error)

func CreateNamespace

func CreateNamespace(schema corev1.Namespace, config *rest.Config) (bool, error)

func CreateSSHSecret

func CreateSSHSecret(name string, namespace string, privateKey []byte) (err error)

func DeleteKubeconfigSecret

func DeleteKubeconfigSecret(name string, namespace string) (err error)

func DeleteSSHSecret

func DeleteSSHSecret(name string, namespace string) (err error)

func DeleteSecret

func DeleteSecret(name string, namespace string) (err error)

func GenerateKubernetesConfig

func GenerateKubernetesConfig() (*rest.Config, error)

func GenerateNamespace

func GenerateNamespace(name string) corev1.Namespace

func GetKubeconfigSecret

func GetKubeconfigSecret(name string, namespace string) (secret []byte, err error)

func GetKubeconfigSecretList

func GetKubeconfigSecretList(namespace string) (result []corev1.Secret, err error)

func GetSSHSecret

func GetSSHSecret(name string, namespace string) (secret []byte, err error)

func GetSSHSecretList

func GetSSHSecretList(namespace string) (result []corev1.Secret, err error)

func GetSecret

func GetSecret(name string, namespace string) (secret corev1.Secret, err error)

func GetSecretList

func GetSecretList(namespace string, options v1.ListOptions) (result []corev1.Secret, err error)

func IsResourceAlreadyExistsError

func IsResourceAlreadyExistsError(err error) bool

IsResourceAlreadyExistsError determines if error is an already exist type

func IsResourceNotFoundError

func IsResourceNotFoundError(err error) bool

IsResourceNotFoundError determines if error is of type not found

func SetLogger

func SetLogger()

Types

type CoreV1SecretInterface

type CoreV1SecretInterface interface {
	Secrets(namespace string) v12.SecretInterface
}

type SSHSecret

type SSHSecret struct {
	Secret
}

func NewSSHSecret

func NewSSHSecret(secretGetter CoreV1SecretInterface) SSHSecret

func (*SSHSecret) Get

func (s *SSHSecret) Get(namespace string, name string) (secret []byte, err error)

type Secret

type Secret struct {
	// contains filtered or unexported fields
}

func (*Secret) GetSecret

func (s *Secret) GetSecret(namespace string, name string) (secret corev1.Secret, err error)

func (*Secret) SetSecretGetter

func (s *Secret) SetSecretGetter(secretAPI CoreV1SecretInterface)

type SecretCRUDer

type SecretCRUDer interface {
	Create(*corev1.Secret) (*corev1.Secret, error)
	Delete(name string, options *v1.DeleteOptions) error
	Get(name string, options v1.GetOptions) (*corev1.Secret, error)
}

Jump to

Keyboard shortcuts

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