vaultresourcecontroller

package
v0.8.29 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const ReconcileFailed = "ReconcileFailed"
View Source
const ReconcileFailedReason = "LastReconcileCycleFailed"
View Source
const ReconcileSuccessful = "ReconcileSuccessful"
View Source
const ReconcileSuccessfulReason = "LastReconcileCycleSucceded"

Variables

This section is empty.

Functions

func AdvancedTemplateFuncMap added in v0.8.20

func AdvancedTemplateFuncMap(config *rest.Config, logger logr.Logger) template.FuncMap

AdvancedTemplateFuncMap to add Sprig and additional templating functions

func GetDynamicClientForAPIResource added in v0.8.20

func GetDynamicClientForAPIResource(context context.Context, resource *metav1.APIResource) (dynamic.NamespaceableResourceInterface, error)

GetDynamicClientOnAPIResource returns a dynamic client on an APIResource. This client can be further namespaced. needs context with log and restConfig

func GetDynamicClientForGVK added in v0.8.20

func GetDynamicClientForGVK(context context.Context, gvk schema.GroupVersionKind) (dynamic.NamespaceableResourceInterface, bool, error)

GetDynamicClientForGVK returns a dynamic client on an gvk type. Also returns whether this reosurce is namespaced. This client can be further namespaced. needs context with log and restConfig

func GetDynamicClientOnUnstructured added in v0.8.20

func GetDynamicClientOnUnstructured(context context.Context, obj *unstructured.Unstructured) (dynamic.ResourceInterface, error)

GetDynamicClientOnUnstructured returns a dynamic client on an Unstructured type. This client can be further namespaced. needs context with log and restConfig TODO consider refactoring using apimachinery.RESTClientForGVK in controller-runtime

func IsOwner added in v0.8.20

func IsOwner(owner, owned metav1.Object) bool

func ManageOutcome added in v0.8.9

func ManageOutcome(context context.Context, r ReconcilerBase, obj client.Object, issue error) (reconcile.Result, error)

func ManageOutcomeWithRequeue added in v0.8.9

func ManageOutcomeWithRequeue(context context.Context, r ReconcilerBase, obj client.Object, issue error, requeueAfter time.Duration) (reconcile.Result, error)

func NewLookupFunction added in v0.8.20

func NewLookupFunction(config *rest.Config, logger logr.Logger) lookupFunc

NewLookupFunction get information at runtime from cluster

func SetIndexField added in v0.8.20

func SetIndexField(context context.Context, cache cache.Cache, obj client.Object, path string) error

SetIndexField this function allows to prepare an index field for an objct so that fieldSelector can be used. It needs a cache object probably obtained via mrg.GetCache() This is a generic implementation, so it's relatively slow path should be expressed in the form of .<field>.<field> ... needs context with log

Types

type ReconcilerBase added in v0.8.20

type ReconcilerBase struct {
	Log            logr.Logger
	ControllerName string
	// contains filtered or unexported fields
}

func NewFromManager added in v0.8.20

func NewFromManager(mgr manager.Manager, controllerName string) ReconcilerBase

NewReconcilerBase is a contruction function to create a new ReconcilerBase.

func NewReconcilerBase added in v0.8.20

func NewReconcilerBase(client client.Client, scheme *runtime.Scheme, restConfig *rest.Config, recorder record.EventRecorder, apireader client.Reader, log logr.Logger, controllerName string) ReconcilerBase

func (*ReconcilerBase) CreateOrUpdateResource added in v0.8.20

func (r *ReconcilerBase) CreateOrUpdateResource(context context.Context, owner client.Object, namespace string, obj client.Object) error

CreateOrUpdateResource creates a resource if it doesn't exist, and updates (overwrites it), if it exist if owner is not nil, the owner field os set if namespace is not "", the namespace field of the object is overwritten with the passed value

func (*ReconcilerBase) DeleteResourceIfExists added in v0.8.20

func (r *ReconcilerBase) DeleteResourceIfExists(context context.Context, obj client.Object) error

DeleteResourceIfExists deletes an existing resource. It doesn't fail if the resource does not exist

func (*ReconcilerBase) GetClient added in v0.8.20

func (r *ReconcilerBase) GetClient() client.Client

GetClient returns the underlying client

func (*ReconcilerBase) GetDiscoveryClient added in v0.8.20

func (r *ReconcilerBase) GetDiscoveryClient() (*discovery.DiscoveryClient, error)

GetDiscoveryClient returns a discovery client for the current reconciler

func (*ReconcilerBase) GetRecorder added in v0.8.20

func (r *ReconcilerBase) GetRecorder() record.EventRecorder

GetRecorder returns the underlying recorder

func (*ReconcilerBase) GetRestConfig added in v0.8.20

func (r *ReconcilerBase) GetRestConfig() *rest.Config

GetRestConfig returns the undelying rest config

func (*ReconcilerBase) GetScheme added in v0.8.20

func (r *ReconcilerBase) GetScheme() *runtime.Scheme

GetScheme returns the scheme

type ResourceGenerationChangedPredicate added in v0.8.19

type ResourceGenerationChangedPredicate struct {
	predicate.Funcs
}

ResourceGenerationChangedPredicate this predicate will fire an update event when the spec of a resource is changed (controller by ResourceGeneration), or when the finalizers are changed

func (ResourceGenerationChangedPredicate) Update added in v0.8.19

Update implements default UpdateEvent filter for validating resource version change

type VaultEngineResource

type VaultEngineResource struct {
	// contains filtered or unexported fields
}

func NewVaultEngineResource

func NewVaultEngineResource(reconcilerBase *ReconcilerBase, obj client.Object) *VaultEngineResource

func (*VaultEngineResource) Reconcile

func (r *VaultEngineResource) Reconcile(ctx context.Context, instance client.Object) (ctrl.Result, error)

type VaultPKIEngineResource added in v0.3.0

type VaultPKIEngineResource struct {
	// contains filtered or unexported fields
}

func NewVaultPKIEngineResource added in v0.3.0

func NewVaultPKIEngineResource(reconcilerBase *ReconcilerBase, obj client.Object) *VaultPKIEngineResource

func (*VaultPKIEngineResource) Reconcile added in v0.3.0

func (r *VaultPKIEngineResource) Reconcile(ctx context.Context, instance client.Object) (ctrl.Result, error)

type VaultResource

type VaultResource struct {
	// contains filtered or unexported fields
}

func NewVaultResource

func NewVaultResource(reconcilerBase *ReconcilerBase, obj client.Object) *VaultResource

func (*VaultResource) Reconcile

func (r *VaultResource) Reconcile(ctx context.Context, instance client.Object) (ctrl.Result, error)

Jump to

Keyboard shortcuts

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