Documentation ¶
Index ¶
- Variables
- func CachedMakeComponent(cache *rc.ObjectCache, objList []rc.ResourceIdent, o obj.ClowdObject, ...) error
- func ExtractSecretData(secrets []core.Secret, fn ExtractFn, keys ...string)
- func ExtractSecretDataAnno(secrets []core.Secret, fn ExtractFnAnno, annoKey string, keys ...string)
- func GetNamespacedName(o obj.ClowdObject, suffix string) types.NamespacedName
- func MakeOrGetSecret(ctx context.Context, obj obj.ClowdObject, cache *rc.ObjectCache, ...) (*map[string]string, error)
- func StrPtr(s string) *string
- type ClowderProvider
- type ExtractFn
- type ExtractFnAnno
- type Labels
- type ObjectMap
- type Provider
- type RootProvider
Constants ¶
This section is empty.
Variables ¶
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 ¶
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.
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 ¶
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 ¶
ExtractFnAnno is just like ExtractFn except it reads in the value of an annotation
type Labels ¶
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.
func (*Provider) GetCache ¶ added in v0.44.0
func (prov *Provider) GetCache() *rc.ObjectCache
func (*Provider) GetEnv ¶ added in v0.44.0
func (prov *Provider) GetEnv() *crd.ClowdEnvironment
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 }
Directories ¶
Path | Synopsis |
---|---|
subscriptions
+kubebuilder:object:generate=true +groupName=operators.coreos.com
|
+kubebuilder:object:generate=true +groupName=operators.coreos.com |