resources

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v0.13.0

func Add(
	log logr.Logger,
	mgr manager.Manager,
	configuration configuration.Configuration,
	opts utils.ControllerOptions,
	cache *cache.ImpersonationCache,
) (err error)

func ForeachNamespace added in v0.13.0

func ForeachNamespace(
	ctx context.Context,
	controllerClient client.Client,
	resourceClient client.Client,
	collector Collector,
	opts CollectorOptions,
	log logr.Logger,
	resource capsulev1beta2.ResourceSpec,
	resourceIndex int,
	tnt capsulev1beta2.Tenant,
	acc processor.Accumulator,
) (err error)

func GatherAdditionalMetadata added in v0.13.0

func GatherAdditionalMetadata(
	spec capsulev1beta2.ResourceSpec,
	fastContext map[string]string,
) (labels map[string]string, annotations map[string]string)

Allows templating in.

Types

type Collector added in v0.13.0

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

func NewCollector added in v0.13.0

func NewCollector(c client.Reader, mapper k8smeta.RESTMapper) Collector

func (*Collector) AddToAccumulation added in v0.13.0

func (co *Collector) AddToAccumulation(
	tnt *capsulev1beta2.Tenant,
	ns *corev1.Namespace,
	opts CollectorOptions,
	spec capsulev1beta2.ResourceSpec,
	obj *unstructured.Unstructured,
	origin string,
	combine bool,
) (err error)

Add an item to the accumulator Mainly handles conflicts.

func (*Collector) Collect added in v0.13.0

func (co *Collector) Collect(
	ctx context.Context,
	c client.Client,
	opts CollectorOptions,
	tnt *capsulev1beta2.Tenant,
	resourceIndex string,
	spec capsulev1beta2.ResourceSpec,
	ns *corev1.Namespace,
) (err error)

func (*Collector) CollectForNamespace added in v0.14.0

func (co *Collector) CollectForNamespace(
	ctx context.Context,
	c client.Client,
	opts CollectorOptions,
	tnt capsulev1beta2.Tenant,
	resourceIndex string,
	spec capsulev1beta2.ResourceSpec,
	sources map[gvk.ResourceKey]*unstructured.Unstructured,
	target *corev1.Namespace,
) error

CollectForNamespace collects the items of a single ResourceSpec targeting the given Namespace, replicating into it the already loaded source objects.

The given options are used as a template: the iterator is always derived from the target Namespace, thus callers are not required to prepare it.

func (*Collector) CollectNamespacedItems added in v0.13.0

type CollectorIteratorOptions added in v0.13.0

type CollectorIteratorOptions struct {
	Labels         map[string]string
	Annotations    map[string]string
	FastContext    map[string]string
	FastContextAny map[string]any
}

func NewCollectorIteratorOptions added in v0.13.0

func NewCollectorIteratorOptions(
	tnt *capsulev1beta2.Tenant,
	ns *corev1.Namespace,
	spec capsulev1beta2.ResourceSpec,
) CollectorIteratorOptions

type CollectorOptions added in v0.13.0

type CollectorOptions struct {
	AllowClusterScopedObjects    bool
	AllowCrossNamespaceSelection bool
	Accumulator                  processor.Accumulator
	Iterator                     CollectorIteratorOptions
	ReplicationContext           map[string]any
	ValidatorNamespaces          tpl.NamespaceValidator
	// contains filtered or unexported fields
}

type NamespaceTrigger added in v0.14.0

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

NamespaceTrigger is watching for Namespace events, and trigger the GlobalTenantResource or TenantResource target the watched object: this is used to propagate resources in new freshly created Namespace without waiting for the resyncPeriod of the Resources.

func (*NamespaceTrigger) Reconcile added in v0.14.0

func (r *NamespaceTrigger) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

func (*NamespaceTrigger) SetupWithManager added in v0.14.0

func (r *NamespaceTrigger) SetupWithManager(mgr ctrl.Manager, ctrlConfig utils.ControllerOptions) error

Jump to

Keyboard shortcuts

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