Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCredentialsNotFound is returned when no credentials are configured. ErrCredentialsNotFound = errors.New("Credentials not found") // ErrCredentialMissing is returned when the credentials do not contain a username and/or password. ErrCredentialMissing = errors.New("Username/Password is missing") // ErrUnknownSecretKey is returned when the supplied key does not return a secret. ErrUnknownSecretKey = errors.New("Unknown secret key") )
Errors
Functions ¶
This section is empty.
Types ¶
type Credential ¶
Credential is a vCenter credential that is retrieved or stored in a Kubernetes secret.
type SecretCache ¶
type SecretCache struct { VirtualCenter map[string]*Credential Secret *v1.Secret SecretFile map[string][]byte // contains filtered or unexported fields }
SecretCache is used to cache information about Kubernetes secrets data.
func (*SecretCache) GetCredential ¶
func (cache *SecretCache) GetCredential(server string) (Credential, bool)
GetCredential returns the vCenter credentials from a Kubernetes secret for the provided vCenter.
func (*SecretCache) GetSecret ¶
func (cache *SecretCache) GetSecret() *corev1.Secret
GetSecret returns a Kubernetes secret.
func (*SecretCache) UpdateSecret ¶
func (cache *SecretCache) UpdateSecret(secret *corev1.Secret)
UpdateSecret updates a Kubernetes secret with the provided data.
func (*SecretCache) UpdateSecretFile ¶
func (cache *SecretCache) UpdateSecretFile(data map[string][]byte)
UpdateSecretFile updates a Kubernetes secret with the provided data.
type SecretCredentialManager ¶
type SecretCredentialManager struct { SecretName string SecretNamespace string SecretLister clientv1.SecretLister SecretsDirectory string SecretsDirectoryParse bool Cache *SecretCache }
SecretCredentialManager is used to manage vCenter credentials stored as Kubernetes secrets.
func (*SecretCredentialManager) GetCredential ¶
func (secretCredentialManager *SecretCredentialManager) GetCredential(server string) (*Credential, error)
GetCredential returns credentials for the given vCenter Server. GetCredential returns error if Secret is not added or SecretDirectory is not set (ie No Creds).