Skip to content

Commit

Permalink
add PriorityClassName to epp deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Oct 17, 2023
1 parent 0ede055 commit 1b5c212
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pkg/eventing/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const (

PublisherSecretEMSURLKey = "ems-publish-url"
PublisherSecretBEBNamespaceKey = "beb-namespace"

priorityClassName = "eventing-manager-priority-class"
)

var (
Expand All @@ -57,6 +59,7 @@ func newNATSPublisherDeployment(
WithNATSEnvVars(natsConfig, publisherConfig, eventing),
WithLogEnvVars(publisherConfig, eventing),
WithAffinity(GetPublisherDeploymentName(*eventing)),
WithPriorityClassName(priorityClassName),
)
}

Expand All @@ -70,6 +73,7 @@ func newEventMeshPublisherDeployment(
WithContainers(publisherConfig, eventing),
WithBEBEnvVars(GetPublisherDeploymentName(*eventing), publisherConfig, eventing),
WithLogEnvVars(publisherConfig, eventing),
WithPriorityClassName(priorityClassName),
)
}

Expand Down Expand Up @@ -136,6 +140,12 @@ func WithLabels(publisherName string, backendType v1alpha1.BackendType) DeployOp
}
}

func WithPriorityClassName(name string) DeployOpt {
return func(deployment *appsv1.Deployment) {
deployment.Spec.Template.Spec.PriorityClassName = name
}
}

func WithAffinity(publisherName string) DeployOpt {
return func(d *appsv1.Deployment) {
d.Spec.Template.Spec.Affinity = &v1.Affinity{
Expand Down
3 changes: 2 additions & 1 deletion pkg/eventing/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ func Test_NewDeploymentSecurityContext(t *testing.T) {
testutils.WithEventingCRNamespace("test-namespace"),
)
deployment := newDeployment(givenEventing, config.PublisherConfig,
WithContainers(config.PublisherConfig, givenEventing))
WithContainers(config.PublisherConfig, givenEventing),
)

// when
podSecurityContext := deployment.Spec.Template.Spec.SecurityContext
Expand Down

0 comments on commit 1b5c212

Please sign in to comment.