Skip to content

Commit 2629c76

Browse files
add PriorityClassName to epp deployment
1 parent 83c2d53 commit 2629c76

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

pkg/eventing/deployment.go

+14-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import (
55
"strconv"
66
"strings"
77

8-
"github.com/kyma-project/eventing-manager/api/v1alpha1"
9-
"github.com/kyma-project/eventing-manager/pkg/env"
10-
"github.com/kyma-project/eventing-manager/pkg/utils"
118
appsv1 "k8s.io/api/apps/v1"
129
v1 "k8s.io/api/core/v1"
1310
"k8s.io/apimachinery/pkg/api/resource"
1411
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1512
"k8s.io/apimachinery/pkg/util/intstr"
13+
14+
"github.com/kyma-project/eventing-manager/api/v1alpha1"
15+
"github.com/kyma-project/eventing-manager/pkg/env"
16+
"github.com/kyma-project/eventing-manager/pkg/utils"
1617
)
1718

1819
const (
@@ -38,6 +39,8 @@ const (
3839

3940
PublisherSecretEMSURLKey = "ems-publish-url"
4041
PublisherSecretBEBNamespaceKey = "beb-namespace"
42+
43+
priorityClassName = "eventing-manager-priority-class"
4144
)
4245

4346
var (
@@ -56,6 +59,7 @@ func newNATSPublisherDeployment(
5659
WithNATSEnvVars(natsConfig, publisherConfig, eventing),
5760
WithLogEnvVars(publisherConfig, eventing),
5861
WithAffinity(GetPublisherDeploymentName(*eventing)),
62+
WithPriorityClassName(priorityClassName),
5963
)
6064
}
6165

@@ -69,6 +73,7 @@ func newEventMeshPublisherDeployment(
6973
WithContainers(publisherConfig, eventing),
7074
WithBEBEnvVars(GetPublisherDeploymentName(*eventing), publisherConfig, eventing),
7175
WithLogEnvVars(publisherConfig, eventing),
76+
WithPriorityClassName(priorityClassName),
7277
)
7378
}
7479

@@ -135,6 +140,12 @@ func WithLabels(publisherName string, backendType v1alpha1.BackendType) DeployOp
135140
}
136141
}
137142

143+
func WithPriorityClassName(name string) DeployOpt {
144+
return func(deployment *appsv1.Deployment) {
145+
deployment.Spec.Template.Spec.PriorityClassName = name
146+
}
147+
}
148+
138149
func WithAffinity(publisherName string) DeployOpt {
139150
return func(d *appsv1.Deployment) {
140151
d.Spec.Template.Spec.Affinity = &v1.Affinity{

pkg/eventing/deployment_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ func Test_NewDeploymentSecurityContext(t *testing.T) {
102102
testutils.WithEventingCRNamespace("test-namespace"),
103103
)
104104
deployment := newDeployment(givenEventing, config.PublisherConfig,
105-
WithContainers(config.PublisherConfig, givenEventing))
105+
WithContainers(config.PublisherConfig, givenEventing),
106+
)
106107

107108
// when
108109
podSecurityContext := deployment.Spec.Template.Spec.SecurityContext

0 commit comments

Comments
 (0)