Skip to content

Commit

Permalink
Fix: use V1 api for CRDs for volcano scheduler (#1540)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aakcht authored Jun 1, 2022
1 parent 5516734 commit 8cc8298
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/spark-operator-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: spark-operator
description: A Helm chart for Spark on Kubernetes operator
version: 1.1.23
appVersion: v1beta2-1.3.6-3.1.1
version: 1.1.24
appVersion: v1beta2-1.3.7-3.1.1
keywords:
- spark
home: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator
Expand Down
11 changes: 9 additions & 2 deletions pkg/batchscheduler/volcano/volcano_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,19 @@ func New(config *rest.Config) (schedulerinterface.BatchScheduler, error) {
return nil, fmt.Errorf("failed to initialize k8s extension client with error %v", err)
}

if _, err := extClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(
if _, err := extClient.ApiextensionsV1().CustomResourceDefinitions().Get(
context.TODO(),
PodGroupName,
metav1.GetOptions{},
); err != nil {
return nil, fmt.Errorf("podGroup CRD is required to exists in current cluster error: %s", err)
//For backward compatibility check v1beta1 API version of CustomResourceDefinitions
if _, err := extClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(
context.TODO(),
PodGroupName,
metav1.GetOptions{},
); err != nil {
return nil, fmt.Errorf("podGroup CRD is required to exists in current cluster error: %s", err)
}
}
return &VolcanoBatchScheduler{
extensionClient: extClient,
Expand Down

0 comments on commit 8cc8298

Please sign in to comment.