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 ¶
func (r *CertConfigmapGeneratorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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.
Click to show internal directories.
Click to hide internal directories.