Skip to content

Commit

Permalink
fix: fix issue #1723 about spark-operator not working with volcano on…
Browse files Browse the repository at this point in the history
… OCP (#1724)

* fix: fix issue #1723 about spark-operator not working with volcano on OCP

Signed-off-by: disaster37 <linuxworkgroup@hotmail.com>

* Update volcano_scheduler.go

---------

Signed-off-by: disaster37 <linuxworkgroup@hotmail.com>
  • Loading branch information
disaster37 authored Nov 9, 2023
1 parent b49b1b4 commit 8cb6c80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions charts/spark-operator-chart/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ rules:
resources:
- sparkapplications
- sparkapplications/status
- sparkapplications/finalizers
- scheduledsparkapplications
- scheduledsparkapplications/status
- scheduledsparkapplications/finalizers
verbs:
- "*"
{{- if .Values.batchScheduler.enable }}
Expand Down
2 changes: 1 addition & 1 deletion manifest/spark-operator-install/spark-operator-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ rules:
resources: ["mutatingwebhookconfigurations", "validatingwebhookconfigurations"]
verbs: ["create", "get", "update", "delete"]
- apiGroups: ["sparkoperator.k8s.io"]
resources: ["sparkapplications", "scheduledsparkapplications", "sparkapplications/status", "scheduledsparkapplications/status"]
resources: ["sparkapplications", "scheduledsparkapplications", "sparkapplications/status", "scheduledsparkapplications/status", "sparkapplications/finalizers", "scheduledsparkapplications/finalizers"]
verbs: ["*"]
- apiGroups: ["scheduling.volcano.sh"]
resources: ["podgroups", "queues", "queues/status"]
Expand Down
7 changes: 5 additions & 2 deletions pkg/batchscheduler/volcano/volcano_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,12 @@ func (v *VolcanoBatchScheduler) getAppPodGroupName(app *v1beta2.SparkApplication
}

func (v *VolcanoBatchScheduler) syncPodGroup(app *v1beta2.SparkApplication, size int32, minResource corev1.ResourceList) error {
var err error
var (
err error
pg *v1beta1.PodGroup
)
podGroupName := v.getAppPodGroupName(app)
if pg, err := v.volcanoClient.SchedulingV1beta1().PodGroups(app.Namespace).Get(context.TODO(), podGroupName, metav1.GetOptions{}); err != nil {
if pg, err = v.volcanoClient.SchedulingV1beta1().PodGroups(app.Namespace).Get(context.TODO(), podGroupName, metav1.GetOptions{}); err != nil {
if !errors.IsNotFound(err) {
return err
}
Expand Down

0 comments on commit 8cb6c80

Please sign in to comment.