secrets

package
v2.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 12 Imported by: 194

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySecret

func ApplySecret(ctx context.Context, client client.Client, secret *v1.Secret) (controllerutil.OperationResult, error)

ApplySecret applies the secret in a way similar to kubectl apply. If the secret doesn't exist it is created. If it exists, it is updated.

func ApplySecretAndEnsureOwner

func ApplySecretAndEnsureOwner(ctx context.Context, client client.Client, obj client.Object, secret *v1.Secret) (controllerutil.OperationResult, error)

ApplySecretAndEnsureOwner applies the secret in a way similar to kubectl apply. If the secret doesn't exist it is created and an owner reference is added. If it exists, it is updated as long as the existing secret has a matching owner reference. If a secret exists that does not have the matching owner reference an error is returned

func ApplySecrets

func ApplySecrets(ctx context.Context, client client.Client, secrets []*v1.Secret) ([]controllerutil.OperationResult, error)

ApplySecrets applies the specified collection of secrets (similar to kubectl apply). If the secrets do not exist they are created. If they exist, they are updated. An attempt is made to apply each secret before returning an error.

func ApplySecretsAndEnsureOwner

func ApplySecretsAndEnsureOwner(ctx context.Context, client client.Client, obj client.Object, secrets []*v1.Secret) ([]controllerutil.OperationResult, error)

ApplySecretsAndEnsureOwner applies the specified collection of secrets (similar to kubectl apply). If the secrets do not exist they are created. If they exist, they are updated. An attempt is made to apply each secret before returning an error.

func NewSecretNotOwnedError

func NewSecretNotOwnedError(namespace string, secretName string, objectName string) error

Types

type SecretCollector

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

SecretCollector collects secret values and their associated genruntime.SecretDestination's and produces a merged set of v1.Secret's that can be written.

func NewSecretCollector

func NewSecretCollector(namespace string) *SecretCollector

NewSecretCollector creates a new SecretCollector

func (*SecretCollector) AddSecretValue

func (c *SecretCollector) AddSecretValue(dest *genruntime.SecretDestination, secretValue string)

AddSecretValue adds the dest and secretValue pair to the collector. If another value has already been added going to the same secret (but with a different key) the new key is merged into the existing secret.

func (*SecretCollector) Secrets

func (c *SecretCollector) Secrets() []*v1.Secret

Secrets returns the set of secrets that have been collected.

type SecretNotOwnedError

type SecretNotOwnedError struct {
	Namespace  string
	SecretName string
	ObjectName string
}

SecretNotOwnedError indicates the secret is not owned by the resource attempting to write it

func AsSecretNotOwnedError

func AsSecretNotOwnedError(err error) (*SecretNotOwnedError, bool)

func (*SecretNotOwnedError) Error

func (e *SecretNotOwnedError) Error() string

Jump to

Keyboard shortcuts

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