Skip to content

Commit

Permalink
Add PriorityClassName to securityconfigupdate job
Browse files Browse the repository at this point in the history
Signed-off-by: Jens <jens.schmidt@eliatra.com>
  • Loading branch information
salyh authored and dr-lilienthal committed Jan 9, 2025
1 parent de6e591 commit 6976a67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opensearch-operator/api/v1/opensearch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ type SecurityConfig struct {

// Specific configs for the SecurityConfig update job
type SecurityUpdateJobConfig struct {
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
PriorityClassName string `json:"priorityClassName,omitempty"`
}

type ImageSpec struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5274,6 +5274,8 @@ spec:
description: Specific configs for the SecurityConfig update
job
properties:
priorityClassName:
type: string
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down
2 changes: 2 additions & 0 deletions opensearch-operator/pkg/builders/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,7 @@ func NewSecurityconfigUpdateJob(
securityContext := instance.Spec.General.SecurityContext
podSecurityContext := instance.Spec.General.PodSecurityContext
resources := instance.Spec.Security.GetConfig().GetUpdateJob().Resources
priorityClassName := instance.Spec.Security.GetConfig().GetUpdateJob().PriorityClassName
return batchv1.Job{
ObjectMeta: metav1.ObjectMeta{Name: jobName, Namespace: namespace, Annotations: annotations},
Spec: batchv1.JobSpec{
Expand All @@ -1139,6 +1140,7 @@ func NewSecurityconfigUpdateJob(
RestartPolicy: corev1.RestartPolicyNever,
ImagePullSecrets: image.ImagePullSecrets,
SecurityContext: podSecurityContext,
PriorityClassName: priorityClassName,
},
},
},
Expand Down

0 comments on commit 6976a67

Please sign in to comment.