providers

package
v0.80.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 15 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.

View Source
var RootSecret = rc.NewSingleResourceIdent("root", "root_env", &core.Secret{})

MinioSecret is the resource ident for the Minio secret object.

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(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.

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) error
	EnvProvide() error
	GetConfig() *config.AppConfig
}

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
	Config    *config.AppConfig
	HashCache *hashcache.HashCache
}

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

func (*Provider) GetCache added in v0.44.0

func (prov *Provider) GetCache() *rc.ObjectCache

func (*Provider) GetClient added in v0.44.0

func (prov *Provider) GetClient() client.Client

func (*Provider) GetConfig added in v0.50.0

func (prov *Provider) GetConfig() *config.AppConfig

func (*Provider) GetCtx added in v0.44.0

func (prov *Provider) GetCtx() context.Context

func (*Provider) GetEnv added in v0.44.0

func (prov *Provider) GetEnv() *crd.ClowdEnvironment

func (*Provider) GetLog added in v0.44.0

func (prov *Provider) GetLog() logr.Logger

type RootProvider added in v0.44.0

type RootProvider interface {
	GetClient() client.Client
	GetCtx() context.Context
	GetEnv() *crd.ClowdEnvironment
	GetCache() *rc.ObjectCache
	GetLog() logr.Logger
	GetConfig() *config.AppConfig
}

Directories

Path Synopsis
subscriptions
+kubebuilder:object:generate=true +groupName=operators.coreos.com
+kubebuilder:object:generate=true +groupName=operators.coreos.com

Jump to

Keyboard shortcuts

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