Documentation ¶
Index ¶
Constants ¶
const ( LabelEnvironmentName = "environment.metal3.io" LabelEnvironmentValue = "baremetal" )
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.