secretutils

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelEnvironmentName  = "environment.metal3.io"
	LabelEnvironmentValue = "baremetal"
)
View Source
const (
	SecretsFinalizer = metal3v1alpha1.BareMetalHostFinalizer + "/secret"
)

Variables

This section is empty.

Functions

func AddSecretSelector

func AddSecretSelector(selectors cache.SelectorsByObject) cache.SelectorsByObject

AddSecretSelector adds a selector to a cache.SelectorsByObject that filters Secrets so that only those labelled as part of the baremetal environment get cached. The input may be nil.

Types

type SecretManager

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

SecretManager is a type for fetching Secrets whether or not they are in the client cache, labelling so that they will be included in the client cache, and optionally setting an owner reference.

func NewSecretManager

func NewSecretManager(log logr.Logger, cacheClient client.Client, apiReader client.Reader) SecretManager

NewSecretManager returns a new SecretManager

func (*SecretManager) AcquireSecret

func (sm *SecretManager) AcquireSecret(key types.NamespacedName, owner client.Object, ownerIsController, addFinalizer bool) (*corev1.Secret, error)

AcquireSecret retrieves a Secret and ensures that it has a label that will ensure it is present in the cache (and that we can watch for changes), and that it has a particular owner reference. The owner reference may optionally be a controller reference.

func (*SecretManager) ObtainSecret

func (sm *SecretManager) ObtainSecret(key types.NamespacedName) (*corev1.Secret, error)

ObtainSecret retrieves a Secret and ensures that it has a label that will ensure it is present in the cache (and that we can watch for changes).

func (*SecretManager) ReleaseSecret

func (sm *SecretManager) ReleaseSecret(secret *corev1.Secret) error

ReleaseSecret removes secrets manager finalizer from specified secret when needed.

Jump to

Keyboard shortcuts

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