Skip to content

Commit

Permalink
Set desired EPP deployment replicas to nil if there is not HPA
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobebway committed Nov 9, 2023
1 parent af177cc commit 67b4929
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/eventing/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

appsv1 "k8s.io/api/apps/v1"
"k8s.io/client-go/tools/record"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

Expand Down Expand Up @@ -92,12 +91,10 @@ func (em *EventingManager) applyPublisherProxyDeployment(
backendType v1alpha1.BackendType) (*appsv1.Deployment, error) {
var desiredPublisher *appsv1.Deployment

var replicas *int32
var replicas *int32 = nil
hpa, err := em.kubeClient.GetHPA(ctx, GetPublisherDeploymentName(*eventing), eventing.Namespace)
if err == nil && hpa != nil {
replicas = hpa.Spec.MinReplicas
} else {
replicas = ptr.To(int32(eventing.Spec.Publisher.Replicas.Min))
}

switch backendType {
Expand Down

0 comments on commit 67b4929

Please sign in to comment.