common

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OperatorNamespace of the current operator instance, set in init()
	OperatorNamespace                   string
	InvalidObjectKeyError               = fmt.Errorf("invalid objectKey")
	InvalidObjectKeyErrorEmptyName      = fmt.Errorf("%w, empty name", InvalidObjectKeyError)
	InvalidObjectKeyErrorEmptyNamespace = fmt.Errorf("%w, empty namespace", InvalidObjectKeyError)
)

Functions

func FindVaultAuthByUID

func FindVaultAuthByUID(ctx context.Context, c client.Client, namespace string, uid types.UID, generation int64) (*secretsv1beta1.VaultAuth, error)

func FindVaultAuthForStorageEncryption

func FindVaultAuthForStorageEncryption(ctx context.Context, c client.Client) (*secretsv1beta1.VaultAuth, error)

FindVaultAuthForStorageEncryption returns VaultAuth resource labeled with `cacheEncryption=true`, and is found in the Operator's namespace. If none or more than one resource is found, an error will be returned. The resulting resource must have a valid StorageEncryption configured.

func FindVaultConnectionByUID

func FindVaultConnectionByUID(ctx context.Context, c client.Client, namespace string, uid types.UID, generation int64) (*secretsv1beta1.VaultConnection, error)

func GetConnectionNamespacedName

func GetConnectionNamespacedName(a *secretsv1beta1.VaultAuth) (types.NamespacedName, error)

GetConnectionNamespacedName returns the NamespacedName for the VaultAuth's configured vaultConnectionRef. If the vaultConnectionRef is empty then defaults Namespace and Name will be returned.

func GetVaultAuthWithRetry

func GetVaultAuthWithRetry(ctx context.Context, c client.Client, key types.NamespacedName, delay time.Duration, max uint64) (*secretsv1beta1.VaultAuth, error)

func GetVaultNamespace

func GetVaultNamespace(obj client.Object) (string, error)

GetVaultNamespace for the Syncable Secret type object.

Supported types for obj are: VaultDynamicSecret, VaultStaticSecret. VaultPKISecret

func ValidateObjectKey

func ValidateObjectKey(key ctrlclient.ObjectKey) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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