Skip to content

Commit

Permalink
Update CPO, HO and support for new dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilienM committed Nov 21, 2024
1 parent 7fade67 commit a39abfc
Show file tree
Hide file tree
Showing 39 changed files with 131 additions and 736 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (r *AWSEndpointServiceReconciler) SetupWithManager(mgr ctrl.Manager) error
_, err := ctrl.NewControllerManagedBy(mgr).
For(&hyperv1.AWSEndpointService{}).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(3*time.Second, 30*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](3*time.Second, 30*time.Second),
MaxConcurrentReconciles: 10,
}).
Watches(&hyperv1.HostedControlPlane{}, handler.Funcs{UpdateFunc: r.enqueueOnAccessChange(mgr)}).
Expand Down Expand Up @@ -229,8 +229,8 @@ func (r *AWSEndpointServiceReconciler) SetupWithManager(mgr ctrl.Manager) error
return nil
}

func (r *AWSEndpointServiceReconciler) enqueueOnAccessChange(mgr ctrl.Manager) func(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
return func(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
func (r *AWSEndpointServiceReconciler) enqueueOnAccessChange(mgr ctrl.Manager) func(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
return func(ctx context.Context, e event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
logger := mgr.GetLogger()
newHCP, isOk := e.ObjectNew.(*hyperv1.HostedControlPlane)
if !isOk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef c
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "cluster-version-operator",
ServerName: ptr.To("cluster-version-operator"),
CA: prometheusoperatorv1.SecretOrConfigMap{
ConfigMap: &corev1.ConfigMapKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef c
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "etcd-client",
ServerName: ptr.To("etcd-client"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (r *HostedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager, create
b := ctrl.NewControllerManagedBy(mgr).
For(&hyperv1.HostedControlPlane{}).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 10*time.Second),
})
for _, handler := range r.eventHandlers(mgr.GetScheme(), mgr.GetRESTMapper()) {
b.Watches(handler.obj, handler.handler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,11 @@ func (t *createTrackingClient) Create(ctx context.Context, o client.Object, opts

type createTrackingWorkqueue struct {
items []reconcile.Request
workqueue.RateLimitingInterface
workqueue.TypedRateLimitingInterface[reconcile.Request]
}

func (c *createTrackingWorkqueue) Add(item interface{}) {
c.items = append(c.items, item.(reconcile.Request))
func (c *createTrackingWorkqueue) Add(item reconcile.Request) {
c.items = append(c.items, item)
}

func TestReconcileRouter(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/utils/ptr"
)

func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef config.OwnerRef, clusterID string, metricsSet metrics.MetricsSet) error {
Expand All @@ -29,7 +30,7 @@ func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef c
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "kube-apiserver",
ServerName: ptr.To("kube-apiserver"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"
)

func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef config.OwnerRef, clusterID string, metricsSet metrics.MetricsSet) error {
Expand All @@ -25,7 +26,7 @@ func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef c
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "kube-controller-manager",
ServerName: ptr.To("kube-controller-manager"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func ReconcileClusterNodeTuningOperatorServiceMonitor(sm *prometheusoperatorv1.S
Path: "/metrics",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: metricsServiceName + "." + sm.Namespace + ".svc",
ServerName: ptr.To(metricsServiceName + "." + sm.Namespace + ".svc"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"
)

func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef config.OwnerRef, clusterID string, metricsSet metrics.MetricsSet) error {
Expand All @@ -25,7 +26,7 @@ func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef c
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "openshift-apiserver",
ServerName: ptr.To("openshift-apiserver"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"
)

func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef config.OwnerRef, clusterID string, metricsSet metrics.MetricsSet) error {
Expand All @@ -25,7 +26,7 @@ func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef c
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "openshift-controller-manager",
ServerName: ptr.To("openshift-controller-manager"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"

imagev1 "github.com/openshift/api/image/v1"

Expand Down Expand Up @@ -240,7 +241,7 @@ func ReconcileCatalogServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, own
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "catalog-operator-metrics",
ServerName: ptr.To("catalog-operator-metrics"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"

"github.com/openshift/hypershift/support/certs"
"github.com/openshift/hypershift/support/config"
Expand Down Expand Up @@ -186,7 +187,7 @@ func ReconcileOLMOperatorServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor,
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "olm-operator-metrics",
ServerName: ptr.To("olm-operator-metrics"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 +404,14 @@ func ReconcilePodMonitor(pm *prometheusoperatorv1.PodMonitor, clusterID string,
Port: "metrics",
Path: "/metrics",
Scheme: "https",
TLSConfig: &prometheusoperatorv1.PodMetricsEndpointTLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: metricsHostname,
CA: prometheusoperatorv1.SecretOrConfigMap{
ConfigMap: &corev1.ConfigMapKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: manifests.RootCAConfigMap(pm.Namespace).Name,
},
Key: certs.CASignerCertMapKey,
TLSConfig: &prometheusoperatorv1.SafeTLSConfig{
ServerName: ptr.To(metricsHostname),
CA: prometheusoperatorv1.SecretOrConfigMap{
ConfigMap: &corev1.ConfigMapKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: manifests.RootCAConfigMap(pm.Namespace).Name,
},
Key: certs.CASignerCertMapKey,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"
)

func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef config.OwnerRef, clusterID string, metricsSet metrics.MetricsSet) error {
Expand All @@ -25,7 +26,7 @@ func ReconcileServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef c
Scheme: "https",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "openshift-controller-manager",
ServerName: ptr.To("openshift-controller-manager"),
Cert: prometheusoperatorv1.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ func Setup(ctx context.Context, opts *operator.HostedClusterConfigOperatorConfig
return fmt.Errorf("failed building kubevirt infra cache: %w", err)
}
// if kubevirt infra config is not used, it is being set the same as the mgmt config
kubevirtInfraClient, err := client.New(opts.KubevirtInfraConfig, client.Options{
kubevirtInfraClientRestConfig := opts.KubevirtInfraConfig
kubevirtInfraClientRestConfig.WarningHandler = rest.NoWarnings{}
kubevirtInfraClient, err := client.New(kubevirtInfraClientRestConfig, client.Options{
Scheme: kubevirtScheme,
Mapper: kubevirtMapper,
Cache: &client.CacheOptions{Reader: kubevirtInfraCache},
WarningHandler: client.WarningHandlerOptions{
SuppressWarnings: true,
},
})
if err != nil {
return fmt.Errorf("failed to create kubevirt infra uncached client: %w", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/operator"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

const ControllerName = "nodecount"
Expand All @@ -24,7 +25,7 @@ func Setup(ctx context.Context, opts *operator.HostedClusterConfigOperatorConfig
Named(ControllerName).
For(&corev1.Node{}).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 10*time.Second),
}).Complete(&reconciler{
hcpName: opts.HCPName,
hcpNamespace: opts.Namespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/openshift/hypershift/support/metrics"
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"k8s.io/utils/ptr"
)

func ReconcileKubeAPIServerServiceMonitor(serviceMonitor *prometheusoperatorv1.ServiceMonitor) error {
Expand All @@ -21,7 +22,7 @@ func ReconcileKubeAPIServerServiceMonitor(serviceMonitor *prometheusoperatorv1.S
BearerTokenFile: "/var/run/secrets/kubernetes.io/serviceaccount/token",
TLSConfig: &prometheusoperatorv1.TLSConfig{
SafeTLSConfig: prometheusoperatorv1.SafeTLSConfig{
ServerName: "kubernetes.default.svc",
ServerName: ptr.To("kubernetes.default.svc"),
},
CAFile: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/rest"
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
"k8s.io/utils/ptr"
"k8s.io/utils/set"
Expand Down Expand Up @@ -148,24 +149,22 @@ func Setup(ctx context.Context, opts *operator.HostedClusterConfigOperatorConfig
return fmt.Errorf("failed to add to scheme: %w", err)
}

uncachedClient, err := client.New(opts.Manager.GetConfig(), client.Options{
uncachedClientRestConfig := opts.Manager.GetConfig()
uncachedClientRestConfig.WarningHandler = rest.NoWarnings{}
uncachedClient, err := client.New(uncachedClientRestConfig, client.Options{
Scheme: opts.Manager.GetScheme(),
Mapper: opts.Manager.GetRESTMapper(),
WarningHandler: client.WarningHandlerOptions{
SuppressWarnings: true,
},
})
if err != nil {
return fmt.Errorf("failed to create uncached client: %w", err)
}

// if kubevirt infra config is not used, it is being set the same as the mgmt config
kubevirtInfraClient, err := client.New(opts.KubevirtInfraConfig, client.Options{
kubevirtInfraClientRestConfig := opts.KubevirtInfraConfig
kubevirtInfraClientRestConfig.WarningHandler = rest.NoWarnings{}
kubevirtInfraClient, err := client.New(kubevirtInfraClientRestConfig, client.Options{
Scheme: opts.Manager.GetScheme(),
Mapper: opts.Manager.GetRESTMapper(),
WarningHandler: client.WarningHandlerOptions{
SuppressWarnings: true,
},
})
if err != nil {
return fmt.Errorf("failed to create kubevirt infra uncached client: %w", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,10 @@ func (c *CertificateRevocationController) prunePreviousSignerCertificates(ctx co

var existingLeafCerts []*certificateSecret
for _, secret := range secrets {
if _, hasTLSCertKey := secret.Data[corev1.TLSCertKey]; !hasTLSCertKey {
continue
}

certKeyInfo, err := certgraphanalysis.InspectSecret(secret)
if err != nil {
klog.Warningf("failed to load cert/key pair from secret %s/%s: %v", secret.Namespace, secret.Name, err)
Expand All @@ -723,12 +727,14 @@ func (c *CertificateRevocationController) prunePreviousSignerCertificates(ctx co
return true, nil, false, fmt.Errorf("could not parse certificate in secret %s/%s: %w", secret.Namespace, secret.Name, err)
}

if isLeafCertificate(certKeyInfo) {
existingLeafCerts = append(existingLeafCerts, &certificateSecret{
namespace: secret.Namespace,
name: secret.Name,
cert: certs[0],
})
for _, cert := range certKeyInfo {
if isLeafCertificate(cert) {
existingLeafCerts = append(existingLeafCerts, &certificateSecret{
namespace: secret.Namespace,
name: secret.Name,
cert: certs[0],
})
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ require (
github.com/blang/semver v3.5.1+incompatible
github.com/clarketm/json v1.17.1
github.com/coreos/ignition/v2 v2.18.0
github.com/distribution/reference v0.6.0
github.com/docker/distribution v2.8.3+incompatible
github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5
github.com/evanphx/json-patch/v5 v5.9.0
Expand Down Expand Up @@ -125,7 +126,6 @@ require (
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/coreos/vcontext v0.0.0-20231102161604-685dc7299dc5 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (r *HostedClusterReconciler) SetupWithManager(mgr ctrl.Manager, createOrUpd
bldr := ctrl.NewControllerManagedBy(mgr).
For(&hyperv1.HostedCluster{}, builder.WithPredicates(hyperutil.PredicatesForHostedClusterAnnotationScoping(mgr.GetClient()))).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 10*time.Second),
MaxConcurrentReconciles: 10,
})
for _, managedResource := range r.managedResources() {
Expand Down
4 changes: 2 additions & 2 deletions hypershift-operator/controllers/hostedclustersizing/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func SetupWithManager(ctx context.Context, mgr ctrl.Manager, hypershiftOperatorI
}}
})).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 10*time.Second),
}).Complete(newReconciler(
hypershiftClient, mgr.GetClient(), time.Now,
hypershiftOperatorImage, releaseProvider, imageMetadataProvider,
Expand All @@ -134,7 +134,7 @@ func SetupWithManager(ctx context.Context, mgr ctrl.Manager, hypershiftOperatorI
Named(ValidatingControllerName).
For(&schedulingv1alpha1.ClusterSizingConfiguration{}).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 10*time.Second),
}).Complete(&validator{
client: hypershiftClient,
lister: mgr.GetClient(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (r *NodePoolReconciler) SetupWithManager(mgr ctrl.Manager) error {
// We want to reconcile when the ConfigMaps referenced by the spec.config and also the core ones change.
Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(r.enqueueNodePoolsForConfig), builder.WithPredicates(supportutil.PredicatesForHostedClusterAnnotationScoping(mgr.GetClient()))).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 10*time.Second),
MaxConcurrentReconciles: 10,
}).
Complete(r); err != nil {
Expand All @@ -131,7 +131,7 @@ func (r *NodePoolReconciler) SetupWithManager(mgr ctrl.Manager) error {
if err := ctrl.NewControllerManagedBy(mgr).
For(&corev1.Secret{}).
WithOptions(controller.Options{
RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 10*time.Second),
RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 10*time.Second),
MaxConcurrentReconciles: 10,
}).
Complete(&secretJanitor{
Expand Down
Loading

0 comments on commit a39abfc

Please sign in to comment.