From 0025603b5cb7cfb908179bb67c281eacd18f98fe Mon Sep 17 00:00:00 2001 From: Andrew Dye Date: Fri, 13 Oct 2023 17:09:53 -0700 Subject: [PATCH] Format go imports (flyteadmin) Signed-off-by: Andrew Dye --- flyteadmin/.golangci.yml | 11 ++++++++ flyteadmin/auth/auth_context.go | 8 +++--- flyteadmin/auth/authzserver/authorize.go | 2 +- flyteadmin/auth/authzserver/authorize_test.go | 14 ++++------ flyteadmin/auth/authzserver/initialize.go | 8 +++--- .../auth/authzserver/initialize_test.go | 4 +-- flyteadmin/auth/authzserver/metadata.go | 8 +++--- .../auth/authzserver/metadata_provider.go | 2 -- .../authzserver/metadata_provider_test.go | 4 +-- flyteadmin/auth/authzserver/metadata_test.go | 5 ++-- flyteadmin/auth/authzserver/provider.go | 26 +++++++----------- flyteadmin/auth/authzserver/provider_test.go | 4 +-- .../auth/authzserver/resource_server.go | 8 +++--- .../auth/authzserver/resource_server_test.go | 6 ++--- .../auth/authzserver/stateless_token_store.go | 12 ++++----- flyteadmin/auth/authzserver/token.go | 3 +-- flyteadmin/auth/authzserver/token_test.go | 4 +-- flyteadmin/auth/authzserver/utils.go | 5 ++-- flyteadmin/auth/config/config_test.go | 10 +++---- flyteadmin/auth/cookie.go | 4 +-- flyteadmin/auth/cookie_manager.go | 6 ++--- flyteadmin/auth/cookie_manager_test.go | 3 +-- flyteadmin/auth/cookie_test.go | 5 ++-- flyteadmin/auth/create_secrets.go | 15 +++++------ flyteadmin/auth/handler_utils.go | 4 +-- flyteadmin/auth/handler_utils_test.go | 5 ++-- flyteadmin/auth/handlers.go | 6 ++--- flyteadmin/auth/handlers_test.go | 4 +-- flyteadmin/auth/identity_context.go | 5 ++-- flyteadmin/auth/init_secrets.go | 5 ++-- flyteadmin/auth/interceptor.go | 3 ++- flyteadmin/auth/interfaces/context.go | 11 +++----- flyteadmin/auth/interfaces/cookie.go | 4 +-- flyteadmin/auth/token.go | 11 +++----- .../flyte/golang_support_tools/tools.go | 3 ++- .../golang_test_targets/download_tooling.sh | 1 + .../flyte/golang_test_targets/goimports | 1 + .../flyte/golangci_file/.golangci.yml | 10 +++++++ flyteadmin/cmd/entrypoints/clusterresource.go | 8 +++--- flyteadmin/cmd/entrypoints/k8s_secret.go | 3 ++- flyteadmin/cmd/entrypoints/migrate.go | 4 +-- flyteadmin/cmd/entrypoints/root.go | 9 +++---- flyteadmin/cmd/entrypoints/serve.go | 12 +++------ flyteadmin/cmd/entrypoints/serve_test.go | 5 ++-- flyteadmin/cmd/main.go | 3 ++- .../cmd/scheduler/entrypoints/precheck.go | 6 ++--- flyteadmin/cmd/scheduler/entrypoints/root.go | 6 ++--- .../cmd/scheduler/entrypoints/scheduler.go | 6 ++--- flyteadmin/cmd/scheduler/main.go | 3 ++- flyteadmin/dataproxy/service.go | 26 +++++++----------- flyteadmin/dataproxy/service_test.go | 23 +++++++--------- flyteadmin/pkg/async/cloudevent/factory.go | 1 + .../pkg/async/cloudevent/factory_test.go | 3 ++- .../implementations/cloudevent_publisher.go | 13 +++------ .../cloudevent_publisher_test.go | 15 +++++------ .../cloudevent/implementations/sender.go | 1 + .../cloudevent/implementations/sender_test.go | 1 - .../node_execution_event_writer.go | 3 +-- .../workflow_execution_event_writer.go | 3 +-- flyteadmin/pkg/async/notifications/email.go | 1 - .../pkg/async/notifications/email_test.go | 6 ++--- flyteadmin/pkg/async/notifications/factory.go | 12 ++++----- .../pkg/async/notifications/factory_test.go | 3 ++- .../implementations/aws_emailer.go | 3 ++- .../implementations/aws_emailer_test.go | 8 +++--- .../implementations/aws_processor.go | 3 ++- .../implementations/aws_processor_test.go | 7 +++-- .../implementations/email_metrics.go | 3 ++- .../implementations/event_publisher.go | 10 +++---- .../implementations/event_publisher_test.go | 12 ++++----- .../implementations/gcp_processor.go | 3 ++- .../implementations/gcp_processor_test.go | 7 ++--- .../implementations/noop_notifications.go | 8 +++--- .../implementations/processor_metrics.go | 3 ++- .../implementations/publisher.go | 8 +++--- .../implementations/publisher_test.go | 5 ++-- .../implementations/sandbox_processor.go | 3 ++- .../implementations/sandbox_processor_test.go | 5 ++-- .../implementations/sandbox_publisher.go | 3 ++- .../implementations/sendgrid_emailer_test.go | 3 ++- .../schedule/aws/cloud_watch_scheduler.go | 14 +++++----- .../aws/cloud_watch_scheduler_test.go | 10 +++---- .../mocks/mock_cloud_watch_event_client.go | 1 + .../pkg/async/schedule/aws/serialization.go | 6 ++--- .../async/schedule/aws/serialization_test.go | 6 ++--- .../pkg/async/schedule/aws/shared_test.go | 4 +-- .../async/schedule/aws/workflow_executor.go | 27 ++++++++----------- .../schedule/aws/workflow_executor_test.go | 16 +++++------ flyteadmin/pkg/async/schedule/factory.go | 4 +-- .../pkg/clusterresource/controller_test.go | 12 ++++----- .../impl/admin_service_data_provider.go | 5 ++-- .../impl/admin_service_data_provider_test.go | 5 ++-- .../impl/db_admin_data_provider_test.go | 7 ++--- flyteadmin/pkg/clusterresource/impl/shared.go | 3 ++- flyteadmin/pkg/common/data_store.go | 7 ++--- flyteadmin/pkg/common/data_store_test.go | 6 ++--- flyteadmin/pkg/common/executions.go | 4 +-- flyteadmin/pkg/common/filters.go | 3 ++- flyteadmin/pkg/common/flyte_url_test.go | 3 ++- flyteadmin/pkg/common/mocks/storage.go | 3 ++- flyteadmin/pkg/common/sorting.go | 2 +- flyteadmin/pkg/common/sorting_test.go | 2 +- flyteadmin/pkg/data/factory.go | 11 ++++---- .../data/implementations/aws_remote_url.go | 6 ++--- .../data/implementations/gcp_remote_url.go | 14 +++++----- .../data/implementations/noop_remote_url.go | 3 ++- .../implementations/noop_remote_url_test.go | 3 +-- flyteadmin/pkg/errors/errors.go | 5 ++-- flyteadmin/pkg/errors/errors_test.go | 2 +- .../pkg/executioncluster/execution_target.go | 6 ++--- .../impl/cluster_execution_target_provider.go | 9 ++++--- .../pkg/executioncluster/impl/in_cluster.go | 6 ++--- .../executioncluster/impl/in_cluster_test.go | 4 +-- .../impl/list_targets_test.go | 5 ++-- .../impl/random_cluster_selector.go | 19 +++++-------- .../impl/random_cluster_selector_test.go | 12 ++++----- .../interfaces/execution_target_provider.go | 3 ++- flyteadmin/pkg/flytek8s/client.go | 10 +++---- .../impl/description_entity_manager.go | 10 +++---- .../impl/description_entity_manager_test.go | 3 ++- .../pkg/manager/impl/execution_manager.go | 16 +++++------ .../manager/impl/execution_manager_test.go | 12 ++++----- .../impl/executions/quality_of_service.go | 5 ++-- .../executions/quality_of_service_test.go | 5 ++-- .../pkg/manager/impl/executions/queues.go | 11 +++----- .../manager/impl/executions/queues_test.go | 14 +++++----- .../pkg/manager/impl/launch_plan_manager.go | 10 +++---- .../manager/impl/launch_plan_manager_test.go | 16 +++++------ .../pkg/manager/impl/metrics_manager.go | 12 +++------ .../pkg/manager/impl/metrics_manager_test.go | 12 ++++----- .../pkg/manager/impl/named_entity_manager.go | 10 +++---- .../manager/impl/named_entity_manager_test.go | 3 ++- .../manager/impl/node_execution_manager.go | 14 +++++----- .../impl/node_execution_manager_test.go | 26 +++++++----------- .../pkg/manager/impl/project_manager.go | 2 +- .../pkg/manager/impl/project_manager_test.go | 3 +-- .../impl/resources/resource_manager.go | 19 +++++-------- .../impl/resources/resource_manager_test.go | 20 ++++++-------- flyteadmin/pkg/manager/impl/shared/errors.go | 4 +-- flyteadmin/pkg/manager/impl/shared/iface.go | 3 ++- flyteadmin/pkg/manager/impl/signal_manager.go | 12 ++++----- .../pkg/manager/impl/signal_manager_test.go | 11 +++----- .../manager/impl/task_execution_manager.go | 14 +++++----- .../impl/task_execution_manager_test.go | 13 +++++---- flyteadmin/pkg/manager/impl/task_manager.go | 12 ++++----- .../pkg/manager/impl/task_manager_test.go | 10 +++---- .../manager/impl/testutils/mock_closures.go | 5 ++-- .../manager/impl/testutils/mock_requests.go | 3 ++- .../pkg/manager/impl/testutils/repository.go | 4 +-- flyteadmin/pkg/manager/impl/util/data.go | 3 ++- flyteadmin/pkg/manager/impl/util/data_test.go | 12 ++++----- flyteadmin/pkg/manager/impl/util/digests.go | 3 ++- .../pkg/manager/impl/util/digests_test.go | 8 +++--- flyteadmin/pkg/manager/impl/util/filters.go | 4 +-- .../pkg/manager/impl/util/filters_test.go | 2 +- flyteadmin/pkg/manager/impl/util/resources.go | 3 ++- .../pkg/manager/impl/util/resources_test.go | 8 +++--- flyteadmin/pkg/manager/impl/util/shared.go | 3 ++- .../pkg/manager/impl/util/shared_test.go | 7 +++-- .../impl/util/single_task_execution.go | 3 ++- .../impl/util/single_task_execution_test.go | 14 +++++----- .../impl/validation/attributes_validator.go | 4 +-- .../validation/attributes_validator_test.go | 8 +++--- .../impl/validation/execution_validator.go | 4 +-- .../validation/execution_validator_test.go | 7 +++-- .../impl/validation/launch_plan_validator.go | 4 +-- .../validation/launch_plan_validator_test.go | 7 +++-- .../impl/validation/named_entity_validator.go | 5 ++-- .../validation/named_entity_validator_test.go | 4 +-- .../node_execution_validator_test.go | 7 +++-- .../notifications_validator_test.go | 5 ++-- .../impl/validation/project_validator.go | 9 +++---- .../impl/validation/project_validator_test.go | 4 +-- .../impl/validation/shared_execution_test.go | 5 ++-- .../impl/validation/signal_validator.go | 6 ++--- .../impl/validation/signal_validator_test.go | 10 +++---- .../task_execution_validator_test.go | 5 ++-- .../manager/impl/validation/task_validator.go | 11 ++++---- .../impl/validation/task_validator_test.go | 12 ++++----- .../pkg/manager/impl/validation/validation.go | 2 +- .../impl/validation/validation_test.go | 7 +++-- .../impl/validation/workflow_validator.go | 5 ++-- .../validation/workflow_validator_test.go | 8 +++--- .../pkg/manager/impl/version_manager_test.go | 3 ++- .../pkg/manager/impl/workflow_manager.go | 14 +++++----- .../pkg/manager/impl/workflow_manager_test.go | 10 +++---- flyteadmin/pkg/manager/mocks/launch_plan.go | 1 - flyteadmin/pkg/manager/mocks/resource.go | 1 - .../pkg/repositories/config/migrations.go | 10 +++---- .../repositories/config/migrations_test.go | 1 - .../pkg/repositories/config/seed_data.go | 3 ++- flyteadmin/pkg/repositories/database.go | 9 +++---- .../repositories/database_integration_test.go | 3 ++- flyteadmin/pkg/repositories/database_test.go | 9 +++---- flyteadmin/pkg/repositories/errors/errors.go | 3 ++- .../pkg/repositories/errors/postgres.go | 10 +++---- .../pkg/repositories/errors/postgres_test.go | 4 +-- .../errors/test_error_transformer.go | 3 ++- flyteadmin/pkg/repositories/gorm_repo.go | 3 ++- .../gormimpl/description_entity_repo.go | 4 +-- .../gormimpl/description_entity_repo_test.go | 8 +++--- .../gormimpl/execution_event_repo.go | 4 +-- .../gormimpl/execution_event_repo_test.go | 3 ++- .../repositories/gormimpl/execution_repo.go | 7 +++-- .../gormimpl/execution_repo_test.go | 6 ++--- .../repositories/gormimpl/launch_plan_repo.go | 7 +++-- .../gormimpl/launch_plan_repo_test.go | 4 +-- .../gormimpl/named_entity_repo.go | 4 +-- .../gormimpl/named_entity_repo_test.go | 8 +++--- .../gormimpl/node_execution_event_repo.go | 2 +- .../node_execution_event_repo_test.go | 3 ++- .../gormimpl/node_execution_repo.go | 4 +-- .../gormimpl/node_execution_repo_test.go | 6 ++--- .../pkg/repositories/gormimpl/project_repo.go | 4 +-- .../gormimpl/project_repo_test.go | 4 +-- .../repositories/gormimpl/resource_repo.go | 8 +++--- .../gormimpl/resource_repo_test.go | 2 +- .../pkg/repositories/gormimpl/signal_repo.go | 2 +- .../repositories/gormimpl/signal_repo_test.go | 8 +++--- .../gormimpl/task_execution_repo.go | 4 +-- .../gormimpl/task_execution_repo_test.go | 4 +-- .../pkg/repositories/gormimpl/task_repo.go | 4 +-- .../repositories/gormimpl/task_repo_test.go | 6 ++--- .../repositories/gormimpl/utils_for_test.go | 6 ++--- .../repositories/gormimpl/workflow_repo.go | 4 +-- .../gormimpl/workflow_repo_test.go | 4 +-- .../interfaces/launch_plan_repo.go | 3 +-- .../interfaces/named_entity_repo.go | 3 +-- .../pkg/repositories/interfaces/repository.go | 3 ++- .../pkg/repositories/mocks/repository.go | 3 ++- .../pkg/repositories/models/execution.go | 3 +-- .../transformers/description_entity.go | 6 ++--- .../transformers/description_entity_test.go | 5 ++-- .../repositories/transformers/execution.go | 12 ++++----- .../transformers/execution_event.go | 5 ++-- .../transformers/execution_event_test.go | 6 ++--- .../transformers/execution_test.go | 22 +++++++-------- .../repositories/transformers/launch_plan.go | 7 ++--- .../transformers/launch_plan_test.go | 8 +++--- .../transformers/named_entity_test.go | 5 ++-- .../transformers/node_execution.go | 19 +++++-------- .../transformers/node_execution_event.go | 5 ++-- .../transformers/node_execution_event_test.go | 5 ++-- .../transformers/node_execution_test.go | 22 +++++++-------- .../pkg/repositories/transformers/project.go | 3 ++- .../repositories/transformers/project_test.go | 5 ++-- .../pkg/repositories/transformers/resource.go | 6 ++--- .../transformers/resource_test.go | 8 +++--- .../pkg/repositories/transformers/signal.go | 8 +++--- .../repositories/transformers/signal_test.go | 8 +++--- .../pkg/repositories/transformers/task.go | 7 ++--- .../transformers/task_execution_test.go | 14 ++++------ .../repositories/transformers/task_test.go | 9 +++---- .../pkg/repositories/transformers/workflow.go | 7 ++--- .../transformers/workflow_test.go | 7 +++-- flyteadmin/pkg/rpc/adminservice/attributes.go | 5 ++-- flyteadmin/pkg/rpc/adminservice/base.go | 17 +++++------- flyteadmin/pkg/rpc/adminservice/base_test.go | 6 ++--- .../rpc/adminservice/description_entity.go | 6 ++--- flyteadmin/pkg/rpc/adminservice/execution.go | 5 ++-- .../pkg/rpc/adminservice/launch_plan.go | 8 +++--- flyteadmin/pkg/rpc/adminservice/metrics.go | 3 ++- .../pkg/rpc/adminservice/named_entity.go | 5 ++-- .../pkg/rpc/adminservice/node_execution.go | 6 ++--- flyteadmin/pkg/rpc/adminservice/project.go | 5 ++-- flyteadmin/pkg/rpc/adminservice/task.go | 8 +++--- .../pkg/rpc/adminservice/task_execution.go | 6 ++--- .../rpc/adminservice/tests/execution_test.go | 9 +++---- .../adminservice/tests/launch_plan_test.go | 4 +-- .../adminservice/tests/node_execution_test.go | 10 +++---- .../adminservice/tests/project_domain_test.go | 3 ++- .../rpc/adminservice/tests/project_test.go | 5 ++-- .../adminservice/tests/task_execution_test.go | 7 +++-- .../pkg/rpc/adminservice/tests/task_test.go | 7 +++-- .../rpc/adminservice/tests/workflow_test.go | 4 +-- .../pkg/rpc/adminservice/util/metrics.go | 6 ++--- .../adminservice/util/transformers_test.go | 2 +- flyteadmin/pkg/rpc/adminservice/workflow.go | 9 +++---- flyteadmin/pkg/rpc/signal_service.go | 14 ++++------ flyteadmin/pkg/rpc/signal_service_test.go | 8 +++--- .../pkg/runtime/cluster_config_provider.go | 4 +-- .../cluster_pool_assignment_provider.go | 1 - .../runtime/cluster_resource_provider_test.go | 4 +-- .../pkg/runtime/config_provider_test.go | 4 +-- .../pkg/runtime/execution_queue_provider.go | 1 - .../interfaces/application_configuration.go | 6 ++--- .../interfaces/cluster_configuration.go | 4 +-- .../runtime/quality_of_service_provider.go | 3 ++- .../pkg/runtime/task_resource_provider.go | 3 ++- flyteadmin/pkg/server/cert_utils.go | 3 +-- flyteadmin/pkg/server/initialize.go | 5 ++-- .../pkg/workflowengine/impl/compiler.go | 3 ++- .../workflowengine/impl/interface_provider.go | 4 +-- .../impl/interface_provider_test.go | 6 ++--- .../pkg/workflowengine/impl/k8s_executor.go | 7 ++--- .../workflowengine/impl/k8s_executor_test.go | 14 +++++----- .../workflowengine/impl/prepare_execution.go | 5 ++-- .../impl/prepare_execution_test.go | 10 +++---- .../workflowengine/impl/workflow_builder.go | 5 ++-- .../pkg/workflowengine/interfaces/executor.go | 2 -- flyteadmin/scheduler/core/gocron_job.go | 4 +-- flyteadmin/scheduler/core/gocron_scheduler.go | 8 +++--- flyteadmin/scheduler/core/updater.go | 1 - .../scheduler/dbapi/event_scheduler_impl.go | 3 +-- .../dbapi/event_scheduler_impl_test.go | 6 ++--- .../scheduler/executor/executor_impl.go | 14 +++++----- .../scheduler/executor/executor_impl_test.go | 8 +++--- flyteadmin/scheduler/identifier/identifier.go | 4 +-- .../gormimpl/schedulable_entity_repo.go | 5 ++-- .../schedule_entities_snapshot_repo.go | 3 ++- flyteadmin/scheduler/schedule_executor.go | 7 +++-- .../scheduler/schedule_executor_test.go | 9 +++---- flyteadmin/scheduler/snapshoter/snapshoter.go | 7 +++-- .../scheduler/snapshoter/snapshoter_test.go | 4 +-- flyteadmin/tests/attributes_test.go | 4 +-- flyteadmin/tests/bootstrap.go | 5 ++-- flyteadmin/tests/execution_test.go | 9 +++---- flyteadmin/tests/helpers.go | 3 ++- flyteadmin/tests/launch_plan_test.go | 5 ++-- flyteadmin/tests/named_entity_test.go | 3 +-- flyteadmin/tests/shared.go | 7 +++-- flyteadmin/tests/task_execution_test.go | 20 ++++++-------- flyteadmin/tests/task_test.go | 4 +-- flyteadmin/tests/workflow_test.go | 5 ++-- 324 files changed, 1017 insertions(+), 1145 deletions(-) diff --git a/flyteadmin/.golangci.yml b/flyteadmin/.golangci.yml index 3df02b549d..7135275462 100644 --- a/flyteadmin/.golangci.yml +++ b/flyteadmin/.golangci.yml @@ -10,6 +10,7 @@ linters: - deadcode - errcheck - gas + - gci - goconst - goimports - golint @@ -25,3 +26,13 @@ linters: - unparam - unused - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true + diff --git a/flyteadmin/auth/auth_context.go b/flyteadmin/auth/auth_context.go index 99eb7ef514..012fa36f41 100644 --- a/flyteadmin/auth/auth_context.go +++ b/flyteadmin/auth/auth_context.go @@ -10,15 +10,15 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/coreos/go-oidc" + "golang.org/x/oauth2" + "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - "golang.org/x/oauth2" ) const ( diff --git a/flyteadmin/auth/authzserver/authorize.go b/flyteadmin/auth/authzserver/authorize.go index d0e8ecbdb0..27f145e0df 100644 --- a/flyteadmin/auth/authzserver/authorize.go +++ b/flyteadmin/auth/authzserver/authorize.go @@ -6,9 +6,9 @@ import ( "net/http" "time" - "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/ory/fosite" + "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flyteadmin/auth/authzserver/authorize_test.go b/flyteadmin/auth/authzserver/authorize_test.go index 08c5df2898..5377981a11 100644 --- a/flyteadmin/auth/authzserver/authorize_test.go +++ b/flyteadmin/auth/authzserver/authorize_test.go @@ -8,18 +8,14 @@ import ( "net/http/httptest" "testing" - config2 "github.com/flyteorg/flyte/flytestdlib/config" - - "github.com/flyteorg/flyte/flyteadmin/auth" + "github.com/ory/fosite" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks" - + "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/flyteorg/flyte/flyteadmin/auth/config" - - "github.com/ory/fosite" - - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks" + config2 "github.com/flyteorg/flyte/flytestdlib/config" ) func TestAuthEndpoint(t *testing.T) { diff --git a/flyteadmin/auth/authzserver/initialize.go b/flyteadmin/auth/authzserver/initialize.go index 74417403ee..ef5a0d2ad4 100644 --- a/flyteadmin/auth/authzserver/initialize.go +++ b/flyteadmin/auth/authzserver/initialize.go @@ -3,14 +3,12 @@ package authzserver import ( "crypto/rsa" - "github.com/ory/fosite/handler/oauth2" - "github.com/ory/fosite" - - "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" - "github.com/ory/fosite/compose" + "github.com/ory/fosite/handler/oauth2" "github.com/ory/fosite/token/jwt" + + "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" ) // RegisterHandlers registers http endpoints for handling OAuth2 flow (/authorize, diff --git a/flyteadmin/auth/authzserver/initialize_test.go b/flyteadmin/auth/authzserver/initialize_test.go index e9dae7ba28..9f7ecb0491 100644 --- a/flyteadmin/auth/authzserver/initialize_test.go +++ b/flyteadmin/auth/authzserver/initialize_test.go @@ -3,10 +3,8 @@ package authzserver import ( "testing" - "github.com/ory/fosite/storage" - "github.com/ory/fosite/compose" - + "github.com/ory/fosite/storage" "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteadmin/auth" diff --git a/flyteadmin/auth/authzserver/metadata.go b/flyteadmin/auth/authzserver/metadata.go index 043de89d87..4c701cfca8 100644 --- a/flyteadmin/auth/authzserver/metadata.go +++ b/flyteadmin/auth/authzserver/metadata.go @@ -7,14 +7,12 @@ import ( "fmt" "net/http" - "github.com/flyteorg/flyte/flyteadmin/auth" - "github.com/flyteorg/flyte/flyteadmin/auth/config" - "github.com/lestrrat-go/jwx/jwk" - "github.com/flyteorg/flyte/flytestdlib/logger" - + "github.com/flyteorg/flyte/flyteadmin/auth" + "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flyteadmin/auth/authzserver/metadata_provider.go b/flyteadmin/auth/authzserver/metadata_provider.go index 6752ecbcee..b1887ef4c2 100644 --- a/flyteadmin/auth/authzserver/metadata_provider.go +++ b/flyteadmin/auth/authzserver/metadata_provider.go @@ -8,9 +8,7 @@ import ( "strings" "github.com/flyteorg/flyte/flyteadmin/auth" - authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) diff --git a/flyteadmin/auth/authzserver/metadata_provider_test.go b/flyteadmin/auth/authzserver/metadata_provider_test.go index 79bcc7b727..f1b244012e 100644 --- a/flyteadmin/auth/authzserver/metadata_provider_test.go +++ b/flyteadmin/auth/authzserver/metadata_provider_test.go @@ -8,12 +8,12 @@ import ( "strings" "testing" - config2 "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteadmin/auth/config" authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/stretchr/testify/assert" + config2 "github.com/flyteorg/flyte/flytestdlib/config" ) func TestOAuth2MetadataProvider_FlyteClient(t *testing.T) { diff --git a/flyteadmin/auth/authzserver/metadata_test.go b/flyteadmin/auth/authzserver/metadata_test.go index 8b32559a9f..8da8057974 100644 --- a/flyteadmin/auth/authzserver/metadata_test.go +++ b/flyteadmin/auth/authzserver/metadata_test.go @@ -7,12 +7,11 @@ import ( "net/http/httptest" "testing" - "github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks" "github.com/lestrrat-go/jwx/jwk" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteadmin/auth" - - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks" ) func Test_newJSONWebKeySet(t *testing.T) { diff --git a/flyteadmin/auth/authzserver/provider.go b/flyteadmin/auth/authzserver/provider.go index ab6a91becd..be33ac28f4 100644 --- a/flyteadmin/auth/authzserver/provider.go +++ b/flyteadmin/auth/authzserver/provider.go @@ -9,27 +9,21 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "k8s.io/apimachinery/pkg/util/sets" - - "github.com/lestrrat-go/jwx/jwk" - - "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" - - "github.com/flyteorg/flyte/flyteadmin/auth" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - jwtgo "github.com/golang-jwt/jwt/v4" + "github.com/lestrrat-go/jwx/jwk" + "github.com/ory/fosite" + "github.com/ory/fosite/compose" fositeOAuth2 "github.com/ory/fosite/handler/oauth2" + "github.com/ory/fosite/storage" "github.com/ory/fosite/token/jwt" + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/flyteorg/flyte/flyteadmin/auth/config" - - "github.com/ory/fosite" - "github.com/ory/fosite/compose" - "github.com/ory/fosite/storage" + "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteadmin/auth/authzserver/provider_test.go b/flyteadmin/auth/authzserver/provider_test.go index b3892e7fed..4659e603a4 100644 --- a/flyteadmin/auth/authzserver/provider_test.go +++ b/flyteadmin/auth/authzserver/provider_test.go @@ -12,13 +12,11 @@ import ( "time" jwtgo "github.com/golang-jwt/jwt/v4" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/flyteorg/flyte/flyteadmin/auth/config" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) diff --git a/flyteadmin/auth/authzserver/resource_server.go b/flyteadmin/auth/authzserver/resource_server.go index c7db85c949..325923af1e 100644 --- a/flyteadmin/auth/authzserver/resource_server.go +++ b/flyteadmin/auth/authzserver/resource_server.go @@ -10,17 +10,15 @@ import ( "net/url" "strings" + "github.com/coreos/go-oidc" jwtgo "github.com/golang-jwt/jwt/v4" - + "golang.org/x/oauth2" "k8s.io/apimachinery/pkg/util/sets" - "github.com/flyteorg/flyte/flytestdlib/config" - - "github.com/coreos/go-oidc" authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "golang.org/x/oauth2" + "github.com/flyteorg/flyte/flytestdlib/config" ) // External auth server implementation diff --git a/flyteadmin/auth/authzserver/resource_server_test.go b/flyteadmin/auth/authzserver/resource_server_test.go index b3adfab931..611ea5f4d9 100644 --- a/flyteadmin/auth/authzserver/resource_server_test.go +++ b/flyteadmin/auth/authzserver/resource_server_test.go @@ -14,13 +14,11 @@ import ( "testing" "time" + "github.com/coreos/go-oidc" "github.com/golang-jwt/jwt/v4" - - "github.com/stretchr/testify/assert" - "github.com/lestrrat-go/jwx/jwk" + "github.com/stretchr/testify/assert" - "github.com/coreos/go-oidc" "github.com/flyteorg/flyte/flyteadmin/auth/config" authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" stdlibConfig "github.com/flyteorg/flyte/flytestdlib/config" diff --git a/flyteadmin/auth/authzserver/stateless_token_store.go b/flyteadmin/auth/authzserver/stateless_token_store.go index 9b53618a80..837d9ab50a 100644 --- a/flyteadmin/auth/authzserver/stateless_token_store.go +++ b/flyteadmin/auth/authzserver/stateless_token_store.go @@ -8,17 +8,15 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteadmin/auth" - - "github.com/flyteorg/flyte/flyteadmin/auth/config" - "k8s.io/apimachinery/pkg/util/sets" - + "github.com/ory/fosite" "github.com/ory/fosite/handler/oauth2" oauth22 "github.com/ory/fosite/handler/oauth2" + "github.com/ory/fosite/storage" "github.com/ory/fosite/token/jwt" + "k8s.io/apimachinery/pkg/util/sets" - "github.com/ory/fosite" - "github.com/ory/fosite/storage" + "github.com/flyteorg/flyte/flyteadmin/auth" + "github.com/flyteorg/flyte/flyteadmin/auth/config" ) const ( diff --git a/flyteadmin/auth/authzserver/token.go b/flyteadmin/auth/authzserver/token.go index 9a12891ac5..c36e8cef49 100644 --- a/flyteadmin/auth/authzserver/token.go +++ b/flyteadmin/auth/authzserver/token.go @@ -7,9 +7,8 @@ import ( "github.com/ory/fosite" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flyteadmin/auth/authzserver/token_test.go b/flyteadmin/auth/authzserver/token_test.go index f8f5185c82..14f7ffba27 100644 --- a/flyteadmin/auth/authzserver/token_test.go +++ b/flyteadmin/auth/authzserver/token_test.go @@ -14,11 +14,9 @@ import ( "time" jwtgo "github.com/golang-jwt/jwt/v4" - - "github.com/flyteorg/flyte/flyteadmin/auth/config" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks" ) diff --git a/flyteadmin/auth/authzserver/utils.go b/flyteadmin/auth/authzserver/utils.go index 03ebbb38fd..a06501c5b5 100644 --- a/flyteadmin/auth/authzserver/utils.go +++ b/flyteadmin/auth/authzserver/utils.go @@ -5,10 +5,11 @@ import ( "encoding/base64" "net/http" - "github.com/flyteorg/flyte/flyteadmin/auth" - "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/gtank/cryptopasta" "github.com/ory/fosite" + + "github.com/flyteorg/flyte/flyteadmin/auth" + "github.com/flyteorg/flyte/flyteadmin/auth/config" ) func interfaceSliceToStringSlice(raw []interface{}) []string { diff --git a/flyteadmin/auth/config/config_test.go b/flyteadmin/auth/config/config_test.go index 381d28d1bc..fa06506ee5 100644 --- a/flyteadmin/auth/config/config_test.go +++ b/flyteadmin/auth/config/config_test.go @@ -6,15 +6,13 @@ import ( "path/filepath" "testing" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/ghodss/yaml" + "github.com/ory/fosite" "github.com/stretchr/testify/assert" - "github.com/ory/fosite" + "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func TestHashFlyteClientSecret(t *testing.T) { diff --git a/flyteadmin/auth/cookie.go b/flyteadmin/auth/cookie.go index 96034642ff..bf80c1f920 100644 --- a/flyteadmin/auth/cookie.go +++ b/flyteadmin/auth/cookie.go @@ -9,11 +9,11 @@ import ( "net/url" "time" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/gorilla/securecookie" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteadmin/auth/cookie_manager.go b/flyteadmin/auth/cookie_manager.go index 1ab5fbcfca..9bc64b88cf 100644 --- a/flyteadmin/auth/cookie_manager.go +++ b/flyteadmin/auth/cookie_manager.go @@ -8,12 +8,12 @@ import ( "net/http" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" "golang.org/x/oauth2" "github.com/flyteorg/flyte/flyteadmin/auth/config" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type CookieManager struct { diff --git a/flyteadmin/auth/cookie_manager_test.go b/flyteadmin/auth/cookie_manager_test.go index e36bb61671..6dd67a0473 100644 --- a/flyteadmin/auth/cookie_manager_test.go +++ b/flyteadmin/auth/cookie_manager_test.go @@ -10,13 +10,12 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/oauth2" "github.com/flyteorg/flyte/flyteadmin/auth/config" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) func TestCookieManager(t *testing.T) { diff --git a/flyteadmin/auth/cookie_test.go b/flyteadmin/auth/cookie_test.go index f4cab8fd76..a5c58ad2ff 100644 --- a/flyteadmin/auth/cookie_test.go +++ b/flyteadmin/auth/cookie_test.go @@ -9,11 +9,12 @@ import ( "net/url" "testing" + "github.com/gorilla/securecookie" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks" stdConfig "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/gorilla/securecookie" - "github.com/stretchr/testify/assert" ) func mustParseURL(t testing.TB, u string) url.URL { diff --git a/flyteadmin/auth/create_secrets.go b/flyteadmin/auth/create_secrets.go index 2f831571aa..26c0af8300 100644 --- a/flyteadmin/auth/create_secrets.go +++ b/flyteadmin/auth/create_secrets.go @@ -8,24 +8,21 @@ import ( "path/filepath" "strings" - "k8s.io/client-go/rest" - - "github.com/flyteorg/flyte/flytestdlib/logger" - kubeErrors "k8s.io/apimachinery/pkg/api/errors" - + "github.com/spf13/cobra" + "github.com/spf13/pflag" corev1 "k8s.io/api/core/v1" + kubeErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" "github.com/flyteorg/flyte/flyteadmin/pkg/config" executioncluster "github.com/flyteorg/flyte/flyteadmin/pkg/executioncluster/impl" "github.com/flyteorg/flyte/flyteadmin/pkg/executioncluster/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/runtime" "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "k8s.io/client-go/kubernetes" ) const ( diff --git a/flyteadmin/auth/handler_utils.go b/flyteadmin/auth/handler_utils.go index 18a9d781dd..e6fd1a7236 100644 --- a/flyteadmin/auth/handler_utils.go +++ b/flyteadmin/auth/handler_utils.go @@ -5,9 +5,9 @@ import ( "net/http" "net/url" - "github.com/flyteorg/flyte/flyteadmin/auth/config" - "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" + + "github.com/flyteorg/flyte/flyteadmin/auth/config" ) const ( diff --git a/flyteadmin/auth/handler_utils_test.go b/flyteadmin/auth/handler_utils_test.go index fe5c9db135..441f83dbbb 100644 --- a/flyteadmin/auth/handler_utils_test.go +++ b/flyteadmin/auth/handler_utils_test.go @@ -3,13 +3,12 @@ package auth import ( "context" "net/http" - "testing" - config2 "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteadmin/auth/config" - "github.com/stretchr/testify/assert" + config2 "github.com/flyteorg/flyte/flytestdlib/config" ) func TestGetPublicURL(t *testing.T) { diff --git a/flyteadmin/auth/handlers.go b/flyteadmin/auth/handlers.go index a5bacdc06e..26e6428df3 100644 --- a/flyteadmin/auth/handlers.go +++ b/flyteadmin/auth/handlers.go @@ -8,9 +8,6 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" "golang.org/x/oauth2" "google.golang.org/grpc" @@ -23,6 +20,9 @@ import ( "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/common" "github.com/flyteorg/flyte/flyteadmin/plugins" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteadmin/auth/handlers_test.go b/flyteadmin/auth/handlers_test.go index 63facc8bfa..4b4471ad7b 100644 --- a/flyteadmin/auth/handlers_test.go +++ b/flyteadmin/auth/handlers_test.go @@ -12,8 +12,6 @@ import ( "testing" "github.com/coreos/go-oidc" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -25,6 +23,8 @@ import ( "github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks" "github.com/flyteorg/flyte/flyteadmin/pkg/common" "github.com/flyteorg/flyte/flyteadmin/plugins" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" ) const ( diff --git a/flyteadmin/auth/identity_context.go b/flyteadmin/auth/identity_context.go index 4da330e101..05889f7537 100644 --- a/flyteadmin/auth/identity_context.go +++ b/flyteadmin/auth/identity_context.go @@ -5,11 +5,10 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - - "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" ) var ( diff --git a/flyteadmin/auth/init_secrets.go b/flyteadmin/auth/init_secrets.go index 0cccf74cc9..6e3d4a3078 100644 --- a/flyteadmin/auth/init_secrets.go +++ b/flyteadmin/auth/init_secrets.go @@ -12,11 +12,10 @@ import ( "os" "path/filepath" - "github.com/flyteorg/flyte/flyteadmin/auth/config" + "github.com/spf13/cobra" + "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/spf13/cobra" ) const ( diff --git a/flyteadmin/auth/interceptor.go b/flyteadmin/auth/interceptor.go index c347dd63c4..499d79d195 100644 --- a/flyteadmin/auth/interceptor.go +++ b/flyteadmin/auth/interceptor.go @@ -3,10 +3,11 @@ package auth import ( "context" - "github.com/flyteorg/flyte/flytestdlib/logger" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flytestdlib/logger" ) func BlanketAuthorization(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) ( diff --git a/flyteadmin/auth/interfaces/context.go b/flyteadmin/auth/interfaces/context.go index 7b73c56d21..1eff82faa7 100644 --- a/flyteadmin/auth/interfaces/context.go +++ b/flyteadmin/auth/interfaces/context.go @@ -6,18 +6,15 @@ import ( "net/url" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - - "k8s.io/apimachinery/pkg/util/sets" - + "github.com/coreos/go-oidc" "github.com/lestrrat-go/jwx/jwk" - "github.com/ory/fosite" fositeOAuth2 "github.com/ory/fosite/handler/oauth2" + "golang.org/x/oauth2" + "k8s.io/apimachinery/pkg/util/sets" - "github.com/coreos/go-oidc" "github.com/flyteorg/flyte/flyteadmin/auth/config" - "golang.org/x/oauth2" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) //go:generate mockery -all -case=underscore diff --git a/flyteadmin/auth/interfaces/cookie.go b/flyteadmin/auth/interfaces/cookie.go index 272fab8d6a..8896e4c329 100644 --- a/flyteadmin/auth/interfaces/cookie.go +++ b/flyteadmin/auth/interfaces/cookie.go @@ -4,9 +4,9 @@ import ( "context" "net/http" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "golang.org/x/oauth2" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) //go:generate mockery -name=CookieHandler -output=mocks/ -case=underscore diff --git a/flyteadmin/auth/token.go b/flyteadmin/auth/token.go index e864c96123..9b90a2d108 100644 --- a/flyteadmin/auth/token.go +++ b/flyteadmin/auth/token.go @@ -6,19 +6,16 @@ import ( "strings" "time" + "github.com/coreos/go-oidc" + grpcauth "github.com/grpc-ecosystem/go-grpc-middleware/auth" "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - + "golang.org/x/oauth2" "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteadmin/auth/interfaces" - - "github.com/coreos/go-oidc" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - grpcauth "github.com/grpc-ecosystem/go-grpc-middleware/auth" - "golang.org/x/oauth2" ) const ( diff --git a/flyteadmin/boilerplate/flyte/golang_support_tools/tools.go b/flyteadmin/boilerplate/flyte/golang_support_tools/tools.go index a78b61162a..6c3da04107 100644 --- a/flyteadmin/boilerplate/flyte/golang_support_tools/tools.go +++ b/flyteadmin/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/flyteadmin/boilerplate/flyte/golang_test_targets/download_tooling.sh b/flyteadmin/boilerplate/flyte/golang_test_targets/download_tooling.sh index c7e5577ef3..9cd49959f4 100755 --- a/flyteadmin/boilerplate/flyte/golang_test_targets/download_tooling.sh +++ b/flyteadmin/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/flyteadmin/boilerplate/flyte/golang_test_targets/goimports b/flyteadmin/boilerplate/flyte/golang_test_targets/goimports index af1829036c..40f50d106e 100755 --- a/flyteadmin/boilerplate/flyte/golang_test_targets/goimports +++ b/flyteadmin/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/flyteadmin/boilerplate/flyte/golangci_file/.golangci.yml b/flyteadmin/boilerplate/flyte/golangci_file/.golangci.yml index 5d53f35295..7f4dbc80e8 100644 --- a/flyteadmin/boilerplate/flyte/golangci_file/.golangci.yml +++ b/flyteadmin/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/flyteadmin/cmd/entrypoints/clusterresource.go b/flyteadmin/cmd/entrypoints/clusterresource.go index fa38491b62..bb47d8775f 100644 --- a/flyteadmin/cmd/entrypoints/clusterresource.go +++ b/flyteadmin/cmd/entrypoints/clusterresource.go @@ -4,15 +4,13 @@ import ( "context" errors2 "github.com/pkg/errors" - - "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/spf13/cobra" + _ "gorm.io/driver/postgres" // Required to import database driver. "github.com/flyteorg/flyte/flyteadmin/pkg/clusterresource" "github.com/flyteorg/flyte/flyteadmin/pkg/runtime" "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/spf13/cobra" - _ "gorm.io/driver/postgres" // Required to import database driver. + "github.com/flyteorg/flyte/flytestdlib/promutils" ) var parentClusterResourceCmd = &cobra.Command{ diff --git a/flyteadmin/cmd/entrypoints/k8s_secret.go b/flyteadmin/cmd/entrypoints/k8s_secret.go index 7a24f70dba..8bd14ab78e 100644 --- a/flyteadmin/cmd/entrypoints/k8s_secret.go +++ b/flyteadmin/cmd/entrypoints/k8s_secret.go @@ -1,8 +1,9 @@ package entrypoints import ( - "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/spf13/cobra" + + "github.com/flyteorg/flyte/flyteadmin/auth" ) var secretsCmd = &cobra.Command{ diff --git a/flyteadmin/cmd/entrypoints/migrate.go b/flyteadmin/cmd/entrypoints/migrate.go index bb0d79788b..c7ad6058c5 100644 --- a/flyteadmin/cmd/entrypoints/migrate.go +++ b/flyteadmin/cmd/entrypoints/migrate.go @@ -3,10 +3,10 @@ package entrypoints import ( "context" - "github.com/flyteorg/flyte/flyteadmin/pkg/server" - "github.com/spf13/cobra" _ "gorm.io/driver/postgres" // Required to import database driver. + + "github.com/flyteorg/flyte/flyteadmin/pkg/server" ) var parentMigrateCmd = &cobra.Command{ diff --git a/flyteadmin/cmd/entrypoints/root.go b/flyteadmin/cmd/entrypoints/root.go index 04775b47ee..5f493d0bbc 100644 --- a/flyteadmin/cmd/entrypoints/root.go +++ b/flyteadmin/cmd/entrypoints/root.go @@ -6,14 +6,13 @@ import ( "fmt" "os" - "github.com/flyteorg/flyte/flyteadmin/plugins" - - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/flyteorg/flyte/flyteadmin/plugins" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/spf13/cobra" - "github.com/spf13/pflag" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flyteadmin/cmd/entrypoints/serve.go b/flyteadmin/cmd/entrypoints/serve.go index 56eb4483e9..680795c28f 100644 --- a/flyteadmin/cmd/entrypoints/serve.go +++ b/flyteadmin/cmd/entrypoints/serve.go @@ -2,19 +2,15 @@ package entrypoints import ( "context" - - "github.com/flyteorg/flyte/flyteadmin/plugins" - - "github.com/flyteorg/flyte/flytestdlib/profutils" - _ "net/http/pprof" // Required to serve application. - "github.com/flyteorg/flyte/flyteadmin/pkg/server" - - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/spf13/cobra" runtimeConfig "github.com/flyteorg/flyte/flyteadmin/pkg/runtime" + "github.com/flyteorg/flyte/flyteadmin/pkg/server" + "github.com/flyteorg/flyte/flyteadmin/plugins" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/profutils" ) var pluginRegistryStore = plugins.NewAtomicRegistry(plugins.NewRegistry()) diff --git a/flyteadmin/cmd/entrypoints/serve_test.go b/flyteadmin/cmd/entrypoints/serve_test.go index e2269388ad..897a56f389 100644 --- a/flyteadmin/cmd/entrypoints/serve_test.go +++ b/flyteadmin/cmd/entrypoints/serve_test.go @@ -10,13 +10,14 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" "github.com/stretchr/testify/assert" "golang.org/x/oauth2" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/oauth" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) func TestClient(t *testing.T) { diff --git a/flyteadmin/cmd/main.go b/flyteadmin/cmd/main.go index d64c8a5dbf..26b79007c8 100644 --- a/flyteadmin/cmd/main.go +++ b/flyteadmin/cmd/main.go @@ -1,9 +1,10 @@ package main import ( + "github.com/golang/glog" + "github.com/flyteorg/flyte/flyteadmin/cmd/entrypoints" "github.com/flyteorg/flyte/flyteadmin/plugins" - "github.com/golang/glog" ) func main() { diff --git a/flyteadmin/cmd/scheduler/entrypoints/precheck.go b/flyteadmin/cmd/scheduler/entrypoints/precheck.go index a3e3e8add5..c183429969 100644 --- a/flyteadmin/cmd/scheduler/entrypoints/precheck.go +++ b/flyteadmin/cmd/scheduler/entrypoints/precheck.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/spf13/cobra" "google.golang.org/grpc/health/grpc_health_v1" + + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteadmin/cmd/scheduler/entrypoints/root.go b/flyteadmin/cmd/scheduler/entrypoints/root.go index 1f37a11df9..dd50b03b19 100644 --- a/flyteadmin/cmd/scheduler/entrypoints/root.go +++ b/flyteadmin/cmd/scheduler/entrypoints/root.go @@ -6,12 +6,12 @@ import ( "fmt" "os" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/spf13/cobra" + "github.com/spf13/pflag" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/spf13/cobra" - "github.com/spf13/pflag" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flyteadmin/cmd/scheduler/entrypoints/scheduler.go b/flyteadmin/cmd/scheduler/entrypoints/scheduler.go index 15935bcb04..a541444f19 100644 --- a/flyteadmin/cmd/scheduler/entrypoints/scheduler.go +++ b/flyteadmin/cmd/scheduler/entrypoints/scheduler.go @@ -3,14 +3,14 @@ package entrypoints import ( "context" - "github.com/flyteorg/flyte/flyteadmin/pkg/server" + "github.com/spf13/cobra" + _ "gorm.io/driver/postgres" // Required to import database driver. "github.com/flyteorg/flyte/flyteadmin/pkg/runtime" + "github.com/flyteorg/flyte/flyteadmin/pkg/server" "github.com/flyteorg/flyte/flyteadmin/scheduler" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/profutils" - "github.com/spf13/cobra" - _ "gorm.io/driver/postgres" // Required to import database driver. ) var schedulerRunCmd = &cobra.Command{ diff --git a/flyteadmin/cmd/scheduler/main.go b/flyteadmin/cmd/scheduler/main.go index 9b12d85116..260afede08 100644 --- a/flyteadmin/cmd/scheduler/main.go +++ b/flyteadmin/cmd/scheduler/main.go @@ -1,8 +1,9 @@ package main import ( - "github.com/flyteorg/flyte/flyteadmin/cmd/scheduler/entrypoints" "github.com/golang/glog" + + "github.com/flyteorg/flyte/flyteadmin/cmd/scheduler/entrypoints" ) func main() { diff --git a/flyteadmin/dataproxy/service.go b/flyteadmin/dataproxy/service.go index 049bd14b1e..07c8ae1196 100644 --- a/flyteadmin/dataproxy/service.go +++ b/flyteadmin/dataproxy/service.go @@ -12,30 +12,22 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteadmin/pkg/common" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteadmin/pkg/errors" "google.golang.org/grpc/codes" + "google.golang.org/protobuf/types/known/durationpb" + "google.golang.org/protobuf/types/known/timestamppb" + "k8s.io/apimachinery/pkg/util/rand" + "github.com/flyteorg/flyte/flyteadmin/pkg/common" + "github.com/flyteorg/flyte/flyteadmin/pkg/config" + "github.com/flyteorg/flyte/flyteadmin/pkg/errors" "github.com/flyteorg/flyte/flyteadmin/pkg/manager/interfaces" "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/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "google.golang.org/protobuf/types/known/durationpb" - - "github.com/flyteorg/flyte/flyteadmin/pkg/config" - - "google.golang.org/protobuf/types/known/timestamppb" - + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/flyteorg/stow" - "k8s.io/apimachinery/pkg/util/rand" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) type Service struct { diff --git a/flyteadmin/dataproxy/service_test.go b/flyteadmin/dataproxy/service_test.go index 814ac38ecd..3716b98914 100644 --- a/flyteadmin/dataproxy/service_test.go +++ b/flyteadmin/dataproxy/service_test.go @@ -8,27 +8,22 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flyteadmin/pkg/manager/mocks" + "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/durationpb" commonMocks "github.com/flyteorg/flyte/flyteadmin/pkg/common/mocks" - stdlibConfig "github.com/flyteorg/flyte/flytestdlib/config" - + "github.com/flyteorg/flyte/flyteadmin/pkg/config" "github.com/flyteorg/flyte/flyteadmin/pkg/errors" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "google.golang.org/protobuf/types/known/durationpb" - + "github.com/flyteorg/flyte/flyteadmin/pkg/manager/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/flyteadmin/pkg/config" + stdlibConfig "github.com/flyteorg/flyte/flytestdlib/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" - "github.com/stretchr/testify/assert" ) func TestNewService(t *testing.T) { diff --git a/flyteadmin/pkg/async/cloudevent/factory.go b/flyteadmin/pkg/async/cloudevent/factory.go index 976aa34532..efa0848ccb 100644 --- a/flyteadmin/pkg/async/cloudevent/factory.go +++ b/flyteadmin/pkg/async/cloudevent/factory.go @@ -10,6 +10,7 @@ import ( "github.com/Shopify/sarama" "github.com/cloudevents/sdk-go/protocol/kafka_sarama/v2" cloudevents "github.com/cloudevents/sdk-go/v2" + "github.com/flyteorg/flyte/flyteadmin/pkg/async" cloudEventImplementations "github.com/flyteorg/flyte/flyteadmin/pkg/async/cloudevent/implementations" "github.com/flyteorg/flyte/flyteadmin/pkg/async/cloudevent/interfaces" diff --git a/flyteadmin/pkg/async/cloudevent/factory_test.go b/flyteadmin/pkg/async/cloudevent/factory_test.go index e5ccdbee22..6d6c1a881c 100644 --- a/flyteadmin/pkg/async/cloudevent/factory_test.go +++ b/flyteadmin/pkg/async/cloudevent/factory_test.go @@ -4,11 +4,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/cloudevent/implementations" "github.com/flyteorg/flyte/flyteadmin/pkg/common" runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) func TestGetCloudEventPublisher(t *testing.T) { diff --git a/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher.go b/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher.go index 8eafefffc0..925e7ef18f 100644 --- a/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher.go +++ b/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher.go @@ -7,21 +7,16 @@ import ( "reflect" "time" - "github.com/golang/protobuf/jsonpb" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/implementations" - cloudevents "github.com/cloudevents/sdk-go/v2" - + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteadmin/pkg/async/cloudevent/interfaces" - + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/implementations" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/golang/protobuf/proto" ) const ( diff --git a/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher_test.go b/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher_test.go index 65bedaac47..d9108aa3ff 100644 --- a/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher_test.go +++ b/flyteadmin/pkg/async/cloudevent/implementations/cloudevent_publisher_test.go @@ -7,20 +7,19 @@ import ( "testing" "time" - "github.com/golang/protobuf/jsonpb" - - "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/golang/protobuf/ptypes" - "github.com/NYTimes/gizmo/pubsub" "github.com/NYTimes/gizmo/pubsub/pubsubtest" pbcloudevents "github.com/cloudevents/sdk-go/binding/format/protobuf/v2" cloudevents "github.com/cloudevents/sdk-go/v2" - "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" "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/flytestdlib/promutils" ) type mockKafkaSender struct{} diff --git a/flyteadmin/pkg/async/cloudevent/implementations/sender.go b/flyteadmin/pkg/async/cloudevent/implementations/sender.go index 263e4cfd56..4e7ba23d8a 100644 --- a/flyteadmin/pkg/async/cloudevent/implementations/sender.go +++ b/flyteadmin/pkg/async/cloudevent/implementations/sender.go @@ -9,6 +9,7 @@ import ( pbcloudevents "github.com/cloudevents/sdk-go/binding/format/protobuf/v2" "github.com/cloudevents/sdk-go/protocol/kafka_sarama/v2" cloudevents "github.com/cloudevents/sdk-go/v2" + "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flyteadmin/pkg/async/cloudevent/implementations/sender_test.go b/flyteadmin/pkg/async/cloudevent/implementations/sender_test.go index 93c05829f1..684eb36c56 100644 --- a/flyteadmin/pkg/async/cloudevent/implementations/sender_test.go +++ b/flyteadmin/pkg/async/cloudevent/implementations/sender_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/NYTimes/gizmo/pubsub/pubsubtest" - cloudevents "github.com/cloudevents/sdk-go/v2" "github.com/cloudevents/sdk-go/v2/event" "github.com/cloudevents/sdk-go/v2/protocol" diff --git a/flyteadmin/pkg/async/events/implementations/node_execution_event_writer.go b/flyteadmin/pkg/async/events/implementations/node_execution_event_writer.go index fbcc50aa83..623baf354d 100644 --- a/flyteadmin/pkg/async/events/implementations/node_execution_event_writer.go +++ b/flyteadmin/pkg/async/events/implementations/node_execution_event_writer.go @@ -3,9 +3,8 @@ package implementations import ( "context" - repositoryInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/repositories/interfaces" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/events/interfaces" + repositoryInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/repositories/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/repositories/transformers" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" diff --git a/flyteadmin/pkg/async/events/implementations/workflow_execution_event_writer.go b/flyteadmin/pkg/async/events/implementations/workflow_execution_event_writer.go index 6d326d4708..7521dee4b8 100644 --- a/flyteadmin/pkg/async/events/implementations/workflow_execution_event_writer.go +++ b/flyteadmin/pkg/async/events/implementations/workflow_execution_event_writer.go @@ -3,9 +3,8 @@ package implementations import ( "context" - repositoryInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/repositories/interfaces" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/events/interfaces" + repositoryInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/repositories/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/repositories/transformers" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" diff --git a/flyteadmin/pkg/async/notifications/email.go b/flyteadmin/pkg/async/notifications/email.go index 6481d0cc20..94eb71719c 100644 --- a/flyteadmin/pkg/async/notifications/email.go +++ b/flyteadmin/pkg/async/notifications/email.go @@ -2,7 +2,6 @@ package notifications import ( "fmt" - "strings" runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" diff --git a/flyteadmin/pkg/async/notifications/email_test.go b/flyteadmin/pkg/async/notifications/email_test.go index 53fcb585c1..f05f893124 100644 --- a/flyteadmin/pkg/async/notifications/email_test.go +++ b/flyteadmin/pkg/async/notifications/email_test.go @@ -2,16 +2,16 @@ package notifications import ( "fmt" + "strings" "testing" - "strings" + "github.com/gogo/protobuf/proto" + "github.com/stretchr/testify/assert" runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" "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/gogo/protobuf/proto" - "github.com/stretchr/testify/assert" ) const executionProjectValue = "proj" diff --git a/flyteadmin/pkg/async/notifications/factory.go b/flyteadmin/pkg/async/notifications/factory.go index 54496376dd..53e96f7e67 100644 --- a/flyteadmin/pkg/async/notifications/factory.go +++ b/flyteadmin/pkg/async/notifications/factory.go @@ -6,13 +6,6 @@ import ( "sync" "time" - "github.com/flyteorg/flyte/flyteadmin/pkg/async" - - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/implementations" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" - runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/NYTimes/gizmo/pubsub" gizmoAWS "github.com/NYTimes/gizmo/pubsub/aws" gizmoGCP "github.com/NYTimes/gizmo/pubsub/gcp" @@ -20,7 +13,12 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ses" + "github.com/flyteorg/flyte/flyteadmin/pkg/async" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/implementations" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/common" + runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteadmin/pkg/async/notifications/factory_test.go b/flyteadmin/pkg/async/notifications/factory_test.go index f52989d386..1bfd1f4596 100644 --- a/flyteadmin/pkg/async/notifications/factory_test.go +++ b/flyteadmin/pkg/async/notifications/factory_test.go @@ -4,11 +4,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/implementations" runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) var ( diff --git a/flyteadmin/pkg/async/notifications/implementations/aws_emailer.go b/flyteadmin/pkg/async/notifications/implementations/aws_emailer.go index 94f96a1c57..72985c9548 100644 --- a/flyteadmin/pkg/async/notifications/implementations/aws_emailer.go +++ b/flyteadmin/pkg/async/notifications/implementations/aws_emailer.go @@ -5,13 +5,14 @@ import ( "github.com/aws/aws-sdk-go/service/ses" "github.com/aws/aws-sdk-go/service/ses/sesiface" + "google.golang.org/grpc/codes" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/errors" runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "google.golang.org/grpc/codes" ) type AwsEmailer struct { diff --git a/flyteadmin/pkg/async/notifications/implementations/aws_emailer_test.go b/flyteadmin/pkg/async/notifications/implementations/aws_emailer_test.go index aa8e1585b3..c06d818eec 100644 --- a/flyteadmin/pkg/async/notifications/implementations/aws_emailer_test.go +++ b/flyteadmin/pkg/async/notifications/implementations/aws_emailer_test.go @@ -1,19 +1,19 @@ package implementations import ( - "testing" - "context" + "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" "github.com/aws/aws-sdk-go/service/ses/sesiface" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/mocks" runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" ) func getNotificationsConfig() runtimeInterfaces.NotificationsConfig { diff --git a/flyteadmin/pkg/async/notifications/implementations/aws_processor.go b/flyteadmin/pkg/async/notifications/implementations/aws_processor.go index fe99ad0af9..fb3b3c2a1b 100644 --- a/flyteadmin/pkg/async/notifications/implementations/aws_processor.go +++ b/flyteadmin/pkg/async/notifications/implementations/aws_processor.go @@ -7,12 +7,13 @@ import ( "time" "github.com/NYTimes/gizmo/pubsub" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteadmin/pkg/async" "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/golang/protobuf/proto" ) // TODO: Add a counter that encompasses the publisher stats grouped by project and domain. diff --git a/flyteadmin/pkg/async/notifications/implementations/aws_processor_test.go b/flyteadmin/pkg/async/notifications/implementations/aws_processor_test.go index f189ec1cb8..ef27f1f3a8 100644 --- a/flyteadmin/pkg/async/notifications/implementations/aws_processor_test.go +++ b/flyteadmin/pkg/async/notifications/implementations/aws_processor_test.go @@ -2,16 +2,15 @@ package implementations import ( "context" + "encoding/base64" "errors" "testing" - "encoding/base64" - "github.com/aws/aws-sdk-go/aws" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/mocks" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) var mockEmailer mocks.MockEmailer diff --git a/flyteadmin/pkg/async/notifications/implementations/email_metrics.go b/flyteadmin/pkg/async/notifications/implementations/email_metrics.go index 00195b3d26..3607cee286 100644 --- a/flyteadmin/pkg/async/notifications/implementations/email_metrics.go +++ b/flyteadmin/pkg/async/notifications/implementations/email_metrics.go @@ -1,8 +1,9 @@ package implementations import ( - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/prometheus/client_golang/prometheus" + + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type emailMetrics struct { diff --git a/flyteadmin/pkg/async/notifications/implementations/event_publisher.go b/flyteadmin/pkg/async/notifications/implementations/event_publisher.go index fc501ff12f..d91f54de33 100644 --- a/flyteadmin/pkg/async/notifications/implementations/event_publisher.go +++ b/flyteadmin/pkg/async/notifications/implementations/event_publisher.go @@ -3,17 +3,15 @@ package implementations import ( "context" + "github.com/NYTimes/gizmo/pubsub" + "github.com/golang/protobuf/proto" + "github.com/prometheus/client_golang/prometheus" "k8s.io/apimachinery/pkg/util/sets" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" - - "github.com/NYTimes/gizmo/pubsub" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/golang/protobuf/proto" - "github.com/prometheus/client_golang/prometheus" ) type EventPublisherSystemMetrics struct { diff --git a/flyteadmin/pkg/async/notifications/implementations/event_publisher_test.go b/flyteadmin/pkg/async/notifications/implementations/event_publisher_test.go index c6223bbf61..804e2fadae 100644 --- a/flyteadmin/pkg/async/notifications/implementations/event_publisher_test.go +++ b/flyteadmin/pkg/async/notifications/implementations/event_publisher_test.go @@ -6,16 +6,16 @@ import ( "testing" "time" - "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/golang/protobuf/ptypes" - "github.com/NYTimes/gizmo/pubsub" "github.com/NYTimes/gizmo/pubsub/pubsubtest" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" "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/flytestdlib/promutils" ) var testEventPublisher pubsubtest.TestPublisher diff --git a/flyteadmin/pkg/async/notifications/implementations/gcp_processor.go b/flyteadmin/pkg/async/notifications/implementations/gcp_processor.go index 2127f02cf1..54e4f4a592 100644 --- a/flyteadmin/pkg/async/notifications/implementations/gcp_processor.go +++ b/flyteadmin/pkg/async/notifications/implementations/gcp_processor.go @@ -5,12 +5,13 @@ import ( "time" "github.com/NYTimes/gizmo/pubsub" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteadmin/pkg/async" "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/golang/protobuf/proto" ) // TODO: Add a counter that encompasses the publisher stats grouped by project and domain. diff --git a/flyteadmin/pkg/async/notifications/implementations/gcp_processor_test.go b/flyteadmin/pkg/async/notifications/implementations/gcp_processor_test.go index 35ab94c093..e83cf7b1d3 100644 --- a/flyteadmin/pkg/async/notifications/implementations/gcp_processor_test.go +++ b/flyteadmin/pkg/async/notifications/implementations/gcp_processor_test.go @@ -5,12 +5,13 @@ import ( "testing" "github.com/NYTimes/gizmo/pubsub/pubsubtest" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/mocks" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/pkg/errors" dto "github.com/prometheus/client_model/go" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) var ( diff --git a/flyteadmin/pkg/async/notifications/implementations/noop_notifications.go b/flyteadmin/pkg/async/notifications/implementations/noop_notifications.go index ca716113ae..4da316f6b2 100644 --- a/flyteadmin/pkg/async/notifications/implementations/noop_notifications.go +++ b/flyteadmin/pkg/async/notifications/implementations/noop_notifications.go @@ -2,15 +2,13 @@ package implementations import ( "context" + "strings" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" - - "strings" - - "github.com/golang/protobuf/proto" ) // Email to use when there is no email configuration. diff --git a/flyteadmin/pkg/async/notifications/implementations/processor_metrics.go b/flyteadmin/pkg/async/notifications/implementations/processor_metrics.go index 938ce2b325..de62632fe4 100644 --- a/flyteadmin/pkg/async/notifications/implementations/processor_metrics.go +++ b/flyteadmin/pkg/async/notifications/implementations/processor_metrics.go @@ -1,8 +1,9 @@ package implementations import ( - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/prometheus/client_golang/prometheus" + + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type processorSystemMetrics struct { diff --git a/flyteadmin/pkg/async/notifications/implementations/publisher.go b/flyteadmin/pkg/async/notifications/implementations/publisher.go index d168e51083..8d0d99411b 100644 --- a/flyteadmin/pkg/async/notifications/implementations/publisher.go +++ b/flyteadmin/pkg/async/notifications/implementations/publisher.go @@ -3,13 +3,13 @@ package implementations import ( "context" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" - "github.com/NYTimes/gizmo/pubsub" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/golang/protobuf/proto" "github.com/prometheus/client_golang/prometheus" + + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type publisherSystemMetrics struct { diff --git a/flyteadmin/pkg/async/notifications/implementations/publisher_test.go b/flyteadmin/pkg/async/notifications/implementations/publisher_test.go index e55df967fb..bde4aae325 100644 --- a/flyteadmin/pkg/async/notifications/implementations/publisher_test.go +++ b/flyteadmin/pkg/async/notifications/implementations/publisher_test.go @@ -9,11 +9,12 @@ import ( "github.com/NYTimes/gizmo/pubsub" "github.com/NYTimes/gizmo/pubsub/pubsubtest" "github.com/aws/aws-sdk-go/aws" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" ) var ( diff --git a/flyteadmin/pkg/async/notifications/implementations/sandbox_processor.go b/flyteadmin/pkg/async/notifications/implementations/sandbox_processor.go index 128b865e84..2cb83da406 100644 --- a/flyteadmin/pkg/async/notifications/implementations/sandbox_processor.go +++ b/flyteadmin/pkg/async/notifications/implementations/sandbox_processor.go @@ -4,11 +4,12 @@ import ( "context" "time" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteadmin/pkg/async" "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/golang/protobuf/proto" ) type SandboxProcessor struct { diff --git a/flyteadmin/pkg/async/notifications/implementations/sandbox_processor_test.go b/flyteadmin/pkg/async/notifications/implementations/sandbox_processor_test.go index 1a703faf70..d0ee9ee31b 100644 --- a/flyteadmin/pkg/async/notifications/implementations/sandbox_processor_test.go +++ b/flyteadmin/pkg/async/notifications/implementations/sandbox_processor_test.go @@ -5,10 +5,11 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/mocks" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/pkg/errors" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) var mockSandboxEmailer mocks.MockEmailer diff --git a/flyteadmin/pkg/async/notifications/implementations/sandbox_publisher.go b/flyteadmin/pkg/async/notifications/implementations/sandbox_publisher.go index c023d429bb..a0114a95eb 100644 --- a/flyteadmin/pkg/async/notifications/implementations/sandbox_publisher.go +++ b/flyteadmin/pkg/async/notifications/implementations/sandbox_publisher.go @@ -3,8 +3,9 @@ package implementations import ( "context" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" + + "github.com/flyteorg/flyte/flytestdlib/logger" ) type SandboxPublisher struct { diff --git a/flyteadmin/pkg/async/notifications/implementations/sendgrid_emailer_test.go b/flyteadmin/pkg/async/notifications/implementations/sendgrid_emailer_test.go index fd16c9cf15..bfedb152d0 100644 --- a/flyteadmin/pkg/async/notifications/implementations/sendgrid_emailer_test.go +++ b/flyteadmin/pkg/async/notifications/implementations/sendgrid_emailer_test.go @@ -6,10 +6,11 @@ import ( "path" "testing" + "github.com/stretchr/testify/assert" + runtimeInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) func TestAddresses(t *testing.T) { diff --git a/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler.go b/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler.go index 26bfec0631..768d195766 100644 --- a/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler.go +++ b/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler.go @@ -5,6 +5,13 @@ import ( "fmt" "strings" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/cloudwatchevents" + "github.com/prometheus/client_golang/prometheus" + "google.golang.org/grpc/codes" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/schedule/aws/interfaces" scheduleInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/async/schedule/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/errors" @@ -13,13 +20,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/cloudwatchevents" - "github.com/prometheus/client_golang/prometheus" - "google.golang.org/grpc/codes" ) // To indicate that a schedule rule is enabled. diff --git a/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler_test.go b/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler_test.go index 86b08df5b0..bb32163d1f 100644 --- a/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler_test.go +++ b/flyteadmin/pkg/async/schedule/aws/cloud_watch_scheduler_test.go @@ -5,6 +5,11 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/cloudwatchevents" + "github.com/stretchr/testify/assert" + "google.golang.org/grpc/codes" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/schedule/aws/interfaces" "github.com/flyteorg/flyte/flyteadmin/pkg/async/schedule/aws/mocks" scheduleInterfaces "github.com/flyteorg/flyte/flyteadmin/pkg/async/schedule/interfaces" @@ -12,11 +17,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/promutils" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/cloudwatchevents" - "github.com/stretchr/testify/assert" - "google.golang.org/grpc/codes" ) const testScheduleName = "flyte_16301494360130577061" diff --git a/flyteadmin/pkg/async/schedule/aws/mocks/mock_cloud_watch_event_client.go b/flyteadmin/pkg/async/schedule/aws/mocks/mock_cloud_watch_event_client.go index c7bdb4c0fc..91bda97bbe 100644 --- a/flyteadmin/pkg/async/schedule/aws/mocks/mock_cloud_watch_event_client.go +++ b/flyteadmin/pkg/async/schedule/aws/mocks/mock_cloud_watch_event_client.go @@ -2,6 +2,7 @@ package mocks import ( "github.com/aws/aws-sdk-go/service/cloudwatchevents" + "github.com/flyteorg/flyte/flyteadmin/pkg/async/schedule/aws/interfaces" ) diff --git a/flyteadmin/pkg/async/schedule/aws/serialization.go b/flyteadmin/pkg/async/schedule/aws/serialization.go index e10f3f89d8..833235f4fc 100644 --- a/flyteadmin/pkg/async/schedule/aws/serialization.go +++ b/flyteadmin/pkg/async/schedule/aws/serialization.go @@ -8,12 +8,12 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" "github.com/flyteorg/flyte/flyteadmin/pkg/errors" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const awsTimestampPlaceholder = "