Skip to content

Commit c0f8ca0

Browse files
committed
Add PriorityClassName to RC types, CustomizePodSpec, and BaseComponent interface
1 parent 16a098a commit c0f8ca0

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

api/v1/runtimecomponent_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ type RuntimeComponentSpec struct {
163163
// DNS settings for the pod.
164164
// +operator-sdk:csv:customresourcedefinitions:order=29,type=spec,displayName="DNS"
165165
DNS *RuntimeComponentDNS `json:"dns,omitempty"`
166+
167+
// Name of the PriorityClass for the pod.
168+
// +operator-sdk:csv:customresourcedefinitions:order=30,type=spec,displayName="Priority Class Name"
169+
PriorityClassName *string `json:"priorityClassName,omitempty"`
166170
}
167171

168172
// Defines the DNS

common/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,5 @@ type BaseComponent interface {
260260
GetDisableServiceLinks() *bool
261261
GetTolerations() []corev1.Toleration
262262
GetDNS() BaseComponentDNS
263+
GetPriorityClassName() *string
263264
}

utils/utils.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,10 @@ func CustomizePodSpec(pts *corev1.PodTemplateSpec, ba common.BaseComponent) {
785785
}
786786

787787
pts.Spec.Tolerations = ba.GetTolerations()
788+
789+
if ba.GetPriorityClassName() != nil {
790+
pts.Spec.PriorityClassName = *ba.GetPriorityClassName()
791+
}
788792
}
789793

790794
// Initialize an empty TopologySpreadConstraints list and optionally prefers scheduling across zones/hosts for pods with podMatchLabels

0 commit comments

Comments
 (0)