diff --git a/boilerplate/flyte/golang_test_targets/Makefile b/boilerplate/flyte/golang_test_targets/Makefile index 4b0f254329..c02409a318 100644 --- a/boilerplate/flyte/golang_test_targets/Makefile +++ b/boilerplate/flyte/golang_test_targets/Makefile @@ -3,6 +3,7 @@ # # TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst +LINT_FLAGS ?= .PHONY: download_tooling download_tooling: #download dependencies (including test deps) for the package @@ -14,13 +15,11 @@ generate: download_tooling #generate go code .PHONY: lint lint: download_tooling #lints the package for common code smells - GL_DEBUG=linters_output,env golangci-lint run --deadline=5m --exclude deprecated -v + GL_DEBUG=linters_output,env golangci-lint run $(LINT_FLAGS) --deadline=5m --exclude deprecated -v -# If code is failing goimports linter, this will fix. -# skips 'vendor' -.PHONY: goimports -goimports: - @boilerplate/flyte/golang_test_targets/goimports +.PHONY: lint-fix +lint-fix: LINT_FLAGS=--fix +lint-fix: lint .PHONY: mod_download mod_download: #download dependencies (including test deps) for the package diff --git a/boilerplate/flyte/golang_test_targets/Readme.rst b/boilerplate/flyte/golang_test_targets/Readme.rst index f9d890fdd7..700feb33a2 100644 --- a/boilerplate/flyte/golang_test_targets/Readme.rst +++ b/boilerplate/flyte/golang_test_targets/Readme.rst @@ -5,6 +5,8 @@ Provides an ``install`` make target that uses ``go mod`` to install golang depen Provides a ``lint`` make target that uses golangci to lint your code. +Provides a ``lint-fix`` make target that uses golangci to lint and fix your code in place. + Provides a ``test_unit`` target for unit tests. Provides a ``test_unit_cover`` target for analysing coverage of unit tests, which will output the coverage of each function and total statement coverage. diff --git a/boilerplate/flyte/golang_test_targets/goimports b/boilerplate/flyte/golang_test_targets/goimports deleted file mode 100755 index 40f50d106e..0000000000 --- a/boilerplate/flyte/golang_test_targets/goimports +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: -# -# 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/flytectl/.golangci.yml b/flytectl/.golangci.yml index 0ba2332bb9..b7e8525336 100644 --- a/flytectl/.golangci.yml +++ b/flytectl/.golangci.yml @@ -13,6 +13,7 @@ linters: - deadcode - errcheck - gas + - gci - goconst - goimports - golint diff --git a/flytectl/cmd/config/config.go b/flytectl/cmd/config/config.go index 4296d28b3b..ff3b2e9219 100644 --- a/flytectl/cmd/config/config.go +++ b/flytectl/cmd/config/config.go @@ -4,9 +4,8 @@ import ( "fmt" "strings" - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytectl/pkg/printer" + "github.com/flyteorg/flyte/flytestdlib/config" ) var ( diff --git a/flytectl/cmd/config/subcommand/clusterresourceattribute/file_config_test.go b/flytectl/cmd/config/subcommand/clusterresourceattribute/file_config_test.go index 92b791cf0a..c9c003dc08 100644 --- a/flytectl/cmd/config/subcommand/clusterresourceattribute/file_config_test.go +++ b/flytectl/cmd/config/subcommand/clusterresourceattribute/file_config_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/config/subcommand/executionclusterlabel/file_config_test.go b/flytectl/cmd/config/subcommand/executionclusterlabel/file_config_test.go index 79ea059930..b45a5404b1 100644 --- a/flytectl/cmd/config/subcommand/executionclusterlabel/file_config_test.go +++ b/flytectl/cmd/config/subcommand/executionclusterlabel/file_config_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/config/subcommand/executionqueueattribute/file_config_test.go b/flytectl/cmd/config/subcommand/executionqueueattribute/file_config_test.go index 191cabb023..ac9dbc3d60 100644 --- a/flytectl/cmd/config/subcommand/executionqueueattribute/file_config_test.go +++ b/flytectl/cmd/config/subcommand/executionqueueattribute/file_config_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/config/subcommand/plugin_override/file_config_test.go b/flytectl/cmd/config/subcommand/plugin_override/file_config_test.go index 13037945af..d66fe59141 100644 --- a/flytectl/cmd/config/subcommand/plugin_override/file_config_test.go +++ b/flytectl/cmd/config/subcommand/plugin_override/file_config_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/config/subcommand/project/project_config.go b/flytectl/cmd/config/subcommand/project/project_config.go index e693e566c6..d76030faa7 100644 --- a/flytectl/cmd/config/subcommand/project/project_config.go +++ b/flytectl/cmd/config/subcommand/project/project_config.go @@ -8,7 +8,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/pkg/filters" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "gopkg.in/yaml.v3" ) diff --git a/flytectl/cmd/config/subcommand/project/project_config_test.go b/flytectl/cmd/config/subcommand/project/project_config_test.go index b848943f61..bbaf521375 100644 --- a/flytectl/cmd/config/subcommand/project/project_config_test.go +++ b/flytectl/cmd/config/subcommand/project/project_config_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytectl/clierrors" "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/config/subcommand/taskresourceattribute/file_config_test.go b/flytectl/cmd/config/subcommand/taskresourceattribute/file_config_test.go index cba5ea672b..96e4f1bb88 100644 --- a/flytectl/cmd/config/subcommand/taskresourceattribute/file_config_test.go +++ b/flytectl/cmd/config/subcommand/taskresourceattribute/file_config_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go b/flytectl/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go index 45454f4536..a4fa81cbbb 100644 --- a/flytectl/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go +++ b/flytectl/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/configuration/configuration.go b/flytectl/cmd/configuration/configuration.go index d3374233ba..ecbedba721 100644 --- a/flytectl/cmd/configuration/configuration.go +++ b/flytectl/cmd/configuration/configuration.go @@ -8,13 +8,11 @@ import ( "os" "strings" - "github.com/flyteorg/flyte/flytectl/pkg/util" - - "github.com/flyteorg/flyte/flytectl/pkg/configutil" - initConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/config" cmdcore "github.com/flyteorg/flyte/flytectl/cmd/core" cmdUtil "github.com/flyteorg/flyte/flytectl/pkg/commandutils" + "github.com/flyteorg/flyte/flytectl/pkg/configutil" + "github.com/flyteorg/flyte/flytectl/pkg/util" "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/go-ozzo/ozzo-validation/v4/is" "github.com/spf13/cobra" diff --git a/flytectl/cmd/configuration/configuration_test.go b/flytectl/cmd/configuration/configuration_test.go index 844d2ee6b7..7438faeedb 100644 --- a/flytectl/cmd/configuration/configuration_test.go +++ b/flytectl/cmd/configuration/configuration_test.go @@ -9,14 +9,11 @@ import ( "strings" "testing" - admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - - "github.com/flyteorg/flyte/flytectl/pkg/configutil" - initConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/config" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/pkg/configutil" "github.com/flyteorg/flyte/flytectl/pkg/util" - + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/core/cmd.go b/flytectl/cmd/core/cmd.go index b2bd77c317..92e50f4e7d 100644 --- a/flytectl/cmd/core/cmd.go +++ b/flytectl/cmd/core/cmd.go @@ -4,16 +4,14 @@ import ( "context" "fmt" - "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/pkg/pkce" "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - + "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/pflag" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) type PFlagProvider interface { diff --git a/flytectl/cmd/core/cmd_ctx.go b/flytectl/cmd/core/cmd_ctx.go index 980d9ee395..35e9945e59 100644 --- a/flytectl/cmd/core/cmd_ctx.go +++ b/flytectl/cmd/core/cmd_ctx.go @@ -3,9 +3,8 @@ package cmdcore import ( "io" - "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - "github.com/flyteorg/flyte/flytectl/pkg/ext" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) diff --git a/flytectl/cmd/core/cmd_test.go b/flytectl/cmd/core/cmd_test.go index 13737b4a61..e3a1843105 100644 --- a/flytectl/cmd/core/cmd_test.go +++ b/flytectl/cmd/core/cmd_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/spf13/cobra" "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/create/create.go b/flytectl/cmd/create/create.go index eaecf4c833..06b1ebe939 100644 --- a/flytectl/cmd/create/create.go +++ b/flytectl/cmd/create/create.go @@ -3,7 +3,6 @@ package create import ( "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/project" cmdcore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/spf13/cobra" ) diff --git a/flytectl/cmd/create/create_test.go b/flytectl/cmd/create/create_test.go index 5dbe600254..b7b5a2c32c 100644 --- a/flytectl/cmd/create/create_test.go +++ b/flytectl/cmd/create/create_test.go @@ -4,9 +4,8 @@ import ( "sort" "testing" - "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" + "github.com/stretchr/testify/assert" ) const testDataFolder = "../testdata/" diff --git a/flytectl/cmd/create/execution.go b/flytectl/cmd/create/execution.go index 84b6e2dad9..5da311357b 100644 --- a/flytectl/cmd/create/execution.go +++ b/flytectl/cmd/create/execution.go @@ -4,11 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytectl/cmd/config" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flytectl/cmd/create/execution_test.go b/flytectl/cmd/create/execution_test.go index ce418df9e7..4886e2e7b8 100644 --- a/flytectl/cmd/create/execution_test.go +++ b/flytectl/cmd/create/execution_test.go @@ -4,17 +4,15 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flytectl/cmd/config" + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "google.golang.org/protobuf/types/known/timestamppb" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytectl/cmd/config" - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" ) type createSuite struct { diff --git a/flytectl/cmd/create/execution_util.go b/flytectl/cmd/create/execution_util.go index 060d22dddf..7ebb757a29 100644 --- a/flytectl/cmd/create/execution_util.go +++ b/flytectl/cmd/create/execution_util.go @@ -6,14 +6,13 @@ import ( "io/ioutil" "strings" + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + cmdGet "github.com/flyteorg/flyte/flytectl/cmd/get" "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/logger" "github.com/google/uuid" "sigs.k8s.io/yaml" - - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - cmdGet "github.com/flyteorg/flyte/flytectl/cmd/get" ) func createExecutionRequestForWorkflow(ctx context.Context, workflowName, project, domain string, diff --git a/flytectl/cmd/create/execution_util_test.go b/flytectl/cmd/create/execution_util_test.go index ab6391c983..000e3621d3 100644 --- a/flytectl/cmd/create/execution_util_test.go +++ b/flytectl/cmd/create/execution_util_test.go @@ -5,11 +5,9 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytectl/cmd/config" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/create/project.go b/flytectl/cmd/create/project.go index 24d12f3533..fa1046a248 100644 --- a/flytectl/cmd/create/project.go +++ b/flytectl/cmd/create/project.go @@ -7,9 +7,8 @@ import ( "github.com/flyteorg/flyte/flytectl/clierrors" "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/project" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flytectl/cmd/create/project_test.go b/flytectl/cmd/create/project_test.go index 302efc8b5e..1d63c0fceb 100644 --- a/flytectl/cmd/create/project_test.go +++ b/flytectl/cmd/create/project_test.go @@ -6,12 +6,9 @@ import ( "testing" "github.com/flyteorg/flyte/flytectl/clierrors" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/project" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/delete/delete.go b/flytectl/cmd/delete/delete.go index 19a8107116..26d930a8a6 100644 --- a/flytectl/cmd/delete/delete.go +++ b/flytectl/cmd/delete/delete.go @@ -9,7 +9,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/taskresourceattribute" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdcore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/spf13/cobra" ) diff --git a/flytectl/cmd/delete/delete_test.go b/flytectl/cmd/delete/delete_test.go index 3d5df42dcb..0184450305 100644 --- a/flytectl/cmd/delete/delete_test.go +++ b/flytectl/cmd/delete/delete_test.go @@ -4,9 +4,8 @@ import ( "sort" "testing" - "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" + "github.com/stretchr/testify/assert" ) const ( diff --git a/flytectl/cmd/delete/execution_test.go b/flytectl/cmd/delete/execution_test.go index 73d51a02ae..c883a4d4df 100644 --- a/flytectl/cmd/delete/execution_test.go +++ b/flytectl/cmd/delete/execution_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" "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" ) diff --git a/flytectl/cmd/delete/matchable_cluster_resource_attribute_test.go b/flytectl/cmd/delete/matchable_cluster_resource_attribute_test.go index 26ddd8b468..f2fe9ca49e 100644 --- a/flytectl/cmd/delete/matchable_cluster_resource_attribute_test.go +++ b/flytectl/cmd/delete/matchable_cluster_resource_attribute_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/clusterresourceattribute" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/delete/matchable_execution_cluster_label_test.go b/flytectl/cmd/delete/matchable_execution_cluster_label_test.go index 9868b2045f..7335bd6721 100644 --- a/flytectl/cmd/delete/matchable_execution_cluster_label_test.go +++ b/flytectl/cmd/delete/matchable_execution_cluster_label_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/executionclusterlabel" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/delete/matchable_execution_queue_attribute_test.go b/flytectl/cmd/delete/matchable_execution_queue_attribute_test.go index d338bc529d..20402ee79b 100644 --- a/flytectl/cmd/delete/matchable_execution_queue_attribute_test.go +++ b/flytectl/cmd/delete/matchable_execution_queue_attribute_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/executionqueueattribute" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/delete/matchable_plugin_override_test.go b/flytectl/cmd/delete/matchable_plugin_override_test.go index 80e519a32b..623729fdd2 100644 --- a/flytectl/cmd/delete/matchable_plugin_override_test.go +++ b/flytectl/cmd/delete/matchable_plugin_override_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" pluginoverride "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/plugin_override" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/delete/matchable_task_resource_attribute_test.go b/flytectl/cmd/delete/matchable_task_resource_attribute_test.go index 867a38af6a..484052b6ab 100644 --- a/flytectl/cmd/delete/matchable_task_resource_attribute_test.go +++ b/flytectl/cmd/delete/matchable_task_resource_attribute_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/taskresourceattribute" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/delete/matchable_workflow_execution_config.go b/flytectl/cmd/delete/matchable_workflow_execution_config.go index 65dabb5f20..ce778d714a 100644 --- a/flytectl/cmd/delete/matchable_workflow_execution_config.go +++ b/flytectl/cmd/delete/matchable_workflow_execution_config.go @@ -3,10 +3,9 @@ package delete import ( "context" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/flyteorg/flyte/flytectl/cmd/config" sconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand" + "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) diff --git a/flytectl/cmd/delete/matchable_workflow_execution_config_test.go b/flytectl/cmd/delete/matchable_workflow_execution_config_test.go index fe0e76fdec..88681a32d5 100644 --- a/flytectl/cmd/delete/matchable_workflow_execution_config_test.go +++ b/flytectl/cmd/delete/matchable_workflow_execution_config_test.go @@ -4,11 +4,9 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/flyteorg/flyte/flytectl/cmd/config" + "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/demo/exec_test.go b/flytectl/cmd/demo/exec_test.go index ac6a82b8d0..1d4fcea214 100644 --- a/flytectl/cmd/demo/exec_test.go +++ b/flytectl/cmd/demo/exec_test.go @@ -8,16 +8,13 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - - admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/stretchr/testify/assert" - "github.com/docker/docker/api/types" + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/docker" "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/demo/start.go b/flytectl/cmd/demo/start.go index 153bae47bd..fa3de39101 100644 --- a/flytectl/cmd/demo/start.go +++ b/flytectl/cmd/demo/start.go @@ -3,12 +3,10 @@ package demo import ( "context" - "github.com/flyteorg/flyte/flytectl/pkg/docker" - - "github.com/flyteorg/flyte/flytectl/pkg/sandbox" - sandboxCmdConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/sandbox" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/pkg/docker" + "github.com/flyteorg/flyte/flytectl/pkg/sandbox" ) const ( diff --git a/flytectl/cmd/demo/status.go b/flytectl/cmd/demo/status.go index 33063b04c2..8dc06e20a1 100644 --- a/flytectl/cmd/demo/status.go +++ b/flytectl/cmd/demo/status.go @@ -3,10 +3,9 @@ package demo import ( "context" - "github.com/flyteorg/flyte/flytectl/pkg/sandbox" - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/pkg/docker" + "github.com/flyteorg/flyte/flytectl/pkg/sandbox" ) const ( diff --git a/flytectl/cmd/demo/status_test.go b/flytectl/cmd/demo/status_test.go index 2e26a21a77..0f6dd68ad0 100644 --- a/flytectl/cmd/demo/status_test.go +++ b/flytectl/cmd/demo/status_test.go @@ -3,9 +3,8 @@ package demo import ( "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/docker/docker/api/types" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/docker" "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" "github.com/stretchr/testify/assert" diff --git a/flytectl/cmd/demo/teardown.go b/flytectl/cmd/demo/teardown.go index 9df954acfe..7bcba4fb79 100644 --- a/flytectl/cmd/demo/teardown.go +++ b/flytectl/cmd/demo/teardown.go @@ -3,11 +3,10 @@ package demo import ( "context" - "github.com/flyteorg/flyte/flytectl/pkg/docker" - "github.com/flyteorg/flyte/flytectl/pkg/sandbox" - sandboxCmdConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/sandbox" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/pkg/docker" + "github.com/flyteorg/flyte/flytectl/pkg/sandbox" ) const ( diff --git a/flytectl/cmd/get/execution.go b/flytectl/cmd/get/execution.go index 4c11830c86..8bfcc36e00 100644 --- a/flytectl/cmd/get/execution.go +++ b/flytectl/cmd/get/execution.go @@ -7,13 +7,11 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/execution" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytectl/pkg/bubbletea" "github.com/flyteorg/flyte/flytectl/pkg/filters" "github.com/flyteorg/flyte/flytectl/pkg/printer" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" ) diff --git a/flytectl/cmd/get/execution_test.go b/flytectl/cmd/get/execution_test.go index 51a1a1f825..329211621a 100644 --- a/flytectl/cmd/get/execution_test.go +++ b/flytectl/cmd/get/execution_test.go @@ -6,13 +6,11 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/execution" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "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" ) diff --git a/flytectl/cmd/get/execution_util.go b/flytectl/cmd/get/execution_util.go index 2123e885f5..45214a7ac8 100644 --- a/flytectl/cmd/get/execution_util.go +++ b/flytectl/cmd/get/execution_util.go @@ -6,14 +6,12 @@ import ( "io/ioutil" "os" - structpb "github.com/golang/protobuf/ptypes/struct" - - "gopkg.in/yaml.v3" - cmdUtil "github.com/flyteorg/flyte/flytectl/pkg/commandutils" "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" + structpb "github.com/golang/protobuf/ptypes/struct" + "gopkg.in/yaml.v3" ) // ExecutionConfig is duplicated struct from create with the same structure. This is to avoid the circular dependency. Only works with go-yaml. diff --git a/flytectl/cmd/get/execution_util_test.go b/flytectl/cmd/get/execution_util_test.go index ff316ca4e0..2c081950f2 100644 --- a/flytectl/cmd/get/execution_util_test.go +++ b/flytectl/cmd/get/execution_util_test.go @@ -6,7 +6,6 @@ import ( "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" - "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/flytectl/cmd/get/get.go b/flytectl/cmd/get/get.go index b61273233b..fbc820d892 100644 --- a/flytectl/cmd/get/get.go +++ b/flytectl/cmd/get/get.go @@ -13,7 +13,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflow" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdcore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/spf13/cobra" ) diff --git a/flytectl/cmd/get/get_test.go b/flytectl/cmd/get/get_test.go index dc2522937e..c40394c785 100644 --- a/flytectl/cmd/get/get_test.go +++ b/flytectl/cmd/get/get_test.go @@ -5,9 +5,8 @@ import ( "sort" "testing" - "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" + "github.com/stretchr/testify/assert" ) const projectValue = "dummyProject" diff --git a/flytectl/cmd/get/launch_plan_test.go b/flytectl/cmd/get/launch_plan_test.go index 8f67c64e33..c197ec111e 100644 --- a/flytectl/cmd/get/launch_plan_test.go +++ b/flytectl/cmd/get/launch_plan_test.go @@ -5,23 +5,17 @@ import ( "os" "testing" - structpb "github.com/golang/protobuf/ptypes/struct" - - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - - "github.com/flyteorg/flyte/flytectl/pkg/printer" - - "github.com/flyteorg/flyte/flytectl/pkg/filters" - - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/launchplan" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext/mocks" + "github.com/flyteorg/flyte/flytectl/pkg/filters" + "github.com/flyteorg/flyte/flytectl/pkg/printer" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + structpb "github.com/golang/protobuf/ptypes/struct" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/flytectl/cmd/get/matchable_cluster_resource_attribute_test.go b/flytectl/cmd/get/matchable_cluster_resource_attribute_test.go index 25e7f31a67..43069edaa6 100644 --- a/flytectl/cmd/get/matchable_cluster_resource_attribute_test.go +++ b/flytectl/cmd/get/matchable_cluster_resource_attribute_test.go @@ -5,12 +5,10 @@ import ( "os" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/clusterresourceattribute" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/get/matchable_execution_cluster_label_test.go b/flytectl/cmd/get/matchable_execution_cluster_label_test.go index cf0bac5b24..3ac42a87de 100644 --- a/flytectl/cmd/get/matchable_execution_cluster_label_test.go +++ b/flytectl/cmd/get/matchable_execution_cluster_label_test.go @@ -5,12 +5,10 @@ import ( "os" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/executionclusterlabel" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/get/matchable_execution_queue_attribute_test.go b/flytectl/cmd/get/matchable_execution_queue_attribute_test.go index fd4a6ddb11..3dd8e235cf 100644 --- a/flytectl/cmd/get/matchable_execution_queue_attribute_test.go +++ b/flytectl/cmd/get/matchable_execution_queue_attribute_test.go @@ -5,12 +5,10 @@ import ( "os" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/executionqueueattribute" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/get/matchable_plugin_override_test.go b/flytectl/cmd/get/matchable_plugin_override_test.go index 91bfedc7a7..025267a462 100644 --- a/flytectl/cmd/get/matchable_plugin_override_test.go +++ b/flytectl/cmd/get/matchable_plugin_override_test.go @@ -5,12 +5,10 @@ import ( "os" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" pluginoverride "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/plugin_override" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/get/matchable_task_resource_attribute_test.go b/flytectl/cmd/get/matchable_task_resource_attribute_test.go index d0e180fd2c..b5e8887583 100644 --- a/flytectl/cmd/get/matchable_task_resource_attribute_test.go +++ b/flytectl/cmd/get/matchable_task_resource_attribute_test.go @@ -5,12 +5,10 @@ import ( "os" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/taskresourceattribute" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/get/matchable_workflow_execution_config.go b/flytectl/cmd/get/matchable_workflow_execution_config.go index 57589e0d3b..6c1e3249d2 100644 --- a/flytectl/cmd/get/matchable_workflow_execution_config.go +++ b/flytectl/cmd/get/matchable_workflow_execution_config.go @@ -10,7 +10,6 @@ import ( cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/flytectl/cmd/get/matchable_workflow_execution_config_test.go b/flytectl/cmd/get/matchable_workflow_execution_config_test.go index 0011fe389e..69b88ee900 100644 --- a/flytectl/cmd/get/matchable_workflow_execution_config_test.go +++ b/flytectl/cmd/get/matchable_workflow_execution_config_test.go @@ -5,12 +5,10 @@ import ( "os" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/get/node_execution.go b/flytectl/cmd/get/node_execution.go index 6c7e259d58..7b2e7a9e88 100644 --- a/flytectl/cmd/get/node_execution.go +++ b/flytectl/cmd/get/node_execution.go @@ -7,13 +7,12 @@ import ( "sort" "strconv" + "github.com/disiqueira/gotree" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/pkg/printer" "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/disiqueira/gotree" "github.com/golang/protobuf/jsonpb" ) diff --git a/flytectl/cmd/get/node_execution_test.go b/flytectl/cmd/get/node_execution_test.go index f4d6040513..588ea6033c 100644 --- a/flytectl/cmd/get/node_execution_test.go +++ b/flytectl/cmd/get/node_execution_test.go @@ -5,13 +5,11 @@ import ( "testing" "time" + "github.com/disiqueira/gotree" "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "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/disiqueira/gotree" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/protobuf/types/known/durationpb" diff --git a/flytectl/cmd/get/project.go b/flytectl/cmd/get/project.go index 0b66055f65..96b68c56fb 100644 --- a/flytectl/cmd/get/project.go +++ b/flytectl/cmd/get/project.go @@ -3,15 +3,13 @@ package get import ( "context" + "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/project" - + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/pkg/printer" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flytectl/cmd/config" - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/flyteorg/flyte/flytectl/pkg/printer" ) const ( diff --git a/flytectl/cmd/get/project_test.go b/flytectl/cmd/get/project_test.go index a230cbb19f..7bcc55a236 100644 --- a/flytectl/cmd/get/project_test.go +++ b/flytectl/cmd/get/project_test.go @@ -4,10 +4,8 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/project" - + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/filters" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" diff --git a/flytectl/cmd/get/task_test.go b/flytectl/cmd/get/task_test.go index c5379ab4f9..27e65d3fef 100644 --- a/flytectl/cmd/get/task_test.go +++ b/flytectl/cmd/get/task_test.go @@ -5,21 +5,15 @@ import ( "os" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" - taskConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/task" - - "github.com/flyteorg/flyte/flytectl/pkg/filters" - - "github.com/stretchr/testify/mock" - + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext/mocks" + "github.com/flyteorg/flyte/flytectl/pkg/filters" "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/protobuf/types/known/timestamppb" ) diff --git a/flytectl/cmd/get/workflow.go b/flytectl/cmd/get/workflow.go index c90d152f21..4fa8f93928 100644 --- a/flytectl/cmd/get/workflow.go +++ b/flytectl/cmd/get/workflow.go @@ -3,16 +3,14 @@ package get import ( "context" - workflowconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflow" - "github.com/flyteorg/flyte/flytectl/pkg/ext" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/golang/protobuf/proto" - "github.com/flyteorg/flyte/flytectl/cmd/config" + workflowconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflow" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flytectl/pkg/printer" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" ) const ( diff --git a/flytectl/cmd/get/workflow_test.go b/flytectl/cmd/get/workflow_test.go index 32ef21a938..118ad03521 100644 --- a/flytectl/cmd/get/workflow_test.go +++ b/flytectl/cmd/get/workflow_test.go @@ -4,22 +4,17 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/cmd/config" + "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflow" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flytectl/pkg/ext/mocks" "github.com/flyteorg/flyte/flytectl/pkg/filters" "github.com/flyteorg/flyte/flytectl/pkg/printer" - - "google.golang.org/protobuf/types/known/timestamppb" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "github.com/flyteorg/flyte/flytectl/pkg/ext/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/flytectl/cmd/config/subcommand/workflow" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/types/known/timestamppb" ) var ( diff --git a/flytectl/cmd/register/examples.go b/flytectl/cmd/register/examples.go index ed90ba1253..6ede75becc 100644 --- a/flytectl/cmd/register/examples.go +++ b/flytectl/cmd/register/examples.go @@ -9,7 +9,6 @@ import ( cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" g "github.com/flyteorg/flyte/flytectl/pkg/github" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/google/go-github/v42/github" ) diff --git a/flytectl/cmd/register/files.go b/flytectl/cmd/register/files.go index b3311117a3..ae56994207 100644 --- a/flytectl/cmd/register/files.go +++ b/flytectl/cmd/register/files.go @@ -7,13 +7,11 @@ import ( "os" "github.com/flyteorg/flyte/flytectl/cmd/config" - - "github.com/flyteorg/flyte/flytestdlib/storage" - rconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/register" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/pkg/printer" "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const ( diff --git a/flytectl/cmd/register/files_test.go b/flytectl/cmd/register/files_test.go index f5b221989a..45827b7e13 100644 --- a/flytectl/cmd/register/files_test.go +++ b/flytectl/cmd/register/files_test.go @@ -4,16 +4,14 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flytectl/cmd/config" + rconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/register" "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - - "github.com/flyteorg/flyte/flytectl/cmd/config" "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" - - rconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/register" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/register/register.go b/flytectl/cmd/register/register.go index 1de031fc51..bc4b2e8fed 100644 --- a/flytectl/cmd/register/register.go +++ b/flytectl/cmd/register/register.go @@ -3,7 +3,6 @@ package register import ( rconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/register" cmdcore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/spf13/cobra" ) diff --git a/flytectl/cmd/register/register_util.go b/flytectl/cmd/register/register_util.go index c968623a8d..0bf5a23d49 100644 --- a/flytectl/cmd/register/register_util.go +++ b/flytectl/cmd/register/register_util.go @@ -18,29 +18,24 @@ import ( "strconv" "strings" - errors2 "github.com/flyteorg/flyte/flytestdlib/errors" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - - g "github.com/flyteorg/flyte/flytectl/pkg/github" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/flyteorg/flyte/flytectl/cmd/config" rconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/register" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + g "github.com/flyteorg/flyte/flytectl/pkg/github" "github.com/flyteorg/flyte/flytectl/pkg/printer" "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/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/google/go-github/v42/github" - + "github.com/flyteorg/flyte/flytestdlib/utils" "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + "github.com/google/go-github/v42/github" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" v1 "k8s.io/api/core/v1" diff --git a/flytectl/cmd/register/register_util_test.go b/flytectl/cmd/register/register_util_test.go index 97148862f5..b6625c27de 100644 --- a/flytectl/cmd/register/register_util_test.go +++ b/flytectl/cmd/register/register_util_test.go @@ -12,30 +12,24 @@ import ( "strings" "testing" + rconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/register" ghMocks "github.com/flyteorg/flyte/flytectl/pkg/github/mocks" "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/service" - - "github.com/flyteorg/flyte/flytestdlib/utils" - - v1 "k8s.io/api/core/v1" - "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/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - rconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/register" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - + "github.com/flyteorg/flyte/flytestdlib/utils" "github.com/google/go-github/v42/github" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/durationpb" + v1 "k8s.io/api/core/v1" ) type MockHTTPClient struct { diff --git a/flytectl/cmd/root.go b/flytectl/cmd/root.go index 112fa4074c..6806cae236 100644 --- a/flytectl/cmd/root.go +++ b/flytectl/cmd/root.go @@ -22,7 +22,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/printer" stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" diff --git a/flytectl/cmd/sandbox/exec_test.go b/flytectl/cmd/sandbox/exec_test.go index 828c47ba4e..6646d39cd9 100644 --- a/flytectl/cmd/sandbox/exec_test.go +++ b/flytectl/cmd/sandbox/exec_test.go @@ -8,16 +8,13 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - - admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/stretchr/testify/assert" - "github.com/docker/docker/api/types" + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/docker" "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/cmd/sandbox/status.go b/flytectl/cmd/sandbox/status.go index 64dd502065..e5a3fc46e7 100644 --- a/flytectl/cmd/sandbox/status.go +++ b/flytectl/cmd/sandbox/status.go @@ -3,10 +3,9 @@ package sandbox import ( "context" - "github.com/flyteorg/flyte/flytectl/pkg/sandbox" - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/pkg/docker" + "github.com/flyteorg/flyte/flytectl/pkg/sandbox" ) const ( diff --git a/flytectl/cmd/sandbox/status_test.go b/flytectl/cmd/sandbox/status_test.go index 1bdae48561..ab2be170ed 100644 --- a/flytectl/cmd/sandbox/status_test.go +++ b/flytectl/cmd/sandbox/status_test.go @@ -3,9 +3,8 @@ package sandbox import ( "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/docker/docker/api/types" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/docker" "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" "github.com/stretchr/testify/assert" diff --git a/flytectl/cmd/sandbox/teardown.go b/flytectl/cmd/sandbox/teardown.go index 6ee747f637..8e68ffafb5 100644 --- a/flytectl/cmd/sandbox/teardown.go +++ b/flytectl/cmd/sandbox/teardown.go @@ -3,11 +3,10 @@ package sandbox import ( "context" - "github.com/flyteorg/flyte/flytectl/pkg/docker" - "github.com/flyteorg/flyte/flytectl/pkg/sandbox" - sandboxCmdConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/sandbox" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/pkg/docker" + "github.com/flyteorg/flyte/flytectl/pkg/sandbox" ) const ( diff --git a/flytectl/cmd/testutils/test_utils.go b/flytectl/cmd/testutils/test_utils.go index 87b3b80044..1e2bba1365 100644 --- a/flytectl/cmd/testutils/test_utils.go +++ b/flytectl/cmd/testutils/test_utils.go @@ -12,14 +12,13 @@ import ( "strings" "testing" - "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytectl/cmd/config" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" extMocks "github.com/flyteorg/flyte/flytectl/pkg/ext/mocks" "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flytestdlib/utils" + "github.com/stretchr/testify/assert" ) const projectValue = "dummyProject" diff --git a/flytectl/cmd/update/execution_test.go b/flytectl/cmd/update/execution_test.go index 3401d77d41..d8e2db59e7 100644 --- a/flytectl/cmd/update/execution_test.go +++ b/flytectl/cmd/update/execution_test.go @@ -10,7 +10,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/ext" "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" ) diff --git a/flytectl/cmd/update/launch_plan_meta_test.go b/flytectl/cmd/update/launch_plan_meta_test.go index df6cd624d1..63d4ded737 100644 --- a/flytectl/cmd/update/launch_plan_meta_test.go +++ b/flytectl/cmd/update/launch_plan_meta_test.go @@ -8,7 +8,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/ext" "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" ) diff --git a/flytectl/cmd/update/launch_plan_test.go b/flytectl/cmd/update/launch_plan_test.go index 93a19b2241..5704702a2e 100644 --- a/flytectl/cmd/update/launch_plan_test.go +++ b/flytectl/cmd/update/launch_plan_test.go @@ -10,7 +10,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/ext" "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" ) diff --git a/flytectl/cmd/update/matchable_cluster_resource_attribute_test.go b/flytectl/cmd/update/matchable_cluster_resource_attribute_test.go index 3dad6643ee..c902794685 100644 --- a/flytectl/cmd/update/matchable_cluster_resource_attribute_test.go +++ b/flytectl/cmd/update/matchable_cluster_resource_attribute_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/clusterresourceattribute" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) const ( diff --git a/flytectl/cmd/update/matchable_execution_cluster_label_test.go b/flytectl/cmd/update/matchable_execution_cluster_label_test.go index cdcc2f05b3..0bbccbc83b 100644 --- a/flytectl/cmd/update/matchable_execution_cluster_label_test.go +++ b/flytectl/cmd/update/matchable_execution_cluster_label_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/executionclusterlabel" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) const ( diff --git a/flytectl/cmd/update/matchable_execution_queue_attribute_test.go b/flytectl/cmd/update/matchable_execution_queue_attribute_test.go index 3e536b9947..a88dc80717 100644 --- a/flytectl/cmd/update/matchable_execution_queue_attribute_test.go +++ b/flytectl/cmd/update/matchable_execution_queue_attribute_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/executionqueueattribute" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) const ( diff --git a/flytectl/cmd/update/matchable_plugin_override_test.go b/flytectl/cmd/update/matchable_plugin_override_test.go index b0dc9bade0..3207951db6 100644 --- a/flytectl/cmd/update/matchable_plugin_override_test.go +++ b/flytectl/cmd/update/matchable_plugin_override_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - pluginoverride "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/plugin_override" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) const ( diff --git a/flytectl/cmd/update/matchable_task_resource_attribute_test.go b/flytectl/cmd/update/matchable_task_resource_attribute_test.go index d3119bcbae..6e54b17e34 100644 --- a/flytectl/cmd/update/matchable_task_resource_attribute_test.go +++ b/flytectl/cmd/update/matchable_task_resource_attribute_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/taskresourceattribute" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) const ( diff --git a/flytectl/cmd/update/matchable_workflow_execution_config.go b/flytectl/cmd/update/matchable_workflow_execution_config.go index 3e327c8e18..b5647ede17 100644 --- a/flytectl/cmd/update/matchable_workflow_execution_config.go +++ b/flytectl/cmd/update/matchable_workflow_execution_config.go @@ -4,11 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - sconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand" + "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/flytectl/cmd/update/matchable_workflow_execution_config_test.go b/flytectl/cmd/update/matchable_workflow_execution_config_test.go index 963dde4e73..06e0996d37 100644 --- a/flytectl/cmd/update/matchable_workflow_execution_config_test.go +++ b/flytectl/cmd/update/matchable_workflow_execution_config_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) const ( diff --git a/flytectl/cmd/update/named_entity_test.go b/flytectl/cmd/update/named_entity_test.go index 61303d5e65..2dbb50fba5 100644 --- a/flytectl/cmd/update/named_entity_test.go +++ b/flytectl/cmd/update/named_entity_test.go @@ -4,13 +4,12 @@ import ( "context" "fmt" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/mock" ) func testNamedEntityUpdate( diff --git a/flytectl/cmd/update/project.go b/flytectl/cmd/update/project.go index c89861741f..38f959ba38 100644 --- a/flytectl/cmd/update/project.go +++ b/flytectl/cmd/update/project.go @@ -5,13 +5,12 @@ import ( "fmt" "os" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytectl/clierrors" "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/project" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" cmdUtil "github.com/flyteorg/flyte/flytectl/pkg/commandutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/flytectl/cmd/update/project_test.go b/flytectl/cmd/update/project_test.go index 6bf8084cc8..c5785e0a12 100644 --- a/flytectl/cmd/update/project_test.go +++ b/flytectl/cmd/update/project_test.go @@ -4,14 +4,13 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flytectl/cmd/config" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/project" "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/ext" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) func TestProjectCanBeActivated(t *testing.T) { diff --git a/flytectl/cmd/update/task_meta_test.go b/flytectl/cmd/update/task_meta_test.go index a3550418bc..09cc573115 100644 --- a/flytectl/cmd/update/task_meta_test.go +++ b/flytectl/cmd/update/task_meta_test.go @@ -8,7 +8,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/ext" "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" ) diff --git a/flytectl/cmd/update/update.go b/flytectl/cmd/update/update.go index 11c3183639..4cf1b4f208 100644 --- a/flytectl/cmd/update/update.go +++ b/flytectl/cmd/update/update.go @@ -11,7 +11,6 @@ import ( "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/taskresourceattribute" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/spf13/cobra" ) diff --git a/flytectl/cmd/update/workflow_meta_test.go b/flytectl/cmd/update/workflow_meta_test.go index 157b79bc93..05589ee6c7 100644 --- a/flytectl/cmd/update/workflow_meta_test.go +++ b/flytectl/cmd/update/workflow_meta_test.go @@ -8,7 +8,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/ext" "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" ) diff --git a/flytectl/cmd/upgrade/upgrade.go b/flytectl/cmd/upgrade/upgrade.go index 5d91848720..c4ad132c30 100644 --- a/flytectl/cmd/upgrade/upgrade.go +++ b/flytectl/cmd/upgrade/upgrade.go @@ -8,17 +8,13 @@ import ( "runtime" "strings" - "github.com/flyteorg/flyte/flytectl/pkg/util" - - stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" - + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/pkg/github" - + "github.com/flyteorg/flyte/flytectl/pkg/platformutil" + "github.com/flyteorg/flyte/flytectl/pkg/util" "github.com/flyteorg/flyte/flytestdlib/logger" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/mouuff/go-rocket-update/pkg/updater" - - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" - "github.com/flyteorg/flyte/flytectl/pkg/platformutil" "github.com/spf13/cobra" ) diff --git a/flytectl/cmd/upgrade/upgrade_test.go b/flytectl/cmd/upgrade/upgrade_test.go index 5cb52f2e98..a8a955639e 100644 --- a/flytectl/cmd/upgrade/upgrade_test.go +++ b/flytectl/cmd/upgrade/upgrade_test.go @@ -5,16 +5,12 @@ import ( "sort" "testing" + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flytectl/pkg/github" - "github.com/flyteorg/flyte/flytectl/pkg/util" - "github.com/flyteorg/flyte/flytectl/pkg/platformutil" - + "github.com/flyteorg/flyte/flytectl/pkg/util" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" - - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" ) diff --git a/flytectl/cmd/version/version.go b/flytectl/cmd/version/version.go index 7ff69cae29..38b61d5538 100644 --- a/flytectl/cmd/version/version.go +++ b/flytectl/cmd/version/version.go @@ -6,11 +6,9 @@ import ( "fmt" "runtime" + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/pkg/github" - "github.com/flyteorg/flyte/flytectl/pkg/platformutil" - - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" diff --git a/flytectl/cmd/version/version_test.go b/flytectl/cmd/version/version_test.go index d9453f4063..a1abbd7883 100644 --- a/flytectl/cmd/version/version_test.go +++ b/flytectl/cmd/version/version_test.go @@ -8,16 +8,13 @@ import ( "sort" "testing" + cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flytectl/cmd/testutils" - admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - - "github.com/spf13/cobra" - - cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" + "github.com/spf13/cobra" "github.com/stretchr/testify/assert" ) diff --git a/flytectl/pkg/bubbletea/bubbletea_pagination.go b/flytectl/pkg/bubbletea/bubbletea_pagination.go index 3b8f5319b5..01a4b7ea98 100644 --- a/flytectl/pkg/bubbletea/bubbletea_pagination.go +++ b/flytectl/pkg/bubbletea/bubbletea_pagination.go @@ -9,12 +9,11 @@ import ( "github.com/charmbracelet/bubbles/key" "github.com/charmbracelet/bubbles/paginator" "github.com/charmbracelet/bubbles/spinner" + tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "github.com/flyteorg/flyte/flytectl/pkg/filters" "github.com/flyteorg/flyte/flytectl/pkg/printer" "github.com/golang/protobuf/proto" - - tea "github.com/charmbracelet/bubbletea" ) var ( diff --git a/flytectl/pkg/bubbletea/bubbletea_pagination_util.go b/flytectl/pkg/bubbletea/bubbletea_pagination_util.go index 21e624ffed..dc6ddd735b 100644 --- a/flytectl/pkg/bubbletea/bubbletea_pagination_util.go +++ b/flytectl/pkg/bubbletea/bubbletea_pagination_util.go @@ -10,7 +10,6 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/flyteorg/flyte/flytectl/pkg/filters" "github.com/flyteorg/flyte/flytectl/pkg/printer" - "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" ) diff --git a/flytectl/pkg/docker/docker_util.go b/flytectl/pkg/docker/docker_util.go index f2c98da418..c4751a0a0f 100644 --- a/flytectl/pkg/docker/docker_util.go +++ b/flytectl/pkg/docker/docker_util.go @@ -9,17 +9,16 @@ import ( "os" "strings" - "github.com/docker/docker/client" - "github.com/enescakir/emoji" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/volume" + "github.com/docker/docker/client" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/go-connections/nat" + "github.com/enescakir/emoji" "github.com/flyteorg/flyte/flytectl/clierrors" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/docker" cmdUtil "github.com/flyteorg/flyte/flytectl/pkg/commandutils" diff --git a/flytectl/pkg/docker/docker_util_test.go b/flytectl/pkg/docker/docker_util_test.go index fa99e88c8a..feae21352c 100644 --- a/flytectl/pkg/docker/docker_util_test.go +++ b/flytectl/pkg/docker/docker_util_test.go @@ -12,18 +12,15 @@ import ( "testing" "time" - f "github.com/flyteorg/flyte/flytectl/pkg/filesystemutils" - + "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/volume" - "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" - - "github.com/stretchr/testify/mock" - - "github.com/docker/docker/api/types" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/docker" + "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" + f "github.com/flyteorg/flyte/flytectl/pkg/filesystemutils" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) var ( diff --git a/flytectl/pkg/ext/attribute_match_deleter_test.go b/flytectl/pkg/ext/attribute_match_deleter_test.go index 885eff0585..0655419e9e 100644 --- a/flytectl/pkg/ext/attribute_match_deleter_test.go +++ b/flytectl/pkg/ext/attribute_match_deleter_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/pkg/ext/attribute_match_fetcher.go b/flytectl/pkg/ext/attribute_match_fetcher.go index eca2ce8e15..0665f59e8e 100644 --- a/flytectl/pkg/ext/attribute_match_fetcher.go +++ b/flytectl/pkg/ext/attribute_match_fetcher.go @@ -3,10 +3,9 @@ package ext import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func (a *AdminFetcherExtClient) FetchWorkflowAttributes(ctx context.Context, project, domain, name string, diff --git a/flytectl/pkg/ext/attribute_match_fetcher_test.go b/flytectl/pkg/ext/attribute_match_fetcher_test.go index b9ecff16d6..43edba5ec1 100644 --- a/flytectl/pkg/ext/attribute_match_fetcher_test.go +++ b/flytectl/pkg/ext/attribute_match_fetcher_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/pkg/ext/attribute_match_updater_test.go b/flytectl/pkg/ext/attribute_match_updater_test.go index 1fab0f6795..4525865e50 100644 --- a/flytectl/pkg/ext/attribute_match_updater_test.go +++ b/flytectl/pkg/ext/attribute_match_updater_test.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/flytectl/pkg/ext/execution_fetcher_test.go b/flytectl/pkg/ext/execution_fetcher_test.go index 304f929880..2a5fb1c712 100644 --- a/flytectl/pkg/ext/execution_fetcher_test.go +++ b/flytectl/pkg/ext/execution_fetcher_test.go @@ -8,7 +8,6 @@ import ( "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" ) diff --git a/flytectl/pkg/ext/fetcher.go b/flytectl/pkg/ext/fetcher.go index 60bc32cd0f..d62d58b8d1 100644 --- a/flytectl/pkg/ext/fetcher.go +++ b/flytectl/pkg/ext/fetcher.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) diff --git a/flytectl/pkg/ext/launch_plan_fetcher.go b/flytectl/pkg/ext/launch_plan_fetcher.go index 53d0b69255..3c4ae96585 100644 --- a/flytectl/pkg/ext/launch_plan_fetcher.go +++ b/flytectl/pkg/ext/launch_plan_fetcher.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) diff --git a/flytectl/pkg/ext/launch_plan_fetcher_test.go b/flytectl/pkg/ext/launch_plan_fetcher_test.go index 2e882d6df9..61b78efd24 100644 --- a/flytectl/pkg/ext/launch_plan_fetcher_test.go +++ b/flytectl/pkg/ext/launch_plan_fetcher_test.go @@ -6,11 +6,9 @@ import ( "testing" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "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/protobuf/types/known/timestamppb" diff --git a/flytectl/pkg/ext/project_fetcher.go b/flytectl/pkg/ext/project_fetcher.go index 7c2a53b223..a1e83fdf70 100644 --- a/flytectl/pkg/ext/project_fetcher.go +++ b/flytectl/pkg/ext/project_fetcher.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) diff --git a/flytectl/pkg/ext/task_fetcher.go b/flytectl/pkg/ext/task_fetcher.go index 840a78d172..53c0acccb0 100644 --- a/flytectl/pkg/ext/task_fetcher.go +++ b/flytectl/pkg/ext/task_fetcher.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) diff --git a/flytectl/pkg/ext/task_fetcher_test.go b/flytectl/pkg/ext/task_fetcher_test.go index b39c1724d0..ad903db1d5 100644 --- a/flytectl/pkg/ext/task_fetcher_test.go +++ b/flytectl/pkg/ext/task_fetcher_test.go @@ -6,11 +6,9 @@ import ( "testing" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "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/protobuf/types/known/timestamppb" diff --git a/flytectl/pkg/ext/workflow_fetcher.go b/flytectl/pkg/ext/workflow_fetcher.go index 23d92af230..7f3624f512 100644 --- a/flytectl/pkg/ext/workflow_fetcher.go +++ b/flytectl/pkg/ext/workflow_fetcher.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) diff --git a/flytectl/pkg/ext/workflow_fetcher_test.go b/flytectl/pkg/ext/workflow_fetcher_test.go index c7992cc0c0..114d6afea4 100644 --- a/flytectl/pkg/ext/workflow_fetcher_test.go +++ b/flytectl/pkg/ext/workflow_fetcher_test.go @@ -6,11 +6,9 @@ import ( "testing" "github.com/flyteorg/flyte/flytectl/pkg/filters" - "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/protobuf/types/known/timestamppb" diff --git a/flytectl/pkg/github/githubutil.go b/flytectl/pkg/github/githubutil.go index e439df44f8..5e639006e5 100644 --- a/flytectl/pkg/github/githubutil.go +++ b/flytectl/pkg/github/githubutil.go @@ -13,7 +13,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/util" "github.com/flyteorg/flyte/flytestdlib/logger" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" - "github.com/google/go-github/v42/github" "github.com/mouuff/go-rocket-update/pkg/provider" "github.com/mouuff/go-rocket-update/pkg/updater" diff --git a/flytectl/pkg/github/githubutil_test.go b/flytectl/pkg/github/githubutil_test.go index bd4001faa6..652e812e19 100644 --- a/flytectl/pkg/github/githubutil_test.go +++ b/flytectl/pkg/github/githubutil_test.go @@ -10,7 +10,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/platformutil" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/google/go-github/v42/github" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "golang.org/x/text/cases" diff --git a/flytectl/pkg/pkce/token_cache_keyring.go b/flytectl/pkg/pkce/token_cache_keyring.go index afcfa74db5..7b79a09f88 100644 --- a/flytectl/pkg/pkce/token_cache_keyring.go +++ b/flytectl/pkg/pkce/token_cache_keyring.go @@ -8,7 +8,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/clients/go/admin/cache" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/zalando/go-keyring" "golang.org/x/oauth2" ) diff --git a/flytectl/pkg/printer/printer.go b/flytectl/pkg/printer/printer.go index 37df90ff75..df7effd8a1 100644 --- a/flytectl/pkg/printer/printer.go +++ b/flytectl/pkg/printer/printer.go @@ -14,7 +14,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/flytestdlib/errors" - "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" "github.com/kataras/tablewriter" diff --git a/flytectl/pkg/printer/printer_test.go b/flytectl/pkg/printer/printer_test.go index f66e29a2a5..afc5edb7b1 100644 --- a/flytectl/pkg/printer/printer_test.go +++ b/flytectl/pkg/printer/printer_test.go @@ -11,9 +11,8 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/types/known/timestamppb" - "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/timestamppb" ) type Inner struct { diff --git a/flytectl/pkg/sandbox/start_test.go b/flytectl/pkg/sandbox/start_test.go index 82c8613126..1cf42e471b 100644 --- a/flytectl/pkg/sandbox/start_test.go +++ b/flytectl/pkg/sandbox/start_test.go @@ -9,6 +9,11 @@ import ( "strings" "testing" + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/volume" + sandboxCmdConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/sandbox" "github.com/flyteorg/flyte/flytectl/pkg/docker" "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" f "github.com/flyteorg/flyte/flytectl/pkg/filesystemutils" @@ -17,12 +22,6 @@ import ( "github.com/flyteorg/flyte/flytectl/pkg/k8s" k8sMocks "github.com/flyteorg/flyte/flytectl/pkg/k8s/mocks" "github.com/flyteorg/flyte/flytectl/pkg/util" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/volume" - sandboxCmdConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/sandbox" "github.com/google/go-github/v42/github" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/flytectl/pkg/sandbox/status_test.go b/flytectl/pkg/sandbox/status_test.go index 98080bf642..264ae6196f 100644 --- a/flytectl/pkg/sandbox/status_test.go +++ b/flytectl/pkg/sandbox/status_test.go @@ -3,9 +3,8 @@ package sandbox import ( "testing" - "github.com/flyteorg/flyte/flytectl/cmd/testutils" - "github.com/docker/docker/api/types" + "github.com/flyteorg/flyte/flytectl/cmd/testutils" "github.com/flyteorg/flyte/flytectl/pkg/docker" "github.com/flyteorg/flyte/flytectl/pkg/docker/mocks" "github.com/stretchr/testify/assert" diff --git a/flytectl/pkg/util/util.go b/flytectl/pkg/util/util.go index 8b052269f8..18067d1702 100644 --- a/flytectl/pkg/util/util.go +++ b/flytectl/pkg/util/util.go @@ -9,10 +9,9 @@ import ( "path/filepath" "strings" + "github.com/enescakir/emoji" "github.com/flyteorg/flyte/flytectl/pkg/configutil" "github.com/flyteorg/flyte/flytectl/pkg/docker" - - "github.com/enescakir/emoji" hversion "github.com/hashicorp/go-version" ) diff --git a/flytectl/pkg/util/util_test.go b/flytectl/pkg/util/util_test.go index b3c3f37497..d378b0d5c3 100644 --- a/flytectl/pkg/util/util_test.go +++ b/flytectl/pkg/util/util_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/flyteorg/flyte/flytectl/pkg/docker" - "github.com/stretchr/testify/assert" ) diff --git a/flytectl/pkg/visualize/graphviz.go b/flytectl/pkg/visualize/graphviz.go index d088a2515b..745c7ad248 100644 --- a/flytectl/pkg/visualize/graphviz.go +++ b/flytectl/pkg/visualize/graphviz.go @@ -4,9 +4,8 @@ import ( "fmt" "strings" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - graphviz "github.com/awalterschulze/gographviz" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) diff --git a/flytectl/pkg/visualize/graphviz_test.go b/flytectl/pkg/visualize/graphviz_test.go index fd56f8748e..72dcd3a69b 100644 --- a/flytectl/pkg/visualize/graphviz_test.go +++ b/flytectl/pkg/visualize/graphviz_test.go @@ -6,11 +6,10 @@ import ( "io/ioutil" "testing" + graphviz "github.com/awalterschulze/gographviz" "github.com/flyteorg/flyte/flytectl/pkg/visualize/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/utils" - - graphviz "github.com/awalterschulze/gographviz" "github.com/golang/protobuf/jsonpb" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock"