Skip to content

Commit 8cc8298

Browse files
authored
Fix: use V1 api for CRDs for volcano scheduler (#1540)
1 parent 5516734 commit 8cc8298

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

charts/spark-operator-chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
22
name: spark-operator
33
description: A Helm chart for Spark on Kubernetes operator
4-
version: 1.1.23
5-
appVersion: v1beta2-1.3.6-3.1.1
4+
version: 1.1.24
5+
appVersion: v1beta2-1.3.7-3.1.1
66
keywords:
77
- spark
88
home: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator

pkg/batchscheduler/volcano/volcano_scheduler.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,19 @@ func New(config *rest.Config) (schedulerinterface.BatchScheduler, error) {
180180
return nil, fmt.Errorf("failed to initialize k8s extension client with error %v", err)
181181
}
182182

183-
if _, err := extClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(
183+
if _, err := extClient.ApiextensionsV1().CustomResourceDefinitions().Get(
184184
context.TODO(),
185185
PodGroupName,
186186
metav1.GetOptions{},
187187
); err != nil {
188-
return nil, fmt.Errorf("podGroup CRD is required to exists in current cluster error: %s", err)
188+
//For backward compatibility check v1beta1 API version of CustomResourceDefinitions
189+
if _, err := extClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(
190+
context.TODO(),
191+
PodGroupName,
192+
metav1.GetOptions{},
193+
); err != nil {
194+
return nil, fmt.Errorf("podGroup CRD is required to exists in current cluster error: %s", err)
195+
}
189196
}
190197
return &VolcanoBatchScheduler{
191198
extensionClient: extClient,

0 commit comments

Comments
 (0)