certconfigmapgenerator

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package certconfigmapgenerator contains generator logic of add cert configmap resource in user namespaces

Index

Constants

This section is empty.

Variables

View Source
var ConfigMapChangedPredicate = predicate.Funcs{
	UpdateFunc: func(e event.UpdateEvent) bool {
		oldCM, _ := e.ObjectOld.(*corev1.ConfigMap)
		newCM, _ := e.ObjectNew.(*corev1.ConfigMap)
		return !reflect.DeepEqual(oldCM.Data, newCM.Data)
	},

	DeleteFunc: func(deleteEvent event.DeleteEvent) bool {
		return true
	},
}
View Source
var NamespaceCreatedPredicate = predicate.Funcs{
	CreateFunc: func(e event.CreateEvent) bool {
		return trustedcabundle.ShouldInjectTrustedBundle(e.Object)
	},

	UpdateFunc: func(e event.UpdateEvent) bool {
		oldNamespace, _ := e.ObjectOld.(*corev1.Namespace)
		newNamespace, _ := e.ObjectNew.(*corev1.Namespace)

		oldNsAnnValue, oldNsAnnExists := oldNamespace.GetAnnotations()[trustedcabundle.InjectionOfCABundleAnnotatoion]
		newNsAnnValue, newNsAnnExists := newNamespace.GetAnnotations()[trustedcabundle.InjectionOfCABundleAnnotatoion]

		if newNsAnnExists && !oldNsAnnExists {
			return true
		} else if newNsAnnExists && oldNsAnnExists && oldNsAnnValue != newNsAnnValue {
			return true
		}
		return false
	},
}

Functions

This section is empty.

Types

type CertConfigmapGeneratorReconciler

type CertConfigmapGeneratorReconciler struct {
	Client client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
}

CertConfigmapGeneratorReconciler holds the controller configuration.

func (*CertConfigmapGeneratorReconciler) Reconcile

Reconcile will generate new configmap, odh-trusted-ca-bundle, that includes cluster-wide trusted-ca bundle and custom ca bundle in every new namespace created.

func (*CertConfigmapGeneratorReconciler) SetupWithManager

func (r *CertConfigmapGeneratorReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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