From d2d9ba40bff89143ffeabdc6289832dcda6d017a Mon Sep 17 00:00:00 2001 From: yuteng Date: Thu, 25 Jul 2024 15:53:40 +0800 Subject: [PATCH] gci format --- .../go/tasks/plugins/k8s/ray/batchscheduler/default.go | 7 ++++--- .../go/tasks/plugins/k8s/ray/batchscheduler/plugins.go | 3 ++- .../tasks/plugins/k8s/ray/batchscheduler/plugins_test.go | 8 ++++---- .../go/tasks/plugins/k8s/ray/batchscheduler/yunikorn.go | 5 +++-- .../tasks/plugins/k8s/ray/batchscheduler/yunikorn_test.go | 6 +++--- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/default.go b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/default.go index dc17d1155f0..e00f595ff4b 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/default.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/default.go @@ -1,9 +1,10 @@ package batchscheduler import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" ) var ( @@ -27,6 +28,6 @@ func (d *DefaultPlugin) ParseJob( ) error { return nil } -func (d *DefaultPlugin) ProcessHead(metadata *metav1.ObjectMeta, head *v1.PodSpec) {} +func (d *DefaultPlugin) ProcessHead(metadata *metav1.ObjectMeta, head *v1.PodSpec) {} func (d *DefaultPlugin) ProcessWorker(metadata *metav1.ObjectMeta, worker *v1.PodSpec, index int) {} -func (d *DefaultPlugin) AfterProcess(metadata *metav1.ObjectMeta) {} +func (d *DefaultPlugin) AfterProcess(metadata *metav1.ObjectMeta) {} diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins.go b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins.go index 5aa2ff2ff9c..13962bfc234 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins.go @@ -1,9 +1,10 @@ package batchscheduler import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" ) type SchedulerPlugin interface { diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins_test.go index ac3ee9db9cd..f8a13bfeae1 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/plugins_test.go @@ -7,13 +7,13 @@ import ( ) func TestCreateSchedulerPlugin(t *testing.T) { - var tests = []struct{ - input *Config + var tests = []struct { + input *Config expect string }{ {input: &Config{Scheduler: DefaultScheduler}, expect: DefaultScheduler}, {input: &Config{Scheduler: Yunikorn}, expect: Yunikorn}, - {input: &Config{Scheduler:"Unknown"}, expect: DefaultScheduler}, + {input: &Config{Scheduler: "Unknown"}, expect: DefaultScheduler}, } for _, tt := range tests { t.Run("New scheduler plugin", func(t *testing.T) { @@ -21,4 +21,4 @@ func TestCreateSchedulerPlugin(t *testing.T) { assert.Equal(t, tt.expect, p.GetSchedulerName()) }) } -} \ No newline at end of file +} diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn.go b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn.go index c9f93b10be3..3a864e5ce77 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn.go @@ -4,9 +4,10 @@ import ( "encoding/json" "fmt" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" ) const ( @@ -20,7 +21,7 @@ const ( type YunikornGangSchedulingConfig struct { Annotations map[string]map[string]string - Parameters string + Parameters string } func NewYunikornPlugin() *YunikornGangSchedulingConfig { diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn_test.go index 59e730329c0..26368a74942 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/batchscheduler/yunikorn_test.go @@ -1,15 +1,15 @@ package batchscheduler import ( - "testing" "encoding/json" + "testing" "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" ) var (