controllers

package
v0.0.0-...-1fe9478 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareExistingSecretDataToNewData

func CompareExistingSecretDataToNewData(secretManglerObject *v1alpha1.SecretMangler, existingSecretData *map[string][]byte, newData *map[string][]byte, ctx context.Context) int

CompareExistingSecretDataToNewData compares to data maps of Secrets. It will return 0 on equal, 1 on Secret needs update, 2 on Secret needs to be deleted

func DataBuilder

func DataBuilder(secretManglerObject *v1alpha1.SecretMangler, newData *map[string][]byte, returnOnSourceNotFound bool, r *SecretManglerReconciler, ctx context.Context) bool

DataBuilder generates the data mappings of a secret from a SecretMangler object.

func IsLookupString

func IsLookupString(lookupString string) (isLookupString bool)

IsLookupString checks if a string starts with < and ends with > which indicates a lookup string.

func ParseLookupString

func ParseLookupString(lookupString string) (namespaceName string, existingSecretName string, existingSecretField string, ok bool)

ParseLookupString will parse a lookupString used in mappings or mirror. If no namespace was given an empty string will be returned instead of a namespace. If the lookupString does not at least contain a secret and a field reference false will be returned for ok.

func RetrieveSecret

func RetrieveSecret(existingSecretName, namespaceName string, r *SecretManglerReconciler, ctx context.Context) *v1.Secret

RetrieveSecret retrieves a secret from the Kubernetes cluster with a given Name and Namespace.

func SecretBuilder

func SecretBuilder(secretManglerObject *v1alpha1.SecretMangler, givenData *map[string][]byte, r *SecretManglerReconciler, ctx context.Context) *v1.Secret

SecretBuilder generates a secret based on a SecretMangler object with all data and metadata. The secret will not be applied to the Kubernetes cluster.

Types

type SecretManglerReconciler

type SecretManglerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

SecretManglerReconciler reconciles a SecretMangler object

func (*SecretManglerReconciler) Reconcile

func (r *SecretManglerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*SecretManglerReconciler) SetupWithManager

func (r *SecretManglerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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