providers

package
v0.33.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProvidersRegistration providersRegistration

ProvidersRegistration is an instance of the provider registration system. It is responsible for adding new providers to the registry so that they can be executed in the correct order.

Functions

func CachedMakeComponent

func CachedMakeComponent(cache *rc.ObjectCache, objList []rc.ResourceIdent, o obj.ClowdObject, suffix string, fn makeFnCache, usePVC bool, nodePort bool) error

CachedMakeComponent is a generalised function that, given a ClowdObject will make the given service, deployment and PVC, based on the makeFn that is passed in.

func ExtractSecretData

func ExtractSecretData(secrets []core.Secret, fn ExtractFn, keys ...string)

ExtractSecretData takes a list of secrets, checks that the correct 'keys' are present and then runs the extract function on them.

func ExtractSecretDataAnno

func ExtractSecretDataAnno(secrets []core.Secret, fn ExtractFnAnno, annoKey string, keys ...string)

ExtractSecretDataAnno is just like ExtractSecretData except it expects an annotation to be present on the secret that will provide one of the values needed to extract the data out of the secret

func GetNamespacedName

func GetNamespacedName(o obj.ClowdObject, suffix string) types.NamespacedName

GetNamespacedName returns a unique name of an object in the format name-suffix.

func MakeOrGetSecret

func MakeOrGetSecret(ctx context.Context, obj obj.ClowdObject, cache *rc.ObjectCache, resourceIdent rc.ResourceIdent, nn types.NamespacedName, dataInit func() map[string]string) (*map[string]string, error)

MakeOrGetSecret tries to get the secret described by nn, if it exists it populates a map with the key/value pairs from the secret. If it doesn't exist the dataInit function is run and the resulting data is returned, as well as the secret being created.

func StrPtr

func StrPtr(s string) *string

StrPtr returns a pointer to a string.

Types

type ClowderProvider

type ClowderProvider interface {
	// Provide is the main function that performs the duty of the provider on a ClowdApp object, as
	// opposed to a ClowdEnvironment object.
	Provide(app *crd.ClowdApp, c *config.AppConfig) error
}

ClowderProvider is an interface providing a way for a provider to perform its duty.

type ExtractFn

type ExtractFn func(m *core.Secret)

ExtractFn is a function that can extract secret data from a function, the result of this function is usually declared as part of the function so no arguments are passed.

type ExtractFnAnno

type ExtractFnAnno func(m *core.Secret, annoVal string)

ExtractFnAnno is just like ExtractFn except it reads in the value of an annotation

type Labels

type Labels map[string]string

Labels is a map containing a key/value style map intended to hold k8s label information.

type ObjectMap

type ObjectMap map[rc.ResourceIdent]client.Object

ObjectMap providers a map of ResourceIdents to objects, it is used internally and for testing.

type Provider

type Provider struct {
	Client client.Client
	Ctx    context.Context
	Env    *crd.ClowdEnvironment
	Cache  *rc.ObjectCache
	Log    logr.Logger
}

Provider is a struct that holds a client/context and ClowdEnvironment object.

Jump to

Keyboard shortcuts

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