comms

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidVaultMount = errors.New("vault mount is invalid")
	ErrInvalidSecretType = errors.New("vault secret is invalid type")
)

Functions

This section is empty.

Types

type VKKube

type VKKube struct {
	Client *kubernetes.Clientset
	Logger *logrus.Logger
}

VKKube is a wrapper around Kube client

func NewVKKubeClient

func NewVKKubeClient(logger *logrus.Logger) (*VKKube, error)

NewVKKubeClient returns a new VKKube client Reads from ~/.kube/config and falls back to in-cluster config

func (*VKKube) DeleteCM

func (k *VKKube) DeleteCM(name string, namespace string) error

DeleteCM delete's a given CM

func (*VKKube) DeleteOld

func (k *VKKube) DeleteOld(mounts *VKVaultMounts) error

DeleteOld deletes any CM's/secrets that are in kube but not Vault

func (*VKKube) DeleteSecret

func (k *VKKube) DeleteSecret(name string, namespace string) error

DeleteSecret delete's a given Secret

func (*VKKube) IsManaged

func (k *VKKube) IsManaged(name string, secretType string, namespace string) bool

IsManaged determines if a given cm/secret is managed by VaultingKube

func (*VKKube) SetCM

func (k *VKKube) SetCM(name string, namespace string, kv map[string]string) error

SetCM will create or update a given config map

func (*VKKube) SetSecret

func (k *VKKube) SetSecret(name string, namespace string, kv map[string]string) error

SetSecret will create or update a given secret

type VKVault

type VKVault struct {
	Client *vault.Client
}

VKVault is a wrapper around Vault

func NewVKVaultClient

func NewVKVaultClient() (*VKVault, error)

NewVKVaultClient returns a new VKVault client

func (*VKVault) GetMounts

func (v *VKVault) GetMounts(mountPath string) (*VKVaultMounts, error)

GetMounts will return a list of VKVaultMounts based on mountPath

type VKVaultMount

type VKVaultMount struct {
	MountPath    string
	MountPointer *vault.MountOutput
	Namespace    string
	SecretTypes  string
	Secrets      *VKVaultSecrets
}

VKVaultMount is a representation of a mount we care about

type VKVaultMounts

type VKVaultMounts []VKVaultMount

VKVaultMounts is a slice of VKVaultMount's

type VKVaultSecret

type VKVaultSecret struct {
	Name  string
	Pairs map[string]string
}

VKVaultSecret is a kv secret stored in vault

type VKVaultSecrets

type VKVaultSecrets []VKVaultSecret

VKVaultSecrets is a slice of VKVaultSecret's

Jump to

Keyboard shortcuts

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