diff --git a/flytepropeller/.golangci.yml b/flytepropeller/.golangci.yml index 5d53f35295..7f4dbc80e8 100644 --- a/flytepropeller/.golangci.yml +++ b/flytepropeller/.golangci.yml @@ -13,6 +13,7 @@ linters: - deadcode - errcheck - gas + - gci - goconst - goimports - golint @@ -28,3 +29,12 @@ linters: - unparam - unused - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true diff --git a/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go b/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go index a78b61162a..6c3da04107 100644 --- a/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go +++ b/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go @@ -6,7 +6,8 @@ package tools import ( _ "github.com/EngHabu/mockery/cmd/mockery" _ "github.com/alvaroloes/enumer" - _ "github.com/flyteorg/flyte/flytestdlib/cli/pflags" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" + + _ "github.com/flyteorg/flyte/flytestdlib/cli/pflags" ) diff --git a/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh b/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh index c7e5577ef3..9cd49959f4 100755 --- a/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh +++ b/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh @@ -19,6 +19,7 @@ tools=( "github.com/EngHabu/mockery/cmd/mockery" "github.com/flyteorg/flytestdlib/cli/pflags@latest" "github.com/golangci/golangci-lint/cmd/golangci-lint" + "github.com/daixiang0/gci" "github.com/alvaroloes/enumer" "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" ) diff --git a/flytepropeller/boilerplate/flyte/golang_test_targets/goimports b/flytepropeller/boilerplate/flyte/golang_test_targets/goimports index af1829036c..40f50d106e 100755 --- a/flytepropeller/boilerplate/flyte/golang_test_targets/goimports +++ b/flytepropeller/boilerplate/flyte/golang_test_targets/goimports @@ -6,3 +6,4 @@ # TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/client/*" -not -path "./boilerplate/*") +gci write -s standard -s default -s "prefix(github.com/flyteorg)" --custom-order --skip-generated . diff --git a/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml b/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml index 5d53f35295..7f4dbc80e8 100644 --- a/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml +++ b/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml @@ -13,6 +13,7 @@ linters: - deadcode - errcheck - gas + - gci - goconst - goimports - golint @@ -28,3 +29,12 @@ linters: - unparam - unused - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true diff --git a/flytepropeller/cmd/controller/cmd/init_certs.go b/flytepropeller/cmd/controller/cmd/init_certs.go index 588984ffd6..17c68ef514 100644 --- a/flytepropeller/cmd/controller/cmd/init_certs.go +++ b/flytepropeller/cmd/controller/cmd/init_certs.go @@ -3,13 +3,11 @@ package cmd import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/spf13/cobra" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook" - - "github.com/spf13/cobra" + webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) // initCertsCmd initializes x509 TLS Certificates and saves them to a secret. diff --git a/flytepropeller/cmd/controller/cmd/root.go b/flytepropeller/cmd/controller/cmd/root.go index 7547418a71..1381b8180e 100644 --- a/flytepropeller/cmd/controller/cmd/root.go +++ b/flytepropeller/cmd/controller/cmd/root.go @@ -8,11 +8,21 @@ import ( "os" "runtime" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "golang.org/x/sync/errgroup" + "k8s.io/client-go/rest" + "k8s.io/klog" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/metrics" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller" config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/signals" - "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/flyteorg/flyte/flytestdlib/contextutils" @@ -21,21 +31,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/version" - - "github.com/prometheus/client_golang/prometheus/promhttp" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" - - "golang.org/x/sync/errgroup" - - "k8s.io/client-go/rest" - "k8s.io/klog" - - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/metrics" ) const ( diff --git a/flytepropeller/cmd/controller/cmd/webhook.go b/flytepropeller/cmd/controller/cmd/webhook.go index a6b9be0492..dd0528e806 100644 --- a/flytepropeller/cmd/controller/cmd/webhook.go +++ b/flytepropeller/cmd/controller/cmd/webhook.go @@ -3,28 +3,24 @@ package cmd import ( "context" + "github.com/spf13/cobra" + "golang.org/x/sync/errgroup" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/signals" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook" webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/profutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/spf13/cobra" - - "golang.org/x/sync/errgroup" - - "k8s.io/client-go/rest" - - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" ) var webhookCmd = &cobra.Command{ diff --git a/flytepropeller/cmd/controller/main.go b/flytepropeller/cmd/controller/main.go index ac30364d30..0f94b9b9fb 100644 --- a/flytepropeller/cmd/controller/main.go +++ b/flytepropeller/cmd/controller/main.go @@ -1,9 +1,8 @@ package main import ( - _ "github.com/flyteorg/flyte/flytepropeller/plugins" - "github.com/flyteorg/flyte/flytepropeller/cmd/controller/cmd" + _ "github.com/flyteorg/flyte/flytepropeller/plugins" ) func main() { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/compile.go b/flytepropeller/cmd/kubectl-flyte/cmd/compile.go index eec5efaf30..056b546849 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/compile.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/compile.go @@ -5,12 +5,13 @@ import ( "io/ioutil" "os" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/pkg/errors" - "github.com/spf13/cobra" ) type CompileOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/create.go b/flytepropeller/cmd/kubectl-flyte/cmd/create.go index 4fcdbec620..24688ef7e2 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/create.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/create.go @@ -7,11 +7,12 @@ import ( "fmt" "io/ioutil" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/ghodss/yaml" "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + "github.com/pkg/errors" + "github.com/spf13/cobra" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -19,9 +20,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" - - "github.com/pkg/errors" - "github.com/spf13/cobra" ) const ( diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go b/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go index e506a272cd..5036201482 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go @@ -9,15 +9,15 @@ import ( "testing" "github.com/ghodss/yaml" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" ) var update = flag.Bool("update", false, "Update .golden files") diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/delete.go b/flytepropeller/cmd/kubectl-flyte/cmd/delete.go index 13dfb63eeb..2f70cfa6ba 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/delete.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/delete.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller" "github.com/spf13/cobra" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller" ) type DeleteOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/get.go b/flytepropeller/cmd/kubectl-flyte/cmd/get.go index 765f1e433e..8609a2b62f 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/get.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/get.go @@ -7,13 +7,13 @@ import ( "strings" gotree "github.com/DiSiqueira/GoTree" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/spf13/cobra" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/cmd/kubectl-flyte/cmd/printers" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type GetOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go b/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go index b1d5e2936f..aaaad8282b 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go @@ -9,9 +9,9 @@ import ( gotree "github.com/DiSiqueira/GoTree" "github.com/fatih/color" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" ) diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/root.go b/flytepropeller/cmd/kubectl-flyte/cmd/root.go index ebc642c15f..4bfabe47b5 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/root.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/root.go @@ -8,16 +8,16 @@ import ( "runtime" "time" - "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/version" + "github.com/spf13/cobra" "github.com/spf13/pflag" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" flyteclient "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned" - "github.com/spf13/cobra" + "github.com/flyteorg/flyte/flytestdlib/config/viper" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/version" ) func init() { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go b/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go index 6b6a3e82ad..9b1c439e0a 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" "github.com/spf13/cobra" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" ) type VisualizeOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/main.go b/flytepropeller/cmd/kubectl-flyte/main.go index 9fdaab95fe..7d5a8c4540 100644 --- a/flytepropeller/cmd/kubectl-flyte/main.go +++ b/flytepropeller/cmd/kubectl-flyte/main.go @@ -4,10 +4,11 @@ import ( "fmt" "os" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + "github.com/flyteorg/flyte/flytepropeller/cmd/kubectl-flyte/cmd" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" ) func init() { diff --git a/flytepropeller/cmd/manager/cmd/root.go b/flytepropeller/cmd/manager/cmd/root.go index 2b8aeae5cb..dc9dd3fffd 100644 --- a/flytepropeller/cmd/manager/cmd/root.go +++ b/flytepropeller/cmd/manager/cmd/root.go @@ -7,24 +7,22 @@ import ( "os" "runtime" - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/profutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/version" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog" "github.com/flyteorg/flyte/flytepropeller/manager" managerConfig "github.com/flyteorg/flyte/flytepropeller/manager/config" propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/signals" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog" + "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/profutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/version" ) const ( diff --git a/flytepropeller/events/admin_eventsink.go b/flytepropeller/events/admin_eventsink.go index c3ea312a37..beeb3d35f7 100644 --- a/flytepropeller/events/admin_eventsink.go +++ b/flytepropeller/events/admin_eventsink.go @@ -4,8 +4,10 @@ import ( "context" "fmt" - admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" + "github.com/golang/protobuf/proto" + "golang.org/x/time/rate" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" @@ -13,8 +15,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/fastcheck" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/golang/protobuf/proto" - "golang.org/x/time/rate" ) type adminEventSink struct { diff --git a/flytepropeller/events/admin_eventsink_integration_test.go b/flytepropeller/events/admin_eventsink_integration_test.go index adcdabad57..d29e4e032a 100644 --- a/flytepropeller/events/admin_eventsink_integration_test.go +++ b/flytepropeller/events/admin_eventsink_integration_test.go @@ -12,13 +12,13 @@ import ( "testing" "time" + "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/golang/protobuf/ptypes" ) var ( diff --git a/flytepropeller/events/admin_eventsink_test.go b/flytepropeller/events/admin_eventsink_test.go index fa8b56b39b..c13b7ad47f 100644 --- a/flytepropeller/events/admin_eventsink_test.go +++ b/flytepropeller/events/admin_eventsink_test.go @@ -5,18 +5,19 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/errors" - fastcheckMocks "github.com/flyteorg/flyte/flytestdlib/fastcheck/mocks" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/errors" + fastcheckMocks "github.com/flyteorg/flyte/flytestdlib/fastcheck/mocks" ) var ( diff --git a/flytepropeller/events/errors/errors.go b/flytepropeller/events/errors/errors.go index a956b8ecce..879b8b07d7 100644 --- a/flytepropeller/events/errors/errors.go +++ b/flytepropeller/events/errors/errors.go @@ -6,10 +6,11 @@ import ( "fmt" "strings" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type ErrorCode string diff --git a/flytepropeller/events/errors/errors_test.go b/flytepropeller/events/errors/errors_test.go index e8df4c2bf1..745acea474 100644 --- a/flytepropeller/events/errors/errors_test.go +++ b/flytepropeller/events/errors/errors_test.go @@ -4,10 +4,11 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) type testErrorWithReason struct { diff --git a/flytepropeller/events/event_recorder.go b/flytepropeller/events/event_recorder.go index da2dc61013..8c12d0d501 100644 --- a/flytepropeller/events/event_recorder.go +++ b/flytepropeller/events/event_recorder.go @@ -5,12 +5,13 @@ import ( "fmt" "time" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/golang/protobuf/proto" ) const MaxErrorMessageLength = 104857600 //100KB diff --git a/flytepropeller/events/event_recorder_test.go b/flytepropeller/events/event_recorder_test.go index b5f7aa8d4e..2b633b72ff 100644 --- a/flytepropeller/events/event_recorder_test.go +++ b/flytepropeller/events/event_recorder_test.go @@ -5,14 +5,14 @@ import ( "math/rand" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/events/mocks" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/stretchr/testify/assert" ) var ( diff --git a/flytepropeller/events/eventsink_test.go b/flytepropeller/events/eventsink_test.go index 497605fe85..63732d9831 100644 --- a/flytepropeller/events/eventsink_test.go +++ b/flytepropeller/events/eventsink_test.go @@ -9,10 +9,11 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" ) func TestFileEvent(t *testing.T) { diff --git a/flytepropeller/events/local_eventsink.go b/flytepropeller/events/local_eventsink.go index 3dc4cfe897..40a505d62b 100644 --- a/flytepropeller/events/local_eventsink.go +++ b/flytepropeller/events/local_eventsink.go @@ -7,9 +7,10 @@ import ( "os" "sync" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" ) type localSink struct { diff --git a/flytepropeller/events/node_event_recorder.go b/flytepropeller/events/node_event_recorder.go index cb856fcbac..8beb488ce6 100644 --- a/flytepropeller/events/node_event_recorder.go +++ b/flytepropeller/events/node_event_recorder.go @@ -4,16 +4,16 @@ import ( "context" "strings" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) //go:generate mockery -all -output=mocks -case=underscore diff --git a/flytepropeller/events/node_event_recorder_test.go b/flytepropeller/events/node_event_recorder_test.go index 4234108d62..5d2025b525 100644 --- a/flytepropeller/events/node_event_recorder_test.go +++ b/flytepropeller/events/node_event_recorder_test.go @@ -4,17 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/golang/protobuf/proto" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) func getReferenceNodeEv() *event.NodeExecutionEvent { diff --git a/flytepropeller/events/task_event_recorder.go b/flytepropeller/events/task_event_recorder.go index f2ca2dc666..8b531ae85f 100644 --- a/flytepropeller/events/task_event_recorder.go +++ b/flytepropeller/events/task_event_recorder.go @@ -4,16 +4,16 @@ import ( "context" "strings" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) //go:generate mockery -all -output=mocks -case=underscore diff --git a/flytepropeller/events/task_event_recorder_test.go b/flytepropeller/events/task_event_recorder_test.go index 3e622efdc9..be8d2b1ff2 100644 --- a/flytepropeller/events/task_event_recorder_test.go +++ b/flytepropeller/events/task_event_recorder_test.go @@ -4,17 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/golang/protobuf/proto" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) var taskID = &core.Identifier{ diff --git a/flytepropeller/events/workflow_event_recorder.go b/flytepropeller/events/workflow_event_recorder.go index b898dc9b98..f0f48a7f9d 100644 --- a/flytepropeller/events/workflow_event_recorder.go +++ b/flytepropeller/events/workflow_event_recorder.go @@ -4,16 +4,16 @@ import ( "context" "strings" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) //go:generate mockery -all -output=mocks -case=underscore diff --git a/flytepropeller/events/workflow_event_recorder_test.go b/flytepropeller/events/workflow_event_recorder_test.go index 83de680cdf..010c24bf5d 100644 --- a/flytepropeller/events/workflow_event_recorder_test.go +++ b/flytepropeller/events/workflow_event_recorder_test.go @@ -4,17 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/golang/protobuf/proto" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) func getReferenceWorkflowEv() *event.WorkflowExecutionEvent { diff --git a/flytepropeller/manager/manager.go b/flytepropeller/manager/manager.go index e8ea79a435..566c5c3b2d 100644 --- a/flytepropeller/manager/manager.go +++ b/flytepropeller/manager/manager.go @@ -5,28 +5,23 @@ import ( "fmt" "time" - managerConfig "github.com/flyteorg/flyte/flytepropeller/manager/config" - "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" - propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - leader "github.com/flyteorg/flyte/flytepropeller/pkg/leaderelection" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - - stderrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/imdario/mergo" - "github.com/prometheus/client_golang/prometheus" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/leaderelection" + + managerConfig "github.com/flyteorg/flyte/flytepropeller/manager/config" + "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" + propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + leader "github.com/flyteorg/flyte/flytepropeller/pkg/leaderelection" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + stderrors "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flytepropeller/manager/manager_test.go b/flytepropeller/manager/manager_test.go index 08f3edb1dd..5b1c061151 100644 --- a/flytepropeller/manager/manager_test.go +++ b/flytepropeller/manager/manager_test.go @@ -5,18 +5,16 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" - "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy/mocks" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" + + "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" + "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) var ( diff --git a/flytepropeller/manager/shardstrategy/environment.go b/flytepropeller/manager/shardstrategy/environment.go index e0b35d3c48..92bb6cacb1 100644 --- a/flytepropeller/manager/shardstrategy/environment.go +++ b/flytepropeller/manager/shardstrategy/environment.go @@ -3,9 +3,9 @@ package shardstrategy import ( "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - v1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" ) // EnvironmentShardStrategy assigns either project or domain identifiers to individual diff --git a/flytepropeller/manager/shardstrategy/hash.go b/flytepropeller/manager/shardstrategy/hash.go index 357e49d303..3ebdcd5419 100644 --- a/flytepropeller/manager/shardstrategy/hash.go +++ b/flytepropeller/manager/shardstrategy/hash.go @@ -3,10 +3,10 @@ package shardstrategy import ( "fmt" + v1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - - v1 "k8s.io/api/core/v1" ) // HashShardStrategy evenly assigns disjoint keyspace responsibilities over a collection of pods. diff --git a/flytepropeller/manager/shardstrategy/shard_strategy.go b/flytepropeller/manager/shardstrategy/shard_strategy.go index 46d8567dc1..6792a23b96 100644 --- a/flytepropeller/manager/shardstrategy/shard_strategy.go +++ b/flytepropeller/manager/shardstrategy/shard_strategy.go @@ -7,10 +7,10 @@ import ( "fmt" "hash/fnv" + v1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flytepropeller/manager/config" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - - v1 "k8s.io/api/core/v1" ) //go:generate mockery -name ShardStrategy -case=underscore diff --git a/flytepropeller/manager/shardstrategy/shard_strategy_test.go b/flytepropeller/manager/shardstrategy/shard_strategy_test.go index 5be9cfddcf..e33c7be3e0 100644 --- a/flytepropeller/manager/shardstrategy/shard_strategy_test.go +++ b/flytepropeller/manager/shardstrategy/shard_strategy_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1 "k8s.io/api/core/v1" ) diff --git a/flytepropeller/pkg/apis/flyteworkflow/crd.go b/flytepropeller/pkg/apis/flyteworkflow/crd.go index a78a949013..9b8b71f00d 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/crd.go +++ b/flytepropeller/pkg/apis/flyteworkflow/crd.go @@ -4,7 +4,6 @@ import ( "fmt" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go index 65c794335c..07a493b8be 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type Error struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go index 6defc55bf1..d5adf91d77 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go @@ -5,9 +5,10 @@ import ( "io/ioutil" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/stretchr/testify/assert" ) func TestMarshalUnMarshal_BranchTask(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go index e505ac56e9..39ec19c165 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) // Wrapper around core.Execution error. Execution Error has a protobuf enum and hence needs to be wrapped by custom marshaller diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go index 9250de9db8..30cd9fa0de 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go @@ -1,8 +1,9 @@ package v1alpha1 import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // This contains an OutputLocationPrefix. When running against AWS, this should be something of the form diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go index ab0633742f..b3751b4268 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go @@ -1,10 +1,11 @@ package v1alpha1 import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "testing" + "github.com/stretchr/testify/assert" - "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func TestRawOutputConfig(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go index 3610fadce2..a7ffa799fa 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type ConditionKind string diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go index 1f07927804..7d6a3622c8 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type Identifier struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go index ab9562e4a3..b3d744bd77 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go @@ -7,7 +7,6 @@ import ( "time" "github.com/golang/protobuf/proto" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go index 6332762742..9fb891d01a 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go @@ -9,12 +9,12 @@ import ( "strconv" "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type MutableStruct struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go index 5618d8ffb6..45c299687a 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go @@ -6,12 +6,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestIsPhaseTerminal(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go index d061408d76..8a22cae974 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go @@ -4,10 +4,11 @@ import ( "bytes" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" typesv1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) var marshaler = jsonpb.Marshaler{} diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go index 8c5ea987a7..065b8a8852 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go @@ -1,10 +1,11 @@ package v1alpha1 import ( - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow" ) const FlyteWorkflowKind = "flyteworkflow" diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go index f480ee3b2e..23b6b2cb47 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type TaskSpec struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go index 2d1ab15dc6..0bc1240c95 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go @@ -4,8 +4,9 @@ import ( "encoding/json" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) func TestTaskSpec(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go index 8144c8619b..225a49ac3f 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go @@ -5,14 +5,13 @@ import ( "context" "encoding/json" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "k8s.io/apimachinery/pkg/types" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/storage" ) // Defines a non-configurable keyspace size for shard keys. This needs to be a small value because we use label diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go index 1c69721ffd..db6175cadf 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go @@ -4,11 +4,11 @@ import ( "context" "strconv" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const maxMessageSize = 1024 diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go index 001d3abf57..6e72b95ec7 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go @@ -5,10 +5,11 @@ import ( "io/ioutil" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" "k8s.io/apimachinery/pkg/util/sets" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) func TestMarshalUnmarshal_Connections(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/admin_test.go b/flytepropeller/pkg/compiler/admin_test.go index 484a75ebff..2545d293ee 100644 --- a/flytepropeller/pkg/compiler/admin_test.go +++ b/flytepropeller/pkg/compiler/admin_test.go @@ -3,10 +3,11 @@ package compiler import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) var launchPlanIdentifier = core.Identifier{ diff --git a/flytepropeller/pkg/compiler/common/index.go b/flytepropeller/pkg/compiler/common/index.go index b6f4c7c023..01344e46a4 100644 --- a/flytepropeller/pkg/compiler/common/index.go +++ b/flytepropeller/pkg/compiler/common/index.go @@ -1,9 +1,10 @@ package common import ( + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/util/sets" ) // Defines an index of nodebuilders based on the id. diff --git a/flytepropeller/pkg/compiler/requirements_test.go b/flytepropeller/pkg/compiler/requirements_test.go index 1a2681d724..5eeb2e6964 100644 --- a/flytepropeller/pkg/compiler/requirements_test.go +++ b/flytepropeller/pkg/compiler/requirements_test.go @@ -3,8 +3,9 @@ package compiler import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestGetRequirements(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/task_compiler.go b/flytepropeller/pkg/compiler/task_compiler.go index b6bea171f8..4d8fea46db 100644 --- a/flytepropeller/pkg/compiler/task_compiler.go +++ b/flytepropeller/pkg/compiler/task_compiler.go @@ -3,14 +3,14 @@ package compiler import ( "fmt" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/validation" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/api/resource" ) func validateResource(resourceName core.Resources_ResourceName, resourceVal string, errs errors.CompileErrors) (ok bool) { diff --git a/flytepropeller/pkg/compiler/task_compiler_test.go b/flytepropeller/pkg/compiler/task_compiler_test.go index b16d71d94c..bf4949a1a9 100644 --- a/flytepropeller/pkg/compiler/task_compiler_test.go +++ b/flytepropeller/pkg/compiler/task_compiler_test.go @@ -3,13 +3,12 @@ package compiler import ( "testing" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" ) func MakeResource(name core.Resources_ResourceName, v string) *core.Resources_ResourceEntry { diff --git a/flytepropeller/pkg/compiler/test/compiler_test.go b/flytepropeller/pkg/compiler/test/compiler_test.go index b06a367c79..e2dd63431e 100644 --- a/flytepropeller/pkg/compiler/test/compiler_test.go +++ b/flytepropeller/pkg/compiler/test/compiler_test.go @@ -11,25 +11,21 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - - "k8s.io/apimachinery/pkg/util/sets" - - "github.com/go-test/deep" - "github.com/ghodss/yaml" + "github.com/go-test/deep" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" ) var update = flag.Bool("update", false, "Update .golden files") diff --git a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go index 8ec20ef840..2d967c560e 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go @@ -1,11 +1,12 @@ package k8s import ( + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" - "k8s.io/apimachinery/pkg/util/sets" ) func validateInputs(nodeID common.NodeID, iface *core.TypedInterface, inputs core.LiteralMap, errs errors.CompileErrors) (ok bool) { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/node.go b/flytepropeller/pkg/compiler/transformers/k8s/node.go index 7ab6502946..2ac06ebd89 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/node.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/node.go @@ -3,13 +3,14 @@ package k8s import ( "strings" + "github.com/go-test/deep" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/go-test/deep" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Gets the compiled subgraph if this node contains an inline-declared coreWorkflow. Otherwise nil. diff --git a/flytepropeller/pkg/compiler/transformers/k8s/node_test.go b/flytepropeller/pkg/compiler/transformers/k8s/node_test.go index 4ba9010c96..f2d6c79494 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/node_test.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/node_test.go @@ -4,17 +4,14 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/durationpb" + "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - - "github.com/stretchr/testify/assert" - - "google.golang.org/protobuf/types/known/durationpb" - - "k8s.io/apimachinery/pkg/api/resource" ) func createNodeWithTask() *core.Node { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/utils.go b/flytepropeller/pkg/compiler/transformers/k8s/utils.go index 963eefa614..06884f4b75 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/utils.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/utils.go @@ -3,11 +3,11 @@ package k8s import ( "math" + "github.com/golang/protobuf/ptypes" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/golang/protobuf/ptypes" ) func refInt(i int) *int { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go b/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go index 46e092a29e..d2d9b10866 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go @@ -5,9 +5,9 @@ import ( "github.com/go-test/deep" _struct "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestComputeRetryStrategy(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/workflow.go b/flytepropeller/pkg/compiler/transformers/k8s/workflow.go index 3817cb7762..2421ddf9bb 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/workflow.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/workflow.go @@ -6,12 +6,13 @@ import ( "hash/fnv" "strings" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( diff --git a/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go b/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go index 362fee8990..ae3b82b8b9 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go @@ -5,13 +5,14 @@ import ( "io/ioutil" "testing" + "github.com/golang/protobuf/jsonpb" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/golang/protobuf/jsonpb" - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/util/sets" ) func createSampleMockWorkflow() *mockWorkflow { diff --git a/flytepropeller/pkg/compiler/utils.go b/flytepropeller/pkg/compiler/utils.go index 19da73a92c..76c372c9e7 100644 --- a/flytepropeller/pkg/compiler/utils.go +++ b/flytepropeller/pkg/compiler/utils.go @@ -1,9 +1,10 @@ package compiler import ( + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" - "k8s.io/apimachinery/pkg/util/sets" ) func toInterfaceProviderMap(tasks []common.InterfaceProvider) map[string]common.InterfaceProvider { diff --git a/flytepropeller/pkg/compiler/validators/bindings.go b/flytepropeller/pkg/compiler/validators/bindings.go index 7c6f0e60e6..d9ec6b6ae2 100644 --- a/flytepropeller/pkg/compiler/validators/bindings.go +++ b/flytepropeller/pkg/compiler/validators/bindings.go @@ -3,12 +3,12 @@ package validators import ( "reflect" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/typing" + "k8s.io/apimachinery/pkg/util/sets" flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/typing" ) func validateBinding(w c.WorkflowBuilder, nodeID c.NodeID, nodeParam string, binding *flyte.BindingData, diff --git a/flytepropeller/pkg/compiler/validators/bindings_test.go b/flytepropeller/pkg/compiler/validators/bindings_test.go index 9d90e1c843..30f0bee2c6 100644 --- a/flytepropeller/pkg/compiler/validators/bindings_test.go +++ b/flytepropeller/pkg/compiler/validators/bindings_test.go @@ -3,15 +3,14 @@ package validators import ( "testing" - c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) // LiteralToBinding converts a literal to a non-promise binding data. diff --git a/flytepropeller/pkg/compiler/validators/branch.go b/flytepropeller/pkg/compiler/validators/branch.go index c7aabc19cf..386f1cecda 100644 --- a/flytepropeller/pkg/compiler/validators/branch.go +++ b/flytepropeller/pkg/compiler/validators/branch.go @@ -1,10 +1,11 @@ package validators import ( + "k8s.io/apimachinery/pkg/util/sets" + flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/util/sets" ) func validateBranchInterface(w c.WorkflowBuilder, node c.NodeBuilder, errs errors.CompileErrors) (iface *flyte.TypedInterface, ok bool) { diff --git a/flytepropeller/pkg/compiler/validators/branch_test.go b/flytepropeller/pkg/compiler/validators/branch_test.go index 537f0d9b4f..05be9ab510 100644 --- a/flytepropeller/pkg/compiler/validators/branch_test.go +++ b/flytepropeller/pkg/compiler/validators/branch_test.go @@ -3,12 +3,12 @@ package validators import ( "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/stretchr/testify/assert" ) func createBooleanOperand(val bool) *core.Operand { diff --git a/flytepropeller/pkg/compiler/validators/interface_test.go b/flytepropeller/pkg/compiler/validators/interface_test.go index 9a2147d9b1..b3394ea8db 100644 --- a/flytepropeller/pkg/compiler/validators/interface_test.go +++ b/flytepropeller/pkg/compiler/validators/interface_test.go @@ -5,17 +5,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/types/known/durationpb" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "google.golang.org/protobuf/types/known/durationpb" ) func TestValidateInterface(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/validators/node_test.go b/flytepropeller/pkg/compiler/validators/node_test.go index d2368ac850..3982b71344 100644 --- a/flytepropeller/pkg/compiler/validators/node_test.go +++ b/flytepropeller/pkg/compiler/validators/node_test.go @@ -3,13 +3,12 @@ package validators import ( "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/stretchr/testify/assert" ) func TestValidateBranchNode(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/validators/typing.go b/flytepropeller/pkg/compiler/validators/typing.go index c88c062430..388cb32123 100644 --- a/flytepropeller/pkg/compiler/validators/typing.go +++ b/flytepropeller/pkg/compiler/validators/typing.go @@ -3,8 +3,9 @@ package validators import ( "strings" - flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" structpb "github.com/golang/protobuf/ptypes/struct" + + flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type typeChecker interface { diff --git a/flytepropeller/pkg/compiler/validators/typing_test.go b/flytepropeller/pkg/compiler/validators/typing_test.go index e920e39774..17e55b1e0a 100644 --- a/flytepropeller/pkg/compiler/validators/typing_test.go +++ b/flytepropeller/pkg/compiler/validators/typing_test.go @@ -3,9 +3,10 @@ package validators import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" structpb "github.com/golang/protobuf/ptypes/struct" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestSimpleLiteralCasting(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/validators/utils.go b/flytepropeller/pkg/compiler/validators/utils.go index 462cb94905..8c4cda12ce 100644 --- a/flytepropeller/pkg/compiler/validators/utils.go +++ b/flytepropeller/pkg/compiler/validators/utils.go @@ -4,12 +4,12 @@ import ( "fmt" "strings" - "golang.org/x/exp/slices" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/proto" "golang.org/x/exp/maps" + "golang.org/x/exp/slices" "k8s.io/apimachinery/pkg/util/sets" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func containsBindingByVariableName(bindings []*core.Binding, name string) (found bool) { diff --git a/flytepropeller/pkg/compiler/validators/utils_test.go b/flytepropeller/pkg/compiler/validators/utils_test.go index ae320e7855..a5e5d3f23c 100644 --- a/flytepropeller/pkg/compiler/validators/utils_test.go +++ b/flytepropeller/pkg/compiler/validators/utils_test.go @@ -3,9 +3,10 @@ package validators import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestLiteralTypeForLiterals(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/workflow_compiler.go b/flytepropeller/pkg/compiler/workflow_compiler.go index 200997aedb..07fc7bf938 100644 --- a/flytepropeller/pkg/compiler/workflow_compiler.go +++ b/flytepropeller/pkg/compiler/workflow_compiler.go @@ -34,14 +34,14 @@ package compiler import ( "strings" + // #noSA1019 + "github.com/golang/protobuf/proto" + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" v "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" - - // #noSA1019 - "github.com/golang/protobuf/proto" - "k8s.io/apimachinery/pkg/util/sets" ) // Updates workflows and tasks references to reflect the needed ones for this workflow (ignoring subworkflows) diff --git a/flytepropeller/pkg/compiler/workflow_compiler_test.go b/flytepropeller/pkg/compiler/workflow_compiler_test.go index 08ab6f3ad7..e9e01d36c2 100644 --- a/flytepropeller/pkg/compiler/workflow_compiler_test.go +++ b/flytepropeller/pkg/compiler/workflow_compiler_test.go @@ -5,16 +5,16 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" v "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/util/sets" ) func createEmptyVariableMap() *core.VariableMap { diff --git a/flytepropeller/pkg/controller/completed_workflows.go b/flytepropeller/pkg/controller/completed_workflows.go index 53d4fae69b..32f70c9be3 100644 --- a/flytepropeller/pkg/controller/completed_workflows.go +++ b/flytepropeller/pkg/controller/completed_workflows.go @@ -4,8 +4,9 @@ import ( "strconv" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) const ( diff --git a/flytepropeller/pkg/controller/completed_workflows_test.go b/flytepropeller/pkg/controller/completed_workflows_test.go index be78be665d..a069a7b55d 100644 --- a/flytepropeller/pkg/controller/completed_workflows_test.go +++ b/flytepropeller/pkg/controller/completed_workflows_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) func TestIgnoreCompletedWorkflowsLabelSelector(t *testing.T) { diff --git a/flytepropeller/pkg/controller/composite_workqueue.go b/flytepropeller/pkg/controller/composite_workqueue.go index b60d0ea79b..56780c6706 100644 --- a/flytepropeller/pkg/controller/composite_workqueue.go +++ b/flytepropeller/pkg/controller/composite_workqueue.go @@ -4,13 +4,13 @@ import ( "context" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/workqueue" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) // A CompositeWorkQueue can be used in cases where the work is enqueued by two sources. It can be enqueued by either diff --git a/flytepropeller/pkg/controller/composite_workqueue_test.go b/flytepropeller/pkg/controller/composite_workqueue_test.go index 1680131f47..b52ade5443 100644 --- a/flytepropeller/pkg/controller/composite_workqueue_test.go +++ b/flytepropeller/pkg/controller/composite_workqueue_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/stretchr/testify/assert" + config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) func TestNewCompositeWorkQueue(t *testing.T) { diff --git a/flytepropeller/pkg/controller/config/config.go b/flytepropeller/pkg/controller/config/config.go index f7d898634b..10a83cd2fc 100644 --- a/flytepropeller/pkg/controller/config/config.go +++ b/flytepropeller/pkg/controller/config/config.go @@ -36,9 +36,10 @@ package config import ( "time" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/contextutils" - "k8s.io/apimachinery/pkg/types" ) //go:generate pflags Config --default-var=defaultConfig diff --git a/flytepropeller/pkg/controller/controller.go b/flytepropeller/pkg/controller/controller.go index 85d6850325..be26404a98 100644 --- a/flytepropeller/pkg/controller/controller.go +++ b/flytepropeller/pkg/controller/controller.go @@ -9,12 +9,27 @@ import ( "runtime/pprof" "time" + grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" + "github.com/pkg/errors" + "github.com/prometheus/client_golang/prometheus" + "google.golang.org/grpc" + _ "google.golang.org/grpc/balancer/roundrobin" //nolint + apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + apierrors "k8s.io/apimachinery/pkg/api/errors" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/util/clock" + k8sInformers "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/tools/leaderelection" + "k8s.io/client-go/tools/record" + "sigs.k8s.io/controller-runtime/pkg/manager" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" flyteK8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flytepropeller/events" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -34,37 +49,12 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore" leader "github.com/flyteorg/flyte/flytepropeller/pkg/leaderelection" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/contextutils" stdErrs "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" - - "github.com/pkg/errors" - - "github.com/prometheus/client_golang/prometheus" - - "google.golang.org/grpc" - _ "google.golang.org/grpc/balancer/roundrobin" //nolint - - apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/clock" - - k8sInformers "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/leaderelection" - "k8s.io/client-go/tools/record" - - "sigs.k8s.io/controller-runtime/pkg/manager" ) const ( diff --git a/flytepropeller/pkg/controller/controller_test.go b/flytepropeller/pkg/controller/controller_test.go index 5f67668dcc..6cb94e4d73 100644 --- a/flytepropeller/pkg/controller/controller_test.go +++ b/flytepropeller/pkg/controller/controller_test.go @@ -6,17 +6,16 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/labels" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/labels" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) var wfs = []*v1alpha1.FlyteWorkflow{ diff --git a/flytepropeller/pkg/controller/executors/kube.go b/flytepropeller/pkg/controller/executors/kube.go index d7bf3db776..7dc62135b6 100644 --- a/flytepropeller/pkg/controller/executors/kube.go +++ b/flytepropeller/pkg/controller/executors/kube.go @@ -4,13 +4,12 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/fastcheck" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/flyteorg/flyte/flytestdlib/fastcheck" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) //go:generate mockery -name Client -case=underscore diff --git a/flytepropeller/pkg/controller/executors/kube_test.go b/flytepropeller/pkg/controller/executors/kube_test.go index 8b2aa4d626..bcaa64ff6f 100644 --- a/flytepropeller/pkg/controller/executors/kube_test.go +++ b/flytepropeller/pkg/controller/executors/kube_test.go @@ -6,13 +6,14 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func TestIdFromObject(t *testing.T) { diff --git a/flytepropeller/pkg/controller/garbage_collector.go b/flytepropeller/pkg/controller/garbage_collector.go index 0b5e9094eb..55b026ecb0 100644 --- a/flytepropeller/pkg/controller/garbage_collector.go +++ b/flytepropeller/pkg/controller/garbage_collector.go @@ -3,20 +3,19 @@ package controller import ( "context" "runtime/pprof" + "strings" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "strings" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/clock" + corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/typed/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/clock" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" ) type gcMetrics struct { diff --git a/flytepropeller/pkg/controller/garbage_collector_test.go b/flytepropeller/pkg/controller/garbage_collector_test.go index c972bc4c6a..9fb72154c7 100644 --- a/flytepropeller/pkg/controller/garbage_collector_test.go +++ b/flytepropeller/pkg/controller/garbage_collector_test.go @@ -7,16 +7,16 @@ import ( "testing" "time" - config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/typed/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/stretchr/testify/assert" corev1Types "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/clock" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/typed/flyteworkflow/v1alpha1" + config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestNewGarbageCollector(t *testing.T) { diff --git a/flytepropeller/pkg/controller/handler.go b/flytepropeller/pkg/controller/handler.go index 9f3f8d67c6..7a01181e2a 100644 --- a/flytepropeller/pkg/controller/handler.go +++ b/flytepropeller/pkg/controller/handler.go @@ -7,23 +7,21 @@ import ( "runtime/debug" "time" + "github.com/prometheus/client_golang/prometheus" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/prometheus/client_golang/prometheus" ) // TODO Lets move everything to use controller runtime diff --git a/flytepropeller/pkg/controller/handler_test.go b/flytepropeller/pkg/controller/handler_test.go index 96ceb34350..ce1ca63818 100644 --- a/flytepropeller/pkg/controller/handler_test.go +++ b/flytepropeller/pkg/controller/handler_test.go @@ -6,25 +6,22 @@ import ( "testing" "time" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - eventErrors "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" workflowErrors "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflow/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore/mocks" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" storagemocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type mockExecutor struct { diff --git a/flytepropeller/pkg/controller/nodes/array/event_recorder.go b/flytepropeller/pkg/controller/nodes/array/event_recorder.go index d202fa3fbd..55cbbce89f 100644 --- a/flytepropeller/pkg/controller/nodes/array/event_recorder.go +++ b/flytepropeller/pkg/controller/nodes/array/event_recorder.go @@ -5,13 +5,14 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes" + idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/golang/protobuf/ptypes" ) type arrayEventRecorder interface { diff --git a/flytepropeller/pkg/controller/nodes/array/handler.go b/flytepropeller/pkg/controller/nodes/array/handler.go index b24e513857..35076d0a97 100644 --- a/flytepropeller/pkg/controller/nodes/array/handler.go +++ b/flytepropeller/pkg/controller/nodes/array/handler.go @@ -7,11 +7,9 @@ import ( "strconv" idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - "github.com/flyteorg/flyte/flytepropeller/events" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" @@ -22,7 +20,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" diff --git a/flytepropeller/pkg/controller/nodes/array/handler_test.go b/flytepropeller/pkg/controller/nodes/array/handler_test.go index 5dd2b1f62d..f9086218c2 100644 --- a/flytepropeller/pkg/controller/nodes/array/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/array/handler_test.go @@ -5,9 +5,13 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" eventmocks "github.com/flyteorg/flyte/flytepropeller/events/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" @@ -20,18 +24,11 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" recoverymocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go b/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go index d5523253af..6d0cfd3bfb 100644 --- a/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go +++ b/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" diff --git a/flytepropeller/pkg/controller/nodes/array/utils_test.go b/flytepropeller/pkg/controller/nodes/array/utils_test.go index eed23b248b..fde3d0fa80 100644 --- a/flytepropeller/pkg/controller/nodes/array/utils_test.go +++ b/flytepropeller/pkg/controller/nodes/array/utils_test.go @@ -3,9 +3,9 @@ package array import ( "testing" - idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + + idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestAppendLiteral(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/branch/comparator_test.go b/flytepropeller/pkg/controller/nodes/branch/comparator_test.go index 5aaa5a105d..61da281c4b 100644 --- a/flytepropeller/pkg/controller/nodes/branch/comparator_test.go +++ b/flytepropeller/pkg/controller/nodes/branch/comparator_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestEvaluate_int(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/branch/evaluator.go b/flytepropeller/pkg/controller/nodes/branch/evaluator.go index b3f887617b..44dc8711e8 100644 --- a/flytepropeller/pkg/controller/nodes/branch/evaluator.go +++ b/flytepropeller/pkg/controller/nodes/branch/evaluator.go @@ -3,13 +3,13 @@ package branch import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ErrorCodeUserProvidedError = "UserProvidedError" diff --git a/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go b/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go index ca3d8203c1..45bb850358 100644 --- a/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go +++ b/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go @@ -5,15 +5,14 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) // Creates a ComparisonExpression, comparing 2 literals diff --git a/flytepropeller/pkg/controller/nodes/branch/handler.go b/flytepropeller/pkg/controller/nodes/branch/handler.go index 31efae470c..d2a4fcfa68 100644 --- a/flytepropeller/pkg/controller/nodes/branch/handler.go +++ b/flytepropeller/pkg/controller/nodes/branch/handler.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" @@ -13,7 +12,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" diff --git a/flytepropeller/pkg/controller/nodes/branch/handler_test.go b/flytepropeller/pkg/controller/nodes/branch/handler_test.go index a783c0a1bb..a194452ff5 100644 --- a/flytepropeller/pkg/controller/nodes/branch/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/branch/handler_test.go @@ -5,29 +5,27 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var eventConfig = &config.EventConfig{ diff --git a/flytepropeller/pkg/controller/nodes/cache.go b/flytepropeller/pkg/controller/nodes/cache.go index 9145d4eb95..136d070de4 100644 --- a/flytepropeller/pkg/controller/nodes/cache.go +++ b/flytepropeller/pkg/controller/nodes/cache.go @@ -5,27 +5,23 @@ import ( "strconv" "time" + "github.com/pkg/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" nodeserrors "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/pkg/errors" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // computeCatalogReservationOwnerID constructs a unique identifier which includes the nodes diff --git a/flytepropeller/pkg/controller/nodes/cache_test.go b/flytepropeller/pkg/controller/nodes/cache_test.go index 75145a2e60..b0c0a3a351 100644 --- a/flytepropeller/pkg/controller/nodes/cache_test.go +++ b/flytepropeller/pkg/controller/nodes/cache_test.go @@ -7,31 +7,26 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + catalogmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" executorsmocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" interfacesmocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - catalogmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "k8s.io/apimachinery/pkg/types" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/catalog/config.go b/flytepropeller/pkg/controller/nodes/catalog/config.go index 2d890ec824..2b0c484fb7 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/config.go +++ b/flytepropeller/pkg/controller/nodes/catalog/config.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flytestdlib/config" "google.golang.org/grpc" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/catalog/datacatalog" + "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate pflags Config --default-var defaultConfig diff --git a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go index e27e1a1103..717c65739f 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go +++ b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go @@ -6,22 +6,22 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/golang/protobuf/ptypes" grpcRetry "github.com/grpc-ecosystem/go-grpc-middleware/retry" grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/pkg/errors" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/golang/protobuf/ptypes" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/status" "k8s.io/apimachinery/pkg/util/uuid" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go index bce6f4e974..2c16420f8c 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go +++ b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go @@ -6,25 +6,23 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/clients/go/datacatalog/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" "github.com/google/uuid" "github.com/pkg/errors" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/golang/protobuf/ptypes" + "github.com/flyteorg/flyte/flyteidl/clients/go/datacatalog/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go index 7bca94e5f4..74277dcda0 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go +++ b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go @@ -6,11 +6,12 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/stretchr/testify/assert" ) // add test for raarranged Literal maps for input values diff --git a/flytepropeller/pkg/controller/nodes/common/utils.go b/flytepropeller/pkg/controller/nodes/common/utils.go index a88107638e..19714da3d5 100644 --- a/flytepropeller/pkg/controller/nodes/common/utils.go +++ b/flytepropeller/pkg/controller/nodes/common/utils.go @@ -4,7 +4,6 @@ import ( "strconv" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" ) diff --git a/flytepropeller/pkg/controller/nodes/common/utils_test.go b/flytepropeller/pkg/controller/nodes/common/utils_test.go index f185631617..0639605589 100644 --- a/flytepropeller/pkg/controller/nodes/common/utils_test.go +++ b/flytepropeller/pkg/controller/nodes/common/utils_test.go @@ -3,8 +3,9 @@ package common import ( "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) type ParentInfo struct { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go index cd804faf22..cbc5414e11 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go @@ -5,6 +5,8 @@ import ( "fmt" "strconv" + "k8s.io/apimachinery/pkg/util/rand" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" @@ -20,8 +22,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "k8s.io/apimachinery/pkg/util/rand" ) type dynamicWorkflowContext struct { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go index 56a72fa446..07527d0013 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go @@ -7,19 +7,15 @@ import ( "testing" "github.com/pkg/errors" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" mocks4 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" @@ -27,6 +23,9 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" mocks5 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/handler.go b/flytepropeller/pkg/controller/nodes/dynamic/handler.go index 42a4c416d6..21ef2da487 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/handler.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/handler.go @@ -6,10 +6,8 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" @@ -18,7 +16,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" diff --git a/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go b/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go index 7e02534f24..e66dadbebf 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go @@ -5,32 +5,28 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - lpMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" executorMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/dynamic/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" nodeMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + lpMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type dynamicNodeStateHolder struct { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/utils.go b/flytepropeller/pkg/controller/nodes/dynamic/utils.go index 710d7b4ff6..690cbe06a1 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/utils.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/utils.go @@ -6,7 +6,6 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" diff --git a/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go b/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go index f0907b626a..6afdd487b9 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go @@ -4,13 +4,11 @@ import ( "context" "testing" - mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" ) func TestHierarchicalNodeID(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/end/handler.go b/flytepropeller/pkg/controller/nodes/end/handler.go index 1e128ca116..d10140fb39 100644 --- a/flytepropeller/pkg/controller/nodes/end/handler.go +++ b/flytepropeller/pkg/controller/nodes/end/handler.go @@ -3,13 +3,12 @@ package end import ( "context" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type endHandler struct { diff --git a/flytepropeller/pkg/controller/nodes/end/handler_test.go b/flytepropeller/pkg/controller/nodes/end/handler_test.go index 502265585a..4e7fcdaf01 100644 --- a/flytepropeller/pkg/controller/nodes/end/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/end/handler_test.go @@ -5,24 +5,24 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/proto" regErrors "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" flyteassert "github.com/flyteorg/flyte/flytepropeller/pkg/utils/assert" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var testScope = promutils.NewScope("end_test") diff --git a/flytepropeller/pkg/controller/nodes/executor.go b/flytepropeller/pkg/controller/nodes/executor.go index 3a03949c0c..b9d727db7e 100644 --- a/flytepropeller/pkg/controller/nodes/executor.go +++ b/flytepropeller/pkg/controller/nodes/executor.go @@ -21,11 +21,17 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -38,23 +44,12 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/contextutils" errors2 "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/golang/protobuf/ptypes" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const cacheSerializedReason = "waiting on serialized cache" diff --git a/flytepropeller/pkg/controller/nodes/executor_test.go b/flytepropeller/pkg/controller/nodes/executor_test.go index 0d67edcec5..222e0a05d5 100644 --- a/flytepropeller/pkg/controller/nodes/executor_test.go +++ b/flytepropeller/pkg/controller/nodes/executor_test.go @@ -8,16 +8,20 @@ import ( "testing" "time" + "github.com/golang/protobuf/proto" + "github.com/prometheus/client_golang/prometheus" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - pluginscatalog "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" catalogmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" eventMocks "github.com/flyteorg/flyte/flytepropeller/events/mocks" @@ -34,21 +38,11 @@ import ( recoveryMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" flyteassert "github.com/flyteorg/flyte/flytepropeller/pkg/utils/assert" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - - "github.com/golang/protobuf/proto" - - "github.com/prometheus/client_golang/prometheus" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var fakeKubeClient = mocks4.NewFakeKubeClient() diff --git a/flytepropeller/pkg/controller/nodes/factory/handler_factory.go b/flytepropeller/pkg/controller/nodes/factory/handler_factory.go index 594b810916..424bd15f10 100644 --- a/flytepropeller/pkg/controller/nodes/factory/handler_factory.go +++ b/flytepropeller/pkg/controller/nodes/factory/handler_factory.go @@ -3,12 +3,11 @@ package factory import ( "context" + "github.com/pkg/errors" "k8s.io/client-go/kubernetes" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" @@ -23,10 +22,7 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/pkg/errors" ) type handlerFactory struct { diff --git a/flytepropeller/pkg/controller/nodes/gate/handler.go b/flytepropeller/pkg/controller/nodes/gate/handler.go index d9bd02dcf5..00d2cb989f 100644 --- a/flytepropeller/pkg/controller/nodes/gate/handler.go +++ b/flytepropeller/pkg/controller/nodes/gate/handler.go @@ -8,13 +8,11 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" diff --git a/flytepropeller/pkg/controller/nodes/gate/handler_test.go b/flytepropeller/pkg/controller/nodes/gate/handler_test.go index b3e7991714..488cb58a07 100644 --- a/flytepropeller/pkg/controller/nodes/gate/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/gate/handler_test.go @@ -6,11 +6,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/types/known/durationpb" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" @@ -18,18 +21,10 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/gate/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" nodeMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "google.golang.org/protobuf/types/known/durationpb" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/handler/state.go b/flytepropeller/pkg/controller/nodes/handler/state.go index 07fdb8fef3..a7fa7bdf87 100644 --- a/flytepropeller/pkg/controller/nodes/handler/state.go +++ b/flytepropeller/pkg/controller/nodes/handler/state.go @@ -4,11 +4,8 @@ import ( "time" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flytepropeller/pkg/controller/nodes/handler/state_test.go b/flytepropeller/pkg/controller/nodes/handler/state_test.go index a431ca275a..95f12b6f49 100644 --- a/flytepropeller/pkg/controller/nodes/handler/state_test.go +++ b/flytepropeller/pkg/controller/nodes/handler/state_test.go @@ -6,9 +6,9 @@ import ( "encoding/gob" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s" ) // A test to demonstrate how to unmarshal a serialized state from a workflow CRD. diff --git a/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go b/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go index a04c93dc93..883dbd5f45 100644 --- a/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go +++ b/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go @@ -3,12 +3,11 @@ package handler import ( "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestPhaseInfoQueued(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/handler/transition_test.go b/flytepropeller/pkg/controller/nodes/handler/transition_test.go index d6b92fc257..b2d62c793a 100644 --- a/flytepropeller/pkg/controller/nodes/handler/transition_test.go +++ b/flytepropeller/pkg/controller/nodes/handler/transition_test.go @@ -3,11 +3,10 @@ package handler import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) func AsPointer[T any](val T) *T { diff --git a/flytepropeller/pkg/controller/nodes/interfaces/node.go b/flytepropeller/pkg/controller/nodes/interfaces/node.go index c2f30a2aa1..fd9c12ebb7 100644 --- a/flytepropeller/pkg/controller/nodes/interfaces/node.go +++ b/flytepropeller/pkg/controller/nodes/interfaces/node.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" ) diff --git a/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go b/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go index d22619a856..8f10becca4 100644 --- a/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go +++ b/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go @@ -3,19 +3,16 @@ package interfaces import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/events" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - "github.com/flyteorg/flyte/flytestdlib/storage" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) type TaskReader interface { diff --git a/flytepropeller/pkg/controller/nodes/node_exec_context.go b/flytepropeller/pkg/controller/nodes/node_exec_context.go index 96531a7e0a..f42f8b0324 100644 --- a/flytepropeller/pkg/controller/nodes/node_exec_context.go +++ b/flytepropeller/pkg/controller/nodes/node_exec_context.go @@ -5,12 +5,13 @@ import ( "fmt" "strconv" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -19,13 +20,8 @@ import ( nodeerrors "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/pkg/errors" - - "k8s.io/apimachinery/pkg/types" ) const NodeIDLabel = "node-id" diff --git a/flytepropeller/pkg/controller/nodes/node_exec_context_test.go b/flytepropeller/pkg/controller/nodes/node_exec_context_test.go index d96942c632..e64abb4c99 100644 --- a/flytepropeller/pkg/controller/nodes/node_exec_context_test.go +++ b/flytepropeller/pkg/controller/nodes/node_exec_context_test.go @@ -6,10 +6,12 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -17,14 +19,9 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) type TaskReader struct{} diff --git a/flytepropeller/pkg/controller/nodes/node_state_manager.go b/flytepropeller/pkg/controller/nodes/node_state_manager.go index 589a3c3a8e..91cf1f2679 100644 --- a/flytepropeller/pkg/controller/nodes/node_state_manager.go +++ b/flytepropeller/pkg/controller/nodes/node_state_manager.go @@ -4,7 +4,6 @@ import ( "context" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" ) diff --git a/flytepropeller/pkg/controller/nodes/output_resolver.go b/flytepropeller/pkg/controller/nodes/output_resolver.go index 4a771c3172..91e5a0975e 100644 --- a/flytepropeller/pkg/controller/nodes/output_resolver.go +++ b/flytepropeller/pkg/controller/nodes/output_resolver.go @@ -4,15 +4,12 @@ import ( "context" "reflect" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type VarName = string diff --git a/flytepropeller/pkg/controller/nodes/output_resolver_test.go b/flytepropeller/pkg/controller/nodes/output_resolver_test.go index 692406c724..89840ae371 100644 --- a/flytepropeller/pkg/controller/nodes/output_resolver_test.go +++ b/flytepropeller/pkg/controller/nodes/output_resolver_test.go @@ -3,9 +3,10 @@ package nodes import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/stretchr/testify/assert" ) func TestCreateAliasMap(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/predicate.go b/flytepropeller/pkg/controller/nodes/predicate.go index 5ce24bf926..37fe482267 100644 --- a/flytepropeller/pkg/controller/nodes/predicate.go +++ b/flytepropeller/pkg/controller/nodes/predicate.go @@ -4,12 +4,12 @@ import ( "context" "time" - "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) // Special enum to indicate if the node under consideration is ready to be executed or should be skipped diff --git a/flytepropeller/pkg/controller/nodes/predicate_test.go b/flytepropeller/pkg/controller/nodes/predicate_test.go index 3498ccd2c9..379bbe51f9 100644 --- a/flytepropeller/pkg/controller/nodes/predicate_test.go +++ b/flytepropeller/pkg/controller/nodes/predicate_test.go @@ -5,9 +5,10 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" - "github.com/stretchr/testify/assert" ) func TestCanExecute(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/resolve_test.go b/flytepropeller/pkg/controller/nodes/resolve_test.go index 9734f0fdee..19a8be1e7d 100644 --- a/flytepropeller/pkg/controller/nodes/resolve_test.go +++ b/flytepropeller/pkg/controller/nodes/resolve_test.go @@ -4,20 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - + "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" flyteassert "github.com/flyteorg/flyte/flytepropeller/pkg/utils/assert" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var testScope = promutils.NewScope("test") diff --git a/flytepropeller/pkg/controller/nodes/setup_context.go b/flytepropeller/pkg/controller/nodes/setup_context.go index c4fdab9897..fb0cafcbe2 100644 --- a/flytepropeller/pkg/controller/nodes/setup_context.go +++ b/flytepropeller/pkg/controller/nodes/setup_context.go @@ -3,10 +3,9 @@ package nodes import ( "context" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type setupContext struct { diff --git a/flytepropeller/pkg/controller/nodes/start/handler_test.go b/flytepropeller/pkg/controller/nodes/start/handler_test.go index 03260179f1..6f74b7ff54 100644 --- a/flytepropeller/pkg/controller/nodes/start/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/start/handler_test.go @@ -4,12 +4,11 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/handler.go b/flytepropeller/pkg/controller/nodes/subworkflow/handler.go index 09ecb83fc8..5f9f16d206 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/handler.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/handler.go @@ -3,21 +3,17 @@ package subworkflow import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) type workflowNodeHandler struct { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go index 58907b505d..6bf6781eac 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go @@ -6,29 +6,27 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - mocks5 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + mocks5 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type workflowNodeStateHolder struct { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go index 24c3933064..dd09c5d5d7 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go @@ -4,8 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" @@ -14,12 +16,8 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) type launchPlanHandler struct { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go index e66e630fe3..0c552560a9 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go @@ -5,25 +5,20 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes/wrappers" + "golang.org/x/time/rate" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "k8s.io/client-go/util/workqueue" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - + evtErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytestdlib/cache" stdErr "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - evtErr "github.com/flyteorg/flyte/flytepropeller/events/errors" - - "github.com/golang/protobuf/ptypes/wrappers" - - "golang.org/x/time/rate" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "k8s.io/client-go/util/workqueue" ) var isRecovery = true diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go index fe072b1607..0af8d1eb16 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go @@ -6,19 +6,17 @@ import ( "time" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flytestdlib/cache" - mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/cache" + mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestAdminLaunchPlanExecutor_GetStatus(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go index 8e436cc17b..9330b0c865 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/errors" ) func TestRemoteError(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go index 21dd6b7b3d..666d3b1797 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go @@ -4,10 +4,9 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go index b82ec0d81b..bf26ee0d60 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go @@ -4,8 +4,9 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestFailFastWorkflowLauncher(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go index a5c4fdfc83..2e042d72a4 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go @@ -6,29 +6,27 @@ import ( "reflect" "testing" - mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - + mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" + mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" recoveryMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func createInmemoryStore(t testing.TB) *storage.DataStore { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go index c79f559c5b..10e48358dd 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" @@ -13,7 +12,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go index d8fb93d247..f2391048af 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go @@ -5,14 +5,13 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" coreMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/util.go b/flytepropeller/pkg/controller/nodes/subworkflow/util.go index 831aa67bae..ae23439c97 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/util.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/util.go @@ -4,7 +4,6 @@ import ( "strconv" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go index 6f3010913a..f1df02deb6 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go @@ -3,8 +3,9 @@ package subworkflow import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestGetChildWorkflowExecutionID(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/controller.go b/flytepropeller/pkg/controller/nodes/task/backoff/controller.go index 89faff559a..fb12872639 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/controller.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/controller.go @@ -5,13 +5,11 @@ import ( "fmt" "time" + "k8s.io/apimachinery/pkg/util/clock" "sigs.k8s.io/controller-runtime/pkg/client" stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "k8s.io/apimachinery/pkg/util/clock" ) // Controller is a name-spaced collection of back-off handlers diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/handler.go b/flytepropeller/pkg/controller/nodes/task/backoff/handler.go index 8decfa09eb..e6677e7c7a 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/handler.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/handler.go @@ -7,13 +7,14 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" - "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/clock" + + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go b/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go index a164348b46..98e084850a 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go @@ -8,17 +8,16 @@ import ( "testing" "time" - stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" - "github.com/stretchr/testify/assert" - - taskErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdlibErrors "github.com/flyteorg/flyte/flytestdlib/errors" v1 "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/clock" + + taskErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" + stdlibErrors "github.com/flyteorg/flyte/flytestdlib/errors" ) func TestComputeResourceAwareBackOffHandler_Handle(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go b/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go index 6a55011e60..13a8329bab 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go @@ -4,10 +4,9 @@ import ( "strings" "sync" - "k8s.io/apimachinery/pkg/util/sets" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/sets" ) // SyncResourceList is a thread-safe Map. It's meant to replace v1.ResourceList for concurrency-sensitive diff --git a/flytepropeller/pkg/controller/nodes/task/cache.go b/flytepropeller/pkg/controller/nodes/task/cache.go index 865d2b005d..2be27dd8d3 100644 --- a/flytepropeller/pkg/controller/nodes/task/cache.go +++ b/flytepropeller/pkg/controller/nodes/task/cache.go @@ -5,10 +5,8 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - errors2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flytepropeller/pkg/controller/nodes/task/config/config.go b/flytepropeller/pkg/controller/nodes/task/config/config.go index 26373219d4..6baccebc44 100644 --- a/flytepropeller/pkg/controller/nodes/task/config/config.go +++ b/flytepropeller/pkg/controller/nodes/task/config/config.go @@ -6,10 +6,10 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flytestdlib/logger" "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) //go:generate pflags Config diff --git a/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go b/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go index 3d8b608cc3..53e1755281 100644 --- a/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go +++ b/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/stretchr/testify/assert" + + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) func TestBufferedEventRecorder(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go b/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go index 6f93028d15..1bf2c5bb41 100644 --- a/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go +++ b/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go @@ -5,10 +5,11 @@ import ( "fmt" "time" + "github.com/stretchr/testify/mock" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/stretchr/testify/mock" ) type NextPhaseState struct { diff --git a/flytepropeller/pkg/controller/nodes/task/future_file_reader.go b/flytepropeller/pkg/controller/nodes/task/future_file_reader.go index 5b2023155d..fa23986812 100644 --- a/flytepropeller/pkg/controller/nodes/task/future_file_reader.go +++ b/flytepropeller/pkg/controller/nodes/task/future_file_reader.go @@ -4,12 +4,11 @@ import ( "context" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" ) // TODO this file exists only until we need to support dynamic nodes instead of closure. diff --git a/flytepropeller/pkg/controller/nodes/task/handler.go b/flytepropeller/pkg/controller/nodes/task/handler.go index 936cf3fa9d..6a0f44d648 100644 --- a/flytepropeller/pkg/controller/nodes/task/handler.go +++ b/flytepropeller/pkg/controller/nodes/task/handler.go @@ -6,19 +6,19 @@ import ( "runtime/debug" "time" + "github.com/golang/protobuf/ptypes" + regErrors "github.com/pkg/errors" "k8s.io/client-go/kubernetes" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" pluginK8s "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" controllerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" @@ -31,16 +31,11 @@ import ( rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/secretmanager" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/golang/protobuf/ptypes" - - regErrors "github.com/pkg/errors" ) const pluginContextKey = contextutils.Key("plugin") diff --git a/flytepropeller/pkg/controller/nodes/task/handler_test.go b/flytepropeller/pkg/controller/nodes/task/handler_test.go index 70d8887a2e..0e778a5e48 100644 --- a/flytepropeller/pkg/controller/nodes/task/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/task/handler_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v1 "k8s.io/api/core/v1" @@ -19,7 +18,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginCatalogMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -29,7 +27,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" pluginK8s "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" pluginK8sMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s/mocks" - eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" @@ -43,7 +40,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/fakeplugins" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager" rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go b/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go index 9247a3e723..460f64bbc4 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go @@ -5,7 +5,6 @@ import ( "time" "github.com/stretchr/testify/assert" - corev1 "k8s.io/api/core/v1" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go index 138444d4cb..e747c65785 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go @@ -7,14 +7,14 @@ import ( "sync" "time" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) const resourceLevelMonitorCycleDuration = 10 * time.Second diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go index aad8456fd0..2dcec03e16 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go @@ -6,13 +6,14 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/prometheus/client_golang/prometheus/testutil" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/cache" + + "github.com/flyteorg/flyte/flytestdlib/promutils" ) var pods = []interface{}{ diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go b/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go index 9fef4557d7..8807236bff 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go @@ -3,9 +3,10 @@ package k8s import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/stretchr/testify/assert" ) func Test_newTaskExecutionMetadata(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go index acbb2e98e2..7b425e08f2 100644 --- a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go +++ b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go @@ -5,13 +5,12 @@ import ( "context" "encoding/json" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/pkg/errors" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type RemoteFileWorkflowStore struct { diff --git a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go index c8050de3e7..ac745247b4 100644 --- a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go +++ b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go @@ -4,20 +4,16 @@ import ( "context" "testing" - "k8s.io/apimachinery/pkg/api/resource" - "github.com/go-test/deep" - "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func createInmemoryStore(t testing.TB) *storage.DataStore { diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go index ba6d1df6f9..d616839b3c 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go @@ -3,10 +3,10 @@ package resourcemanager import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" + "github.com/go-redis/redis" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/go-redis/redis" ) //go:generate mockery -name RedisClient -case=underscore diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go index 465c24b881..be1373e8a4 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go @@ -6,13 +6,14 @@ import ( "sync" "time" + "github.com/pkg/errors" + "github.com/prometheus/client_golang/prometheus" + "k8s.io/apimachinery/pkg/util/wait" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/pkg/errors" - "github.com/prometheus/client_golang/prometheus" - "k8s.io/apimachinery/pkg/util/wait" ) // This is the key that will point to the Redis Set. diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go index f0e3eb8cee..db4371cd67 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go @@ -5,11 +5,12 @@ import ( "sync" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func createMockNamespacedResourcesMap(mScope promutils.Scope) map[core.ResourceNamespace]*Resource { diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go index fa7ebd5b4b..1912b9324e 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go @@ -5,10 +5,8 @@ import ( "fmt" "sync" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go index c2ca5388cc..f508dd8f10 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go @@ -4,13 +4,13 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestComposeTokenPrefix(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go b/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go index 21dcd3c521..230017d7d3 100644 --- a/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go +++ b/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go @@ -9,7 +9,6 @@ import ( "strings" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flytepropeller/pkg/controller/nodes/task/setup_ctx.go b/flytepropeller/pkg/controller/nodes/task/setup_ctx.go index 97790c0f98..ddbaba90a4 100644 --- a/flytepropeller/pkg/controller/nodes/task/setup_ctx.go +++ b/flytepropeller/pkg/controller/nodes/task/setup_ctx.go @@ -1,13 +1,11 @@ package task import ( - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "k8s.io/apimachinery/pkg/types" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "k8s.io/apimachinery/pkg/types" ) type setupContext struct { diff --git a/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go b/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go index bfb32ac8c9..3de204ecfb 100644 --- a/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go +++ b/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go @@ -3,10 +3,11 @@ package task import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) type dummySetupCtx struct { diff --git a/flytepropeller/pkg/controller/nodes/task/taskexec_context.go b/flytepropeller/pkg/controller/nodes/task/taskexec_context.go index 0d9a226cf1..8b819c79eb 100644 --- a/flytepropeller/pkg/controller/nodes/task/taskexec_context.go +++ b/flytepropeller/pkg/controller/nodes/task/taskexec_context.go @@ -6,6 +6,9 @@ import ( "strconv" "strings" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginCatalog "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -21,8 +24,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/utils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go b/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go index 22506e649e..a8cbc7d6d3 100644 --- a/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go +++ b/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go @@ -5,35 +5,30 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" nodeMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/codex" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/secretmanager" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestHandler_newTaskExecutionContext(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/transformer_test.go b/flytepropeller/pkg/controller/nodes/task/transformer_test.go index 1c58bdf561..a26705baee 100644 --- a/flytepropeller/pkg/controller/nodes/task/transformer_test.go +++ b/flytepropeller/pkg/controller/nodes/task/transformer_test.go @@ -4,27 +4,23 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/ptypes" structpb "github.com/golang/protobuf/ptypes/struct" "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" nodemocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const containerTaskType = "container" diff --git a/flytepropeller/pkg/controller/nodes/task_reader.go b/flytepropeller/pkg/controller/nodes/task_reader.go index 588f861984..5cc5654f63 100644 --- a/flytepropeller/pkg/controller/nodes/task_reader.go +++ b/flytepropeller/pkg/controller/nodes/task_reader.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) diff --git a/flytepropeller/pkg/controller/nodes/transformers.go b/flytepropeller/pkg/controller/nodes/transformers.go index 047cb03b68..8c0db1e57a 100644 --- a/flytepropeller/pkg/controller/nodes/transformers.go +++ b/flytepropeller/pkg/controller/nodes/transformers.go @@ -6,21 +6,18 @@ import ( "strconv" "time" + "github.com/golang/protobuf/ptypes" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/golang/protobuf/ptypes" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // This is used by flyteadmin to indicate that the events will now contain populated IsParent and IsDynamic bits. diff --git a/flytepropeller/pkg/controller/nodes/transformers_test.go b/flytepropeller/pkg/controller/nodes/transformers_test.go index 823096b68d..f1d5202401 100644 --- a/flytepropeller/pkg/controller/nodes/transformers_test.go +++ b/flytepropeller/pkg/controller/nodes/transformers_test.go @@ -3,19 +3,18 @@ package nodes import ( "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestToNodeExecutionEvent(t *testing.T) { diff --git a/flytepropeller/pkg/controller/workers.go b/flytepropeller/pkg/controller/workers.go index 9b3f8555d3..c21da019c8 100644 --- a/flytepropeller/pkg/controller/workers.go +++ b/flytepropeller/pkg/controller/workers.go @@ -6,12 +6,13 @@ import ( "runtime/pprof" "time" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/prometheus/client_golang/prometheus" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/cache" + + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type Handler interface { diff --git a/flytepropeller/pkg/controller/workers_test.go b/flytepropeller/pkg/controller/workers_test.go index c3c271e7a0..3ada76ade2 100644 --- a/flytepropeller/pkg/controller/workers_test.go +++ b/flytepropeller/pkg/controller/workers_test.go @@ -5,10 +5,10 @@ import ( "sync" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) var testLocalScope2 = promutils.NewScope("worker_pool") diff --git a/flytepropeller/pkg/controller/workflow/executor.go b/flytepropeller/pkg/controller/workflow/executor.go index 5e06f333f9..13957606d1 100644 --- a/flytepropeller/pkg/controller/workflow/executor.go +++ b/flytepropeller/pkg/controller/workflow/executor.go @@ -5,9 +5,11 @@ import ( "fmt" "time" + corev1 "k8s.io/api/core/v1" + "k8s.io/client-go/tools/record" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -16,14 +18,10 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflow/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - corev1 "k8s.io/api/core/v1" - "k8s.io/client-go/tools/record" ) type workflowMetrics struct { diff --git a/flytepropeller/pkg/controller/workflowstore/inmemory.go b/flytepropeller/pkg/controller/workflowstore/inmemory.go index e376de8f1a..6f2c294782 100644 --- a/flytepropeller/pkg/controller/workflowstore/inmemory.go +++ b/flytepropeller/pkg/controller/workflowstore/inmemory.go @@ -4,8 +4,9 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" kubeerrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) type InmemoryWorkflowStore struct { diff --git a/flytepropeller/pkg/controller/workflowstore/passthrough.go b/flytepropeller/pkg/controller/workflowstore/passthrough.go index 2d92b8249f..ab10482b78 100644 --- a/flytepropeller/pkg/controller/workflowstore/passthrough.go +++ b/flytepropeller/pkg/controller/workflowstore/passthrough.go @@ -4,6 +4,8 @@ import ( "context" "time" + "github.com/prometheus/client_golang/prometheus" + kubeerrors "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -11,9 +13,6 @@ import ( listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/prometheus/client_golang/prometheus" - - kubeerrors "k8s.io/apimachinery/pkg/api/errors" ) type workflowstoreMetrics struct { diff --git a/flytepropeller/pkg/controller/workflowstore/passthrough_test.go b/flytepropeller/pkg/controller/workflowstore/passthrough_test.go index 322f1d21cd..3ddbb45ed6 100644 --- a/flytepropeller/pkg/controller/workflowstore/passthrough_test.go +++ b/flytepropeller/pkg/controller/workflowstore/passthrough_test.go @@ -5,17 +5,15 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/stretchr/testify/assert" + kubeerrors "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/fake" - - kubeerrors "k8s.io/apimachinery/pkg/api/errors" + listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type mockWFNamespaceLister struct { diff --git a/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go b/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go index c216b7a9d1..7f2f850f22 100644 --- a/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go +++ b/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go @@ -6,7 +6,6 @@ import ( "sync" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) diff --git a/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go b/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go index 8d9b2d6a84..8537e2209b 100644 --- a/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go +++ b/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go @@ -5,22 +5,19 @@ import ( "fmt" "testing" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - + goObjectHash "github.com/benlaurie/objecthash/go/objecthash" + "github.com/stretchr/testify/assert" + kubeerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" - + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" testing2 "k8s.io/client-go/testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - goObjectHash "github.com/benlaurie/objecthash/go/objecthash" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/fake" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - kubeerrors "k8s.io/apimachinery/pkg/api/errors" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) const ( diff --git a/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go b/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go index 2bf0be51da..eaab16b327 100644 --- a/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go +++ b/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go @@ -6,7 +6,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytestdlib/fastcheck" - "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go b/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go index d17d394f8a..d57cfcc43d 100644 --- a/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go +++ b/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go @@ -4,12 +4,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/fake" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) const ( diff --git a/flytepropeller/pkg/controller/workqueue.go b/flytepropeller/pkg/controller/workqueue.go index 3209c632f6..1d10cb5f2a 100644 --- a/flytepropeller/pkg/controller/workqueue.go +++ b/flytepropeller/pkg/controller/workqueue.go @@ -3,14 +3,12 @@ package controller import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "golang.org/x/time/rate" + "k8s.io/client-go/util/workqueue" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/logger" - // Setup workqueue metrics - _ "github.com/flyteorg/flyte/flytestdlib/promutils" - "k8s.io/client-go/util/workqueue" + _ "github.com/flyteorg/flyte/flytestdlib/promutils" // Setup workqueue metrics ) func NewWorkQueue(ctx context.Context, cfg config.WorkqueueConfig, name string) (workqueue.RateLimitingInterface, error) { diff --git a/flytepropeller/pkg/controller/workqueue_test.go b/flytepropeller/pkg/controller/workqueue_test.go index 74a8108014..e73ee8eb50 100644 --- a/flytepropeller/pkg/controller/workqueue_test.go +++ b/flytepropeller/pkg/controller/workqueue_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" - config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/stretchr/testify/assert" + config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/stretchr/testify/assert" ) func TestNewWorkQueue(t *testing.T) { diff --git a/flytepropeller/pkg/leaderelection/leader_election.go b/flytepropeller/pkg/leaderelection/leader_election.go index cbd895d036..a3d28a944b 100644 --- a/flytepropeller/pkg/leaderelection/leader_election.go +++ b/flytepropeller/pkg/leaderelection/leader_election.go @@ -5,16 +5,14 @@ import ( "fmt" "os" - v12 "k8s.io/client-go/kubernetes/typed/coordination/v1" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "k8s.io/apimachinery/pkg/util/rand" - + v12 "k8s.io/client-go/kubernetes/typed/coordination/v1" v1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/record" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" ) const ( diff --git a/flytepropeller/pkg/utils/assert/literals.go b/flytepropeller/pkg/utils/assert/literals.go index c0a8ca497f..66f57c328e 100644 --- a/flytepropeller/pkg/utils/assert/literals.go +++ b/flytepropeller/pkg/utils/assert/literals.go @@ -4,8 +4,9 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func EqualPrimitive(t *testing.T, p1 *core.Primitive, p2 *core.Primitive) { diff --git a/flytepropeller/pkg/utils/failing_datastore_test.go b/flytepropeller/pkg/utils/failing_datastore_test.go index 820ab8b84b..cb28e153a3 100644 --- a/flytepropeller/pkg/utils/failing_datastore_test.go +++ b/flytepropeller/pkg/utils/failing_datastore_test.go @@ -5,8 +5,9 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestFailingRawStore(t *testing.T) { diff --git a/flytepropeller/pkg/utils/k8s.go b/flytepropeller/pkg/utils/k8s.go index a56ef84ab5..f666fd9013 100644 --- a/flytepropeller/pkg/utils/k8s.go +++ b/flytepropeller/pkg/utils/k8s.go @@ -7,11 +7,6 @@ import ( "regexp" "strings" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - flyteScheme "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/scheme" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/timestamp" "github.com/pkg/errors" @@ -24,6 +19,12 @@ import ( restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/record" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + flyteScheme "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/scheme" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var NotTheOwnerError = errors.Errorf("FlytePropeller is not the owner") diff --git a/flytepropeller/pkg/utils/k8s_test.go b/flytepropeller/pkg/utils/k8s_test.go index 0ea0d8e654..47cc5c6e68 100644 --- a/flytepropeller/pkg/utils/k8s_test.go +++ b/flytepropeller/pkg/utils/k8s_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) diff --git a/flytepropeller/pkg/visualize/sort.go b/flytepropeller/pkg/visualize/sort.go index 7dbe96df50..2d2d24e4e4 100644 --- a/flytepropeller/pkg/visualize/sort.go +++ b/flytepropeller/pkg/visualize/sort.go @@ -1,8 +1,9 @@ package visualize import ( - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/pkg/errors" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) type VisitStatus int8 diff --git a/flytepropeller/pkg/visualize/visualize.go b/flytepropeller/pkg/visualize/visualize.go index 911cfb7944..6a5ee7ba11 100644 --- a/flytepropeller/pkg/visualize/visualize.go +++ b/flytepropeller/pkg/visualize/visualize.go @@ -5,10 +5,11 @@ import ( "reflect" "strings" + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" - "k8s.io/apimachinery/pkg/util/sets" ) const executionEdgeLabel = "execution" diff --git a/flytepropeller/pkg/webhook/aws_secret_manager.go b/flytepropeller/pkg/webhook/aws_secret_manager.go index 696a02f8ab..d1595ffc1e 100644 --- a/flytepropeller/pkg/webhook/aws_secret_manager.go +++ b/flytepropeller/pkg/webhook/aws_secret_manager.go @@ -7,10 +7,11 @@ import ( "path/filepath" "strings" + corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/aws_secret_manager_test.go b/flytepropeller/pkg/webhook/aws_secret_manager_test.go index 9596efb664..d2a74de80b 100644 --- a/flytepropeller/pkg/webhook/aws_secret_manager_test.go +++ b/flytepropeller/pkg/webhook/aws_secret_manager_test.go @@ -4,13 +4,12 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) func TestAWSSecretManagerInjector_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/config/config.go b/flytepropeller/pkg/webhook/config/config.go index 9bf5b57323..4c640bde9e 100644 --- a/flytepropeller/pkg/webhook/config/config.go +++ b/flytepropeller/pkg/webhook/config/config.go @@ -1,9 +1,10 @@ package config import ( - "github.com/flyteorg/flyte/flytestdlib/config" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate enumer --type=SecretManagerType --trimprefix=SecretManagerType -json -yaml diff --git a/flytepropeller/pkg/webhook/entrypoint.go b/flytepropeller/pkg/webhook/entrypoint.go index de8f9ab820..466cbbde33 100644 --- a/flytepropeller/pkg/webhook/entrypoint.go +++ b/flytepropeller/pkg/webhook/entrypoint.go @@ -7,15 +7,16 @@ import ( "fmt" "os" + "k8s.io/apimachinery/pkg/api/errors" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "sigs.k8s.io/controller-runtime/pkg/manager" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" config2 "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "k8s.io/apimachinery/pkg/api/errors" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" - "sigs.k8s.io/controller-runtime/pkg/manager" ) const ( diff --git a/flytepropeller/pkg/webhook/gcp_secret_manager.go b/flytepropeller/pkg/webhook/gcp_secret_manager.go index 75226a1f9a..c69705594e 100644 --- a/flytepropeller/pkg/webhook/gcp_secret_manager.go +++ b/flytepropeller/pkg/webhook/gcp_secret_manager.go @@ -7,10 +7,11 @@ import ( "path/filepath" "strings" + corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/gcp_secret_manager_test.go b/flytepropeller/pkg/webhook/gcp_secret_manager_test.go index fb66006523..7095614d24 100644 --- a/flytepropeller/pkg/webhook/gcp_secret_manager_test.go +++ b/flytepropeller/pkg/webhook/gcp_secret_manager_test.go @@ -4,13 +4,12 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) func TestGCPSecretManagerInjector_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/global_secrets.go b/flytepropeller/pkg/webhook/global_secrets.go index 989bb77d9c..a4b3543fb1 100644 --- a/flytepropeller/pkg/webhook/global_secrets.go +++ b/flytepropeller/pkg/webhook/global_secrets.go @@ -5,11 +5,11 @@ import ( "fmt" "strings" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + corev1 "k8s.io/api/core/v1" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) //go:generate mockery -all -case=underscore diff --git a/flytepropeller/pkg/webhook/global_secrets_test.go b/flytepropeller/pkg/webhook/global_secrets_test.go index f8e8b591b3..c8df41b50f 100644 --- a/flytepropeller/pkg/webhook/global_secrets_test.go +++ b/flytepropeller/pkg/webhook/global_secrets_test.go @@ -5,16 +5,14 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - "github.com/stretchr/testify/assert" - "github.com/go-test/deep" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" - "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" ) func TestGlobalSecrets_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/init_cert.go b/flytepropeller/pkg/webhook/init_cert.go index ba9c2c7f64..61b86dd66a 100644 --- a/flytepropeller/pkg/webhook/init_cert.go +++ b/flytepropeller/pkg/webhook/init_cert.go @@ -14,14 +14,15 @@ import ( "path" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/flyteorg/flyte/flytestdlib/logger" corev1 "k8s.io/api/core/v1" kubeErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type webhookCerts struct { diff --git a/flytepropeller/pkg/webhook/k8s_secrets.go b/flytepropeller/pkg/webhook/k8s_secrets.go index 70ab77354c..102d1ae6c1 100644 --- a/flytepropeller/pkg/webhook/k8s_secrets.go +++ b/flytepropeller/pkg/webhook/k8s_secrets.go @@ -6,11 +6,11 @@ import ( "os" "path/filepath" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + corev1 "k8s.io/api/core/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/k8s_secrets_test.go b/flytepropeller/pkg/webhook/k8s_secrets_test.go index 3b422fc911..ac8cdf0649 100644 --- a/flytepropeller/pkg/webhook/k8s_secrets_test.go +++ b/flytepropeller/pkg/webhook/k8s_secrets_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/go-test/deep" + corev1 "k8s.io/api/core/v1" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - corev1 "k8s.io/api/core/v1" ) func TestK8sSecretInjector_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/pod.go b/flytepropeller/pkg/webhook/pod.go index 412bb24ff3..556b6053d9 100644 --- a/flytepropeller/pkg/webhook/pod.go +++ b/flytepropeller/pkg/webhook/pod.go @@ -36,21 +36,19 @@ import ( "path/filepath" "strings" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const webhookName = "flyte-pod-webhook.flyte.org" diff --git a/flytepropeller/pkg/webhook/pod_test.go b/flytepropeller/pkg/webhook/pod_test.go index 3c334a75cc..08a4284728 100644 --- a/flytepropeller/pkg/webhook/pod_test.go +++ b/flytepropeller/pkg/webhook/pod_test.go @@ -5,21 +5,17 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - "k8s.io/client-go/tools/clientcmd/api/latest" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + admissionv1 "k8s.io/api/admission/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/tools/clientcmd/api/latest" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - "github.com/flyteorg/flyte/flytestdlib/promutils" - + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" - "github.com/stretchr/testify/mock" - - "github.com/stretchr/testify/assert" - admissionv1 "k8s.io/api/admission/v1" - corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestPodMutator_Mutate(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/secrets.go b/flytepropeller/pkg/webhook/secrets.go index 812290dd30..02557ebd37 100644 --- a/flytepropeller/pkg/webhook/secrets.go +++ b/flytepropeller/pkg/webhook/secrets.go @@ -3,17 +3,14 @@ package webhook import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" secretUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/secretmanager" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/secrets_test.go b/flytepropeller/pkg/webhook/secrets_test.go index 7deb7beb5f..a0bdb9846b 100644 --- a/flytepropeller/pkg/webhook/secrets_test.go +++ b/flytepropeller/pkg/webhook/secrets_test.go @@ -5,16 +5,13 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" ) func TestSecretsWebhook_Mutate(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/utils.go b/flytepropeller/pkg/webhook/utils.go index 7d7e7e3673..92a4995c24 100644 --- a/flytepropeller/pkg/webhook/utils.go +++ b/flytepropeller/pkg/webhook/utils.go @@ -5,13 +5,12 @@ import ( "path/filepath" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/uuid" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) func hasEnvVar(envVars []corev1.EnvVar, envVarKey string) bool { diff --git a/flytepropeller/pkg/webhook/utils_test.go b/flytepropeller/pkg/webhook/utils_test.go index 15079ca8fb..ed4669e7e5 100644 --- a/flytepropeller/pkg/webhook/utils_test.go +++ b/flytepropeller/pkg/webhook/utils_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/go-test/deep" - corev1 "k8s.io/api/core/v1" ) diff --git a/flytepropeller/pkg/webhook/vault_secret_manager.go b/flytepropeller/pkg/webhook/vault_secret_manager.go index d149cd4e6f..658e3970d1 100644 --- a/flytepropeller/pkg/webhook/vault_secret_manager.go +++ b/flytepropeller/pkg/webhook/vault_secret_manager.go @@ -6,11 +6,12 @@ import ( "os" "path/filepath" + corev1 "k8s.io/api/core/v1" + coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) var ( diff --git a/flytepropeller/pkg/webhook/vault_secret_manager_test.go b/flytepropeller/pkg/webhook/vault_secret_manager_test.go index 19941a431f..cd7803d27d 100644 --- a/flytepropeller/pkg/webhook/vault_secret_manager_test.go +++ b/flytepropeller/pkg/webhook/vault_secret_manager_test.go @@ -5,11 +5,12 @@ import ( "fmt" "testing" - coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/go-test/deep" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) var (