Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realias scheduling api version name in package imports #2526

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions pkg/controllers/job/job_controller_actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"volcano.sh/apis/pkg/apis/batch/v1alpha1"
schedulingv1alpha2 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
schedulingapi "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
"volcano.sh/volcano/pkg/controllers/apis"
"volcano.sh/volcano/pkg/controllers/job/state"
)
Expand All @@ -39,7 +39,7 @@ func TestKillJobFunc(t *testing.T) {
testcases := []struct {
Name string
Job *v1alpha1.Job
PodGroup *schedulingv1alpha2.PodGroup
PodGroup *schedulingapi.PodGroup
PodRetainPhase state.PhaseMap
UpdateStatus state.UpdateStatusFn
JobInfo *apis.JobInfo
Expand All @@ -60,7 +60,7 @@ func TestKillJobFunc(t *testing.T) {
ResourceVersion: "100",
},
},
PodGroup: &schedulingv1alpha2.PodGroup{
PodGroup: &schedulingapi.PodGroup{
ObjectMeta: metav1.ObjectMeta{
Name: "job1-e7f18111-1cec-11ea-b688-fa163ec79500",
Namespace: namespace,
Expand Down Expand Up @@ -183,7 +183,7 @@ func TestSyncJobFunc(t *testing.T) {
testcases := []struct {
Name string
Job *v1alpha1.Job
PodGroup *schedulingv1alpha2.PodGroup
PodGroup *schedulingapi.PodGroup
PodRetainPhase state.PhaseMap
UpdateStatus state.UpdateStatusFn
JobInfo *apis.JobInfo
Expand Down Expand Up @@ -228,17 +228,17 @@ func TestSyncJobFunc(t *testing.T) {
},
},
},
PodGroup: &schedulingv1alpha2.PodGroup{
PodGroup: &schedulingapi.PodGroup{
ObjectMeta: metav1.ObjectMeta{
Name: "job1-e7f18111-1cec-11ea-b688-fa163ec79500",
Namespace: namespace,
},
Spec: schedulingv1alpha2.PodGroupSpec{
Spec: schedulingapi.PodGroupSpec{
MinResources: &v1.ResourceList{},
MinTaskMember: map[string]int32{},
},
Status: schedulingv1alpha2.PodGroupStatus{
Phase: schedulingv1alpha2.PodGroupInqueue,
Status: schedulingapi.PodGroupStatus{
Phase: schedulingapi.PodGroupInqueue,
},
},
PodRetainPhase: state.PodRetainPhaseNone,
Expand Down Expand Up @@ -267,8 +267,8 @@ func TestSyncJobFunc(t *testing.T) {
t.Run(testcase.Name, func(t *testing.T) {
fakeController := newFakeController()

patches := gomonkey.ApplyMethod(reflect.TypeOf(fakeController), "GetQueueInfo", func(_ *jobcontroller, _ string) (*schedulingv1alpha2.Queue, error) {
return &schedulingv1alpha2.Queue{}, nil
patches := gomonkey.ApplyMethod(reflect.TypeOf(fakeController), "GetQueueInfo", func(_ *jobcontroller, _ string) (*schedulingapi.Queue, error) {
return &schedulingapi.Queue{}, nil
})

defer patches.Reset()
Expand Down Expand Up @@ -454,18 +454,18 @@ func TestUpdatePodGroupIfJobUpdateFunc(t *testing.T) {

testcases := []struct {
Name string
PodGroup *schedulingv1alpha2.PodGroup
PodGroup *schedulingapi.PodGroup
Job *v1alpha1.Job
ExpectVal error
}{
{
Name: "UpdatePodGroup success Case",
PodGroup: &schedulingv1alpha2.PodGroup{
PodGroup: &schedulingapi.PodGroup{
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
Name: "job1-e7f18111-1cec-11ea-b688-fa163ec79500",
},
Spec: schedulingv1alpha2.PodGroupSpec{
Spec: schedulingapi.PodGroupSpec{
MinResources: &v1.ResourceList{},
},
},
Expand Down
10 changes: 5 additions & 5 deletions pkg/controllers/job/job_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

"volcano.sh/apis/pkg/apis/batch/v1alpha1"
busv1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
schedulingv1alpha2 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
schedulingapi "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
"volcano.sh/volcano/pkg/controllers/apis"
"volcano.sh/volcano/pkg/controllers/job/state"
)
Expand Down Expand Up @@ -699,8 +699,8 @@ func TestPendingState_Execute(t *testing.T) {
fakecontroller := newFakeController()
state.KillJob = fakecontroller.killJob

patches := gomonkey.ApplyMethod(reflect.TypeOf(fakecontroller), "GetQueueInfo", func(_ *jobcontroller, _ string) (*schedulingv1alpha2.Queue, error) {
return &schedulingv1alpha2.Queue{}, nil
patches := gomonkey.ApplyMethod(reflect.TypeOf(fakecontroller), "GetQueueInfo", func(_ *jobcontroller, _ string) (*schedulingapi.Queue, error) {
return &schedulingapi.Queue{}, nil
})

defer patches.Reset()
Expand Down Expand Up @@ -1180,8 +1180,8 @@ func TestRunningState_Execute(t *testing.T) {
fakecontroller := newFakeController()
state.KillJob = fakecontroller.killJob

patches := gomonkey.ApplyMethod(reflect.TypeOf(fakecontroller), "GetQueueInfo", func(_ *jobcontroller, _ string) (*schedulingv1alpha2.Queue, error) {
return &schedulingv1alpha2.Queue{}, nil
patches := gomonkey.ApplyMethod(reflect.TypeOf(fakecontroller), "GetQueueInfo", func(_ *jobcontroller, _ string) (*schedulingapi.Queue, error) {
return &schedulingapi.Queue{}, nil
})

defer patches.Reset()
Expand Down