controller

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTaggableResourceController added in v1.1.2

func CreateTaggableResourceController[T any, P ResourceMetadataProvider[T], PT ResourcePointer[T]](mgr ctrl.Manager, tagsManager gcp.TagsManager, provider P, labelMatcher func(map[string]string) map[string]string)

func SetupTagBindingIndex

func SetupTagBindingIndex(mgr ctrl.Manager) error

Types

type ResourceMetadataProvider

type ResourceMetadataProvider[R any] interface {
	GetResourceLocation(r *R) string
	GetResourceID(projectInfo *resourcemanagerpb.Project, r *R) string
}

type ResourcePointer

type ResourcePointer[T any] interface {
	*T
	client.Object
}

type TaggableResourceReconciler

type TaggableResourceReconciler[T any, P ResourceMetadataProvider[T], PT ResourcePointer[T]] struct {
	client.Client
	Scheme           *runtime.Scheme
	TagsManager      gcp.TagsManager
	MetadataProvider P
	LabelMatcher     func(map[string]string) map[string]string
}

TaggableResourceReconciler reconciles any Google Cloud Config Connector object that can be tagged

func (*TaggableResourceReconciler[T, P, PT]) Reconcile

func (r *TaggableResourceReconciler[T, P, PT]) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.18.4/pkg/reconcile

func (*TaggableResourceReconciler[T, P, PT]) SetupWithManager

func (r *TaggableResourceReconciler[T, P, PT]) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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