Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
Upgrade PriorityClass apiVersion to scheduling.k8s.io/v1 (#208)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <[email protected]>

Signed-off-by: Yuki Iwai <[email protected]>
  • Loading branch information
tenzen-y authored Jan 20, 2023
1 parent 9309adf commit 9ec55d1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/controller.v1/common/job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"k8s.io/client-go/kubernetes/scheme"
typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
corelisters "k8s.io/client-go/listers/core/v1"
schedulinglisters "k8s.io/client-go/listers/scheduling/v1beta1"
schedulinglisters "k8s.io/client-go/listers/scheduling/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller.v1/common/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeclientset "k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/core/v1"
schedulinglisters "k8s.io/client-go/listers/scheduling/v1beta1"
schedulinglisters "k8s.io/client-go/listers/scheduling/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller.v1/common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
apiv1 "github.com/kubeflow/common/pkg/apis/common/v1"
log "github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"
"k8s.io/api/scheduling/v1beta1"
schedulingv1 "k8s.io/api/scheduling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -103,7 +103,7 @@ func AddResourceList(list, req, limit v1.ResourceList) {
}
}

type PriorityClassGetFunc func(string) (*v1beta1.PriorityClass, error)
type PriorityClassGetFunc func(string) (*schedulingv1.PriorityClass, error)

func CalcPGMinResources(minMember int32, replicas map[apiv1.ReplicaType]*apiv1.ReplicaSpec, pcGetFunc PriorityClassGetFunc) *v1.ResourceList {
var replicasPriority ReplicasPriority
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler.v1/common/gang_scheduler_framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/scheduling/v1beta1"
schedulingv1 "k8s.io/api/scheduling/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -176,8 +176,8 @@ func (r *SchedulerFrameworkReconciler) calcPGMinResources(
replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec,
) *corev1.ResourceList {
return controllerv1.CalcPGMinResources(minMember, replicas,
func(pc string) (*v1beta1.PriorityClass, error) {
priorityClass := &v1beta1.PriorityClass{}
func(pc string) (*schedulingv1.PriorityClass, error) {
priorityClass := &schedulingv1.PriorityClass{}
err := r.Get(context.TODO(), types.NamespacedName{Name: pc}, priorityClass)
return priorityClass, err
})
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler.v1/common/gang_volcano.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/scheduling/v1beta1"
schedulingv1 "k8s.io/api/scheduling/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -193,8 +193,8 @@ func (r *VolcanoReconciler) DecoratePodForGangScheduling(rtype string, podTempla

// calcPGMinResources calculates the minimal resources needed for this job. The value will be embedded into the associated PodGroup
func (r *VolcanoReconciler) calcPGMinResources(minMember int32, replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec) *corev1.ResourceList {
pcGetFunc := func(pc string) (*v1beta1.PriorityClass, error) {
priorityClass := &v1beta1.PriorityClass{}
pcGetFunc := func(pc string) (*schedulingv1.PriorityClass, error) {
priorityClass := &schedulingv1.PriorityClass{}
err := r.Get(context.Background(), types.NamespacedName{Name: pc}, priorityClass)
return priorityClass, err
}
Expand Down

0 comments on commit 9ec55d1

Please sign in to comment.