From c1e084577858cb84cae0ac021063c50b7dd8ea37 Mon Sep 17 00:00:00 2001 From: squiishyy Date: Fri, 13 Oct 2023 14:02:19 -0700 Subject: [PATCH 01/15] logic and commented out tests Signed-off-by: squiishyy --- .../auth/authzserver/metadata_provider.go | 37 ++++++++++++++++++- .../authzserver/metadata_provider_test.go | 19 +++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/flyteadmin/auth/authzserver/metadata_provider.go b/flyteadmin/auth/authzserver/metadata_provider.go index 6752ecbcee..f99f881330 100644 --- a/flyteadmin/auth/authzserver/metadata_provider.go +++ b/flyteadmin/auth/authzserver/metadata_provider.go @@ -2,18 +2,30 @@ package authzserver import ( "context" + "errors" + "fmt" "io/ioutil" "net/http" "net/url" "strings" + "time" + + errrs "github.com/pkg/errors" + "google.golang.org/api/googleapi" "github.com/flyteorg/flyte/flyteadmin/auth" + "github.com/flyteorg/flyte/flyteadmin/pkg/async" authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) +var ( + retryAttempts = 5 + retryDelay = 1 * time.Second +) + type OAuth2MetadataProvider struct { cfg *authConfig.Config } @@ -74,7 +86,7 @@ func (s OAuth2MetadataProvider) GetOAuth2Metadata(ctx context.Context, r *servic httpClient.Transport = transport } - response, err := httpClient.Get(externalMetadataURL.String()) + response, err := sendAndRetryHttpRequest(httpClient, externalMetadataURL.String()) if err != nil { return nil, err } @@ -109,3 +121,26 @@ func NewService(config *authConfig.Config) OAuth2MetadataProvider { cfg: config, } } + +func sendAndRetryHttpRequest(client *http.Client, url string) (*http.Response, error) { + var response *http.Response + var err error + err = async.RetryOnSpecificErrors(retryAttempts, retryDelay, func() error { + response, err = client.Get(url) + return err + }, isTransientError) + + if err != nil { + e, _ := errrs.Cause(err).(*googleapi.Error) + return nil, errors.New(fmt.Sprintf("Failed to get oauth metadata after %v attempts. Error code: %v Err: %v", retryAttempts, e.Code, e.Error())) + } + + return response, nil +} + +func isTransientError(err error) bool { + if e, ok := errrs.Cause(err).(*googleapi.Error); ok && e.Code >= 500 && e.Code <= 599 { + return true + } + return false +} diff --git a/flyteadmin/auth/authzserver/metadata_provider_test.go b/flyteadmin/auth/authzserver/metadata_provider_test.go index 79bcc7b727..c5f5b5813a 100644 --- a/flyteadmin/auth/authzserver/metadata_provider_test.go +++ b/flyteadmin/auth/authzserver/metadata_provider_test.go @@ -10,10 +10,11 @@ import ( 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" ) func TestOAuth2MetadataProvider_FlyteClient(t *testing.T) { @@ -111,3 +112,19 @@ func TestOAuth2MetadataProvider_OAuth2Metadata(t *testing.T) { assert.Equal(t, "https://dev-14186422.okta.com", resp.Issuer) }) } + +//func TestSendAndRetryHttpRequest(t *testing.T) { +// cm := ClientMock{} +// response, err := sendAndRetryHttpRequest(&cm, "url") +//} +// +//type ClientMock struct { +//} +// +//func (c *ClientMock) Do(req *http.Request) (*http.Response, error) { +// return &http.Response{}, errors.New("fail") +//} +// +//type HttpClient interface { +// Do(req *http.Request) (*http.Response, error) +//} From d5ae64b8c21c7c22d1187c2139762bb78813abfb Mon Sep 17 00:00:00 2001 From: squiishyy Date: Tue, 17 Oct 2023 16:41:57 -0700 Subject: [PATCH 02/15] make RetryOnSpecificErrorCodes, added functionality for calling sendhttprequestwithretry, need to work on config mappingn still, tests in Signed-off-by: squiishyy --- .../auth/authzserver/metadata_provider.go | 35 ++++++++++------ .../authzserver/metadata_provider_test.go | 42 ++++++++++++------- flyteadmin/auth/config/config.go | 3 +- flyteadmin/pkg/async/shared.go | 19 +++++++++ 4 files changed, 70 insertions(+), 29 deletions(-) diff --git a/flyteadmin/auth/authzserver/metadata_provider.go b/flyteadmin/auth/authzserver/metadata_provider.go index f99f881330..7a1a4428d5 100644 --- a/flyteadmin/auth/authzserver/metadata_provider.go +++ b/flyteadmin/auth/authzserver/metadata_provider.go @@ -10,11 +10,12 @@ import ( "strings" "time" - errrs "github.com/pkg/errors" - "google.golang.org/api/googleapi" + "google.golang.org/grpc/codes" "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/flyteorg/flyte/flyteadmin/pkg/async" + flyteErrors "github.com/flyteorg/flyte/flyteadmin/pkg/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" @@ -22,8 +23,8 @@ import ( ) var ( - retryAttempts = 5 - retryDelay = 1 * time.Second + defaultRetryAttempts = 5 + defaultRetryDelay = 1 * time.Second ) type OAuth2MetadataProvider struct { @@ -86,8 +87,13 @@ func (s OAuth2MetadataProvider) GetOAuth2Metadata(ctx context.Context, r *servic httpClient.Transport = transport } - response, err := sendAndRetryHttpRequest(httpClient, externalMetadataURL.String()) + response, err := sendAndRetryHttpRequest(httpClient, externalMetadataURL.String(), defaultRetryAttempts, defaultRetryDelay) if err != nil { + if response != nil { + logger.Errorf(ctx, "Failed to get oauth metadata. Error code: %v. Err: %v", response.StatusCode, err) + return nil, flyteErrors.NewFlyteAdminError(codes.Code(response.StatusCode), "Failed to get oauth metadata.") + } + logger.Errorf(ctx, "Failed to get oauth metadata. Err: %v", response.StatusCode, err) return nil, err } @@ -122,24 +128,27 @@ func NewService(config *authConfig.Config) OAuth2MetadataProvider { } } -func sendAndRetryHttpRequest(client *http.Client, url string) (*http.Response, error) { +func sendAndRetryHttpRequest(client *http.Client, url string, retryAttempts int, retryDelay time.Duration) (*http.Response, error) { var response *http.Response var err error - err = async.RetryOnSpecificErrors(retryAttempts, retryDelay, func() error { + err = async.RetryOnSpecificErrorCodes(retryAttempts, retryDelay, func() (*http.Response, error) { response, err = client.Get(url) - return err - }, isTransientError) + return response, err + }, isTransientErrorCode) if err != nil { - e, _ := errrs.Cause(err).(*googleapi.Error) - return nil, errors.New(fmt.Sprintf("Failed to get oauth metadata after %v attempts. Error code: %v Err: %v", retryAttempts, e.Code, e.Error())) + return nil, err + } + + if response.StatusCode != http.StatusOK { + return response, errors.New(fmt.Sprint("Failed to get oauth metadata")) } return response, nil } -func isTransientError(err error) bool { - if e, ok := errrs.Cause(err).(*googleapi.Error); ok && e.Code >= 500 && e.Code <= 599 { +func isTransientErrorCode(resp *http.Response) bool { + if resp.StatusCode >= 500 && resp.StatusCode <= 599 { return true } return false diff --git a/flyteadmin/auth/authzserver/metadata_provider_test.go b/flyteadmin/auth/authzserver/metadata_provider_test.go index c5f5b5813a..6e36b6734c 100644 --- a/flyteadmin/auth/authzserver/metadata_provider_test.go +++ b/flyteadmin/auth/authzserver/metadata_provider_test.go @@ -17,6 +17,8 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) +var oauthMetadataFailureErrorMessage = "Failed to get oauth metadata" + func TestOAuth2MetadataProvider_FlyteClient(t *testing.T) { provider := NewService(&authConfig.Config{ AppAuth: authConfig.OAuth2Options{ @@ -113,18 +115,28 @@ func TestOAuth2MetadataProvider_OAuth2Metadata(t *testing.T) { }) } -//func TestSendAndRetryHttpRequest(t *testing.T) { -// cm := ClientMock{} -// response, err := sendAndRetryHttpRequest(&cm, "url") -//} -// -//type ClientMock struct { -//} -// -//func (c *ClientMock) Do(req *http.Request) (*http.Response, error) { -// return &http.Response{}, errors.New("fail") -//} -// -//type HttpClient interface { -// Do(req *http.Request) (*http.Response, error) -//} +func TestSendAndRetryHttpRequest(t *testing.T) { + hf := func(w http.ResponseWriter, r *http.Request) { + switch strings.TrimSpace(r.URL.Path) { + case "/": + mockExternalMetadataEndpointTransientFailure(w, r) + default: + http.NotFoundHandler().ServeHTTP(w, r) + } + + } + + server := httptest.NewServer(http.HandlerFunc(hf)) + defer server.Close() + http.DefaultClient = server.Client() + + resp, err := sendAndRetryHttpRequest(server.Client(), server.URL, 5, 0) + assert.Error(t, err) + assert.Equal(t, oauthMetadataFailureErrorMessage, err.Error()) + assert.NotNil(t, resp) + assert.Equal(t, 500, resp.StatusCode) +} + +func mockExternalMetadataEndpointTransientFailure(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(500) +} diff --git a/flyteadmin/auth/config/config.go b/flyteadmin/auth/config/config.go index 217983683e..a192da04da 100644 --- a/flyteadmin/auth/config/config.go +++ b/flyteadmin/auth/config/config.go @@ -191,7 +191,8 @@ type ExternalAuthorizationServer struct { AllowedAudience []string `json:"allowedAudience" pflag:",Optional: A list of allowed audiences. If not provided, the audience is expected to be the public Uri of the service."` MetadataEndpointURL config.URL `json:"metadataUrl" pflag:",Optional: If the server doesn't support /.well-known/oauth-authorization-server, you can set a custom metadata url here.'"` // HTTPProxyURL allows operators to access external OAuth2 servers using an external HTTP Proxy - HTTPProxyURL config.URL `json:"httpProxyURL" pflag:",OPTIONAL: HTTP Proxy to be used for OAuth requests."` + HTTPProxyURL config.URL `json:"httpProxyURL" pflag:",OPTIONAL: HTTP Proxy to be used for OAuth requests."` + RetryAttempts int `json:"retryAttempts" default:"5" pflag:", Optional: The number of attempted retries on a transient failure to get the OAuth metadata"` } // OAuth2Options defines settings for app auth. diff --git a/flyteadmin/pkg/async/shared.go b/flyteadmin/pkg/async/shared.go index 9fafb50479..26b8268478 100644 --- a/flyteadmin/pkg/async/shared.go +++ b/flyteadmin/pkg/async/shared.go @@ -2,6 +2,7 @@ package async import ( "context" + "net/http" "time" "github.com/flyteorg/flyte/flytestdlib/logger" @@ -10,6 +11,24 @@ import ( // RetryDelay indicates how long to wait between restarting a subscriber connection in the case of network failures. var RetryDelay = 30 * time.Second +func RetryOnSpecificErrorCodes(attempts int, delay time.Duration, f func() (*http.Response, error), IsErrorCodeRetryable func(*http.Response) bool) error { + var err error + var resp *http.Response + for attempt := 0; attempt <= attempts; attempt++ { + resp, err = f() + if err != nil { + return err + } + if !IsErrorCodeRetryable(resp) { + return err + } + logger.Warningf(context.Background(), + "Failed status code %v on attempt %d of %d", resp.StatusCode, attempt, attempts) + time.Sleep(delay) + } + return err +} + func RetryOnSpecificErrors(attempts int, delay time.Duration, f func() error, IsErrorRetryable func(error) bool) error { var err error for attempt := 0; attempt <= attempts; attempt++ { From a0b76c39ad118734f419f90fe8a125c43d05704f Mon Sep 17 00:00:00 2001 From: squiishyy Date: Wed, 18 Oct 2023 11:10:33 -0700 Subject: [PATCH 03/15] adding default config values Signed-off-by: squiishyy --- .../auth/authzserver/metadata_provider.go | 13 +++------ flyteadmin/auth/config/config.go | 9 ++++-- flyteadmin/auth/config/config_flags.go | 2 ++ flyteadmin/auth/config/config_flags_test.go | 28 +++++++++++++++++++ 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/flyteadmin/auth/authzserver/metadata_provider.go b/flyteadmin/auth/authzserver/metadata_provider.go index 7a1a4428d5..87db579e6e 100644 --- a/flyteadmin/auth/authzserver/metadata_provider.go +++ b/flyteadmin/auth/authzserver/metadata_provider.go @@ -22,11 +22,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) -var ( - defaultRetryAttempts = 5 - defaultRetryDelay = 1 * time.Second -) - type OAuth2MetadataProvider struct { cfg *authConfig.Config } @@ -86,15 +81,15 @@ func (s OAuth2MetadataProvider) GetOAuth2Metadata(ctx context.Context, r *servic } httpClient.Transport = transport } - - response, err := sendAndRetryHttpRequest(httpClient, externalMetadataURL.String(), defaultRetryAttempts, defaultRetryDelay) + logger.Printf(ctx, "retryAttempts: %v retryDuration: %v", s.cfg.AppAuth.ExternalAuthServer.RetryAttempts, s.cfg.AppAuth.ExternalAuthServer.RetryDelayMilliseconds) + response, err := sendAndRetryHttpRequest(httpClient, externalMetadataURL.String(), s.cfg.AppAuth.ExternalAuthServer.RetryAttempts, s.cfg.AppAuth.ExternalAuthServer.RetryDelayMilliseconds.Duration) if err != nil { if response != nil { logger.Errorf(ctx, "Failed to get oauth metadata. Error code: %v. Err: %v", response.StatusCode, err) return nil, flyteErrors.NewFlyteAdminError(codes.Code(response.StatusCode), "Failed to get oauth metadata.") } - logger.Errorf(ctx, "Failed to get oauth metadata. Err: %v", response.StatusCode, err) - return nil, err + logger.Errorf(ctx, "Failed to get oauth metadata. Err: %v", err) + return nil, flyteErrors.NewFlyteAdminError(codes.Code(500), "Failed to get oauth metadata.") } raw, err := ioutil.ReadAll(response.Body) diff --git a/flyteadmin/auth/config/config.go b/flyteadmin/auth/config/config.go index a192da04da..8ba4f7aca6 100644 --- a/flyteadmin/auth/config/config.go +++ b/flyteadmin/auth/config/config.go @@ -79,6 +79,10 @@ var ( }, }, AppAuth: OAuth2Options{ + ExternalAuthServer: ExternalAuthorizationServer{ + RetryAttempts: 5, + RetryDelayMilliseconds: config.Duration{Duration: 1000 * time.Millisecond}, + }, AuthServerType: AuthorizationServerTypeSelf, ThirdParty: ThirdPartyConfigOptions{ FlyteClientConfig: FlyteClientConfig{ @@ -191,8 +195,9 @@ type ExternalAuthorizationServer struct { AllowedAudience []string `json:"allowedAudience" pflag:",Optional: A list of allowed audiences. If not provided, the audience is expected to be the public Uri of the service."` MetadataEndpointURL config.URL `json:"metadataUrl" pflag:",Optional: If the server doesn't support /.well-known/oauth-authorization-server, you can set a custom metadata url here.'"` // HTTPProxyURL allows operators to access external OAuth2 servers using an external HTTP Proxy - HTTPProxyURL config.URL `json:"httpProxyURL" pflag:",OPTIONAL: HTTP Proxy to be used for OAuth requests."` - RetryAttempts int `json:"retryAttempts" default:"5" pflag:", Optional: The number of attempted retries on a transient failure to get the OAuth metadata"` + HTTPProxyURL config.URL `json:"httpProxyURL" pflag:",OPTIONAL: HTTP Proxy to be used for OAuth requests."` + RetryAttempts int `json:"retryAttempts" pflag:", Optional: The number of attempted retries on a transient failure to get the OAuth metadata"` + RetryDelayMilliseconds config.Duration `json:"retryDelayMilliseconds" pflag:", Optional, Duration in milliseconds to wait between retries"` } // OAuth2Options defines settings for app auth. diff --git a/flyteadmin/auth/config/config_flags.go b/flyteadmin/auth/config/config_flags.go index 225e8a5c9d..a1cb45b501 100755 --- a/flyteadmin/auth/config/config_flags.go +++ b/flyteadmin/auth/config/config_flags.go @@ -77,6 +77,8 @@ func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.StringSlice(fmt.Sprintf("%v%v", prefix, "appAuth.externalAuthServer.allowedAudience"), DefaultConfig.AppAuth.ExternalAuthServer.AllowedAudience, "Optional: A list of allowed audiences. If not provided, the audience is expected to be the public Uri of the service.") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.externalAuthServer.metadataUrl"), DefaultConfig.AppAuth.ExternalAuthServer.MetadataEndpointURL.String(), "Optional: If the server doesn't support /.well-known/oauth-authorization-server, you can set a custom metadata url here.'") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.externalAuthServer.httpProxyURL"), DefaultConfig.AppAuth.ExternalAuthServer.HTTPProxyURL.String(), "OPTIONAL: HTTP Proxy to be used for OAuth requests.") + cmdFlags.Int(fmt.Sprintf("%v%v", prefix, "appAuth.externalAuthServer.retryAttempts"), DefaultConfig.AppAuth.ExternalAuthServer.RetryAttempts, " Optional: The number of attempted retries on a transient failure to get the OAuth metadata") + cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.externalAuthServer.retryDelayMilliseconds"), DefaultConfig.AppAuth.ExternalAuthServer.RetryDelayMilliseconds.String(), " Optional, Duration in milliseconds to wait between retries") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.thirdPartyConfig.flyteClient.clientId"), DefaultConfig.AppAuth.ThirdParty.FlyteClientConfig.ClientID, "public identifier for the app which handles authorization for a Flyte deployment") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.thirdPartyConfig.flyteClient.redirectUri"), DefaultConfig.AppAuth.ThirdParty.FlyteClientConfig.RedirectURI, "This is the callback uri registered with the app which handles authorization for a Flyte deployment") cmdFlags.StringSlice(fmt.Sprintf("%v%v", prefix, "appAuth.thirdPartyConfig.flyteClient.scopes"), DefaultConfig.AppAuth.ThirdParty.FlyteClientConfig.Scopes, "Recommended scopes for the client to request.") diff --git a/flyteadmin/auth/config/config_flags_test.go b/flyteadmin/auth/config/config_flags_test.go index 28efafc380..3145c826f2 100755 --- a/flyteadmin/auth/config/config_flags_test.go +++ b/flyteadmin/auth/config/config_flags_test.go @@ -477,6 +477,34 @@ func TestConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_appAuth.externalAuthServer.retryAttempts", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("appAuth.externalAuthServer.retryAttempts", testValue) + if vInt, err := cmdFlags.GetInt("appAuth.externalAuthServer.retryAttempts"); err == nil { + testDecodeJson_Config(t, fmt.Sprintf("%v", vInt), &actual.AppAuth.ExternalAuthServer.RetryAttempts) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) + t.Run("Test_appAuth.externalAuthServer.retryDelayMilliseconds", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := DefaultConfig.AppAuth.ExternalAuthServer.RetryDelayMilliseconds.String() + + cmdFlags.Set("appAuth.externalAuthServer.retryDelayMilliseconds", testValue) + if vString, err := cmdFlags.GetString("appAuth.externalAuthServer.retryDelayMilliseconds"); err == nil { + testDecodeJson_Config(t, fmt.Sprintf("%v", vString), &actual.AppAuth.ExternalAuthServer.RetryDelayMilliseconds) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) t.Run("Test_appAuth.thirdPartyConfig.flyteClient.clientId", func(t *testing.T) { t.Run("Override", func(t *testing.T) { From 7462a07f4c0b6d1ed73221452bd0dc38a6c15c3c Mon Sep 17 00:00:00 2001 From: Surav Shrestha Date: Sat, 14 Oct 2023 03:46:20 +0545 Subject: [PATCH 04/15] docs: fix typo in ./kustomize/README.md (#4218) Signed-off-by: Surav Shrestha Signed-off-by: squiishyy --- kustomize/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kustomize/README.md b/kustomize/README.md index 94f0f6ec56..69a9c10d0c 100644 --- a/kustomize/README.md +++ b/kustomize/README.md @@ -6,7 +6,7 @@ In brief, Kustomize allows composing a deployment yaml using multiple components a composed set of components that can be deployed to a [Single Kubernetes cluster](./base/single_cluster). This deployment configures various components using [Flyte Configuration system](todo). -The *Single Cluster* configuration on its own is not deployable. But indiviudal [overlays](./overlays) are deployable. +The *Single Cluster* configuration on its own is not deployable. But individual [overlays](./overlays) are deployable. Refer to 1. [Base Components](./base): If you want to build your own overlay start here From 851f6456b46db31a2cd7841c6c06ea98f9cbcee2 Mon Sep 17 00:00:00 2001 From: Andrew Dye Date: Mon, 16 Oct 2023 10:16:13 -0700 Subject: [PATCH 05/15] Format go imports (flyteplugins) (#4224) Signed-off-by: Andrew Dye Signed-off-by: squiishyy --- flyteplugins/.golangci.yml | 14 ++++++- .../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 | 40 +++++++++++++++++++ .../flyte/golangci_file/Readme.rst | 8 ++++ .../boilerplate/flyte/golangci_file/update.sh | 14 +++++++ flyteplugins/boilerplate/update.cfg | 5 ++- flyteplugins/go/tasks/aws/client.go | 8 ++-- flyteplugins/go/tasks/aws/config.go | 2 +- flyteplugins/go/tasks/logs/logging_utils.go | 4 +- .../go/tasks/logs/logging_utils_test.go | 8 ++-- .../tasks/pluginmachinery/bundle/fail_fast.go | 2 - .../pluginmachinery/bundle/fail_fast_test.go | 5 +-- .../pluginmachinery/catalog/async_client.go | 4 +- .../catalog/async_client_impl_test.go | 3 +- .../tasks/pluginmachinery/catalog/client.go | 1 - .../pluginmachinery/catalog/hashing_test.go | 3 +- .../catalog/reader_processor.go | 6 +-- .../catalog/writer_processor.go | 3 +- .../pluginmachinery/core/exec_metadata.go | 3 +- .../core/mocks/fake_k8s_cache.go | 6 +-- .../tasks/pluginmachinery/core/plugin_test.go | 3 +- .../pluginmachinery/core/setup_context.go | 3 +- .../pluginmachinery/core/template/template.go | 5 ++- .../core/template/template_test.go | 5 +-- .../pluginmachinery/flytek8s/config/config.go | 5 +-- .../flytek8s/container_helper.go | 11 +++-- .../flytek8s/container_helper_test.go | 13 +++--- .../tasks/pluginmachinery/flytek8s/copilot.go | 6 +-- .../pluginmachinery/flytek8s/copilot_test.go | 6 +-- .../flytek8s/k8s_resource_adds.go | 6 +-- .../flytek8s/k8s_resource_adds_test.go | 5 +-- .../pluginmachinery/flytek8s/pod_helper.go | 13 +++--- .../flytek8s/pod_helper_test.go | 15 +++---- .../flytek8s/pod_template_store.go | 4 +- .../flytek8s/pod_template_store_test.go | 1 - .../tasks/pluginmachinery/flytek8s/utils.go | 5 ++- .../pluginmachinery/flytek8s/utils_test.go | 6 +-- ..._workload_identity_token_source_factory.go | 3 +- .../internal/webapi/allocation_token.go | 6 +-- .../internal/webapi/allocation_token_test.go | 17 +++----- .../pluginmachinery/internal/webapi/cache.go | 8 +--- .../internal/webapi/cache_test.go | 9 ++--- .../pluginmachinery/internal/webapi/core.go | 9 ++--- .../internal/webapi/core_test.go | 3 +- .../internal/webapi/launcher.go | 5 +-- .../internal/webapi/launcher_test.go | 4 +- .../internal/webapi/metrics.go | 3 +- .../internal/webapi/monitor.go | 3 +- .../internal/webapi/monitor_test.go | 14 +++---- .../ioutils/cached_input_reader.go | 1 - .../ioutils/in_memory_output_reader.go | 3 +- .../ioutils/in_memory_output_reader_test.go | 3 +- .../go/tasks/pluginmachinery/ioutils/paths.go | 1 - .../pluginmachinery/ioutils/paths_test.go | 3 +- .../ioutils/raw_output_path.go | 3 +- .../ioutils/raw_output_path_test.go | 3 +- .../ioutils/remote_file_input_reader.go | 6 +-- .../ioutils/remote_file_input_reader_test.go | 3 +- .../ioutils/remote_file_output_reader.go | 3 +- .../ioutils/remote_file_output_reader_test.go | 6 +-- .../ioutils/remote_file_output_writer.go | 1 - .../ioutils/remote_file_output_writer_test.go | 3 +- .../pluginmachinery/ioutils/task_reader.go | 4 +- .../ioutils/task_reader_test.go | 5 ++- .../go/tasks/pluginmachinery/k8s/client.go | 5 +-- .../go/tasks/pluginmachinery/k8s/plugin.go | 6 +-- .../go/tasks/pluginmachinery/registry.go | 6 +-- .../pluginmachinery/tasklog/template_test.go | 4 +- .../go/tasks/pluginmachinery/utils/dns.go | 3 +- .../utils/secrets/marshaler.go | 3 +- .../utils/secrets/marshaler_test.go | 4 +- .../webapi/example/config_test.go | 3 +- .../pluginmachinery/webapi/example/plugin.go | 6 +-- .../go/tasks/pluginmachinery/webapi/plugin.go | 6 +-- .../tasks/pluginmachinery/workqueue/queue.go | 10 ++--- .../pluginmachinery/workqueue/queue_test.go | 4 +- .../tasks/plugins/array/array_tests_base.go | 15 +++---- .../plugins/array/arraystatus/status_test.go | 5 +-- .../go/tasks/plugins/array/awsbatch/client.go | 1 + .../plugins/array/awsbatch/client_test.go | 14 +++---- .../tasks/plugins/array/awsbatch/executor.go | 19 +++------ .../plugins/array/awsbatch/executor_test.go | 22 ++++------ .../plugins/array/awsbatch/job_config.go | 3 +- .../plugins/array/awsbatch/job_definition.go | 5 +-- .../array/awsbatch/job_definition_test.go | 8 ++-- .../plugins/array/awsbatch/jobs_store.go | 13 ++---- .../plugins/array/awsbatch/jobs_store_test.go | 13 ++---- .../tasks/plugins/array/awsbatch/launcher.go | 9 ++--- .../plugins/array/awsbatch/launcher_test.go | 31 +++++--------- .../plugins/array/awsbatch/mocks/batch.go | 1 - .../tasks/plugins/array/awsbatch/monitor.go | 14 ++----- .../plugins/array/awsbatch/monitor_test.go | 31 ++++++-------- .../plugins/array/awsbatch/task_links.go | 10 ++--- .../plugins/array/awsbatch/transformer.go | 13 +++--- .../array/awsbatch/transformer_test.go | 22 ++++------ .../go/tasks/plugins/array/catalog.go | 11 ++--- .../go/tasks/plugins/array/catalog_test.go | 14 +++---- .../go/tasks/plugins/array/core/metadata.go | 1 - .../tasks/plugins/array/core/metadata_test.go | 6 +-- .../go/tasks/plugins/array/core/state.go | 9 ++--- .../go/tasks/plugins/array/core/state_test.go | 7 ++-- .../go/tasks/plugins/array/inputs_test.go | 6 +-- .../go/tasks/plugins/array/k8s/config.go | 3 +- .../go/tasks/plugins/array/k8s/executor.go | 7 ++-- .../plugins/array/k8s/integration_test.go | 14 +++---- .../go/tasks/plugins/array/k8s/management.go | 2 - .../plugins/array/k8s/management_test.go | 21 ++++------ .../go/tasks/plugins/array/k8s/subtask.go | 14 +++---- .../plugins/array/k8s/subtask_exec_context.go | 2 - .../array/k8s/subtask_exec_context_test.go | 5 +-- .../go/tasks/plugins/array/outputs.go | 19 ++++----- .../go/tasks/plugins/array/outputs_test.go | 31 +++++--------- .../plugins/hive/client/qubole_client.go | 4 +- .../go/tasks/plugins/hive/config/config.go | 3 +- .../go/tasks/plugins/hive/execution_state.go | 17 +++----- .../plugins/hive/execution_state_test.go | 21 ++++------ .../go/tasks/plugins/hive/executions_cache.go | 7 +--- .../plugins/hive/executions_cache_test.go | 9 ++--- .../go/tasks/plugins/hive/executor.go | 3 +- .../go/tasks/plugins/hive/executor_metrics.go | 3 +- .../go/tasks/plugins/hive/test_helpers.go | 13 +++--- .../go/tasks/plugins/k8s/dask/dask_test.go | 14 +++---- .../k8s/kfoperators/common/common_operator.go | 12 +++--- .../common/common_operator_test.go | 10 ++--- .../tasks/plugins/k8s/kfoperators/mpi/mpi.go | 14 +++---- .../plugins/k8s/kfoperators/mpi/mpi_test.go | 24 +++++------ .../k8s/kfoperators/pytorch/pytorch.go | 17 ++++---- .../k8s/kfoperators/pytorch/pytorch_test.go | 36 +++++++---------- .../k8s/kfoperators/tensorflow/tensorflow.go | 17 ++++---- .../kfoperators/tensorflow/tensorflow_test.go | 35 +++++++--------- .../tasks/plugins/k8s/pod/container_test.go | 17 ++++---- .../go/tasks/plugins/k8s/pod/plugin.go | 10 ++--- .../go/tasks/plugins/k8s/pod/sidecar_test.go | 22 +++++----- .../go/tasks/plugins/k8s/ray/config_test.go | 3 +- flyteplugins/go/tasks/plugins/k8s/ray/ray.go | 18 ++++----- .../go/tasks/plugins/k8s/ray/ray_test.go | 25 +++++------- .../plugins/k8s/sagemaker/builtin_training.go | 27 +++++-------- .../k8s/sagemaker/builtin_training_test.go | 14 +++---- .../plugins/k8s/sagemaker/custom_training.go | 16 +++----- .../k8s/sagemaker/custom_training_test.go | 13 +++--- .../k8s/sagemaker/hyperparameter_tuning.go | 26 +++++------- .../sagemaker/hyperparameter_tuning_test.go | 12 +++--- .../go/tasks/plugins/k8s/sagemaker/outputs.go | 9 ++--- .../plugins/k8s/sagemaker/outputs_test.go | 3 +- .../go/tasks/plugins/k8s/sagemaker/plugin.go | 11 ++--- .../plugins/k8s/sagemaker/plugin_test.go | 11 +++-- .../k8s/sagemaker/plugin_test_utils.go | 19 +++++---- .../go/tasks/plugins/k8s/sagemaker/utils.go | 17 ++++---- .../tasks/plugins/k8s/sagemaker/utils_test.go | 15 +++---- .../presto/client/noop_presto_client.go | 1 - .../go/tasks/plugins/presto/config/config.go | 3 +- .../tasks/plugins/presto/execution_state.go | 25 ++++-------- .../plugins/presto/execution_state_test.go | 12 +++--- .../tasks/plugins/presto/executions_cache.go | 7 +--- .../plugins/presto/executions_cache_test.go | 12 +++--- .../go/tasks/plugins/presto/executor.go | 6 +-- .../go/tasks/plugins/presto/helpers_test.go | 13 +++--- .../tasks/plugins/webapi/agent/config_test.go | 4 +- .../plugins/webapi/agent/integration_test.go | 18 ++++----- .../go/tasks/plugins/webapi/agent/plugin.go | 7 ++-- .../tasks/plugins/webapi/agent/plugin_test.go | 7 ++-- .../go/tasks/plugins/webapi/athena/plugin.go | 14 +++---- .../plugins/webapi/athena/plugin_test.go | 3 +- .../go/tasks/plugins/webapi/athena/utils.go | 11 ++--- .../tasks/plugins/webapi/athena/utils_test.go | 14 +++---- .../tasks/plugins/webapi/bigquery/config.go | 3 +- .../webapi/bigquery/integration_test.go | 8 ++-- .../tasks/plugins/webapi/bigquery/plugin.go | 22 ++++------ .../plugins/webapi/bigquery/plugin_test.go | 18 ++++----- .../plugins/webapi/bigquery/query_job.go | 4 +- .../plugins/webapi/bigquery/query_job_test.go | 4 +- .../webapi/databricks/integration_test.go | 8 ++-- .../tasks/plugins/webapi/databricks/plugin.go | 11 ++--- .../plugins/webapi/databricks/plugin_test.go | 3 +- .../webapi/snowflake/integration_test.go | 5 ++- .../tasks/plugins/webapi/snowflake/plugin.go | 8 ++-- .../plugins/webapi/snowflake/plugin_test.go | 3 +- flyteplugins/tests/end_to_end.go | 32 +++++---------- 180 files changed, 731 insertions(+), 971 deletions(-) create mode 100644 flyteplugins/boilerplate/flyte/golangci_file/.golangci.yml create mode 100644 flyteplugins/boilerplate/flyte/golangci_file/Readme.rst create mode 100755 flyteplugins/boilerplate/flyte/golangci_file/update.sh diff --git a/flyteplugins/.golangci.yml b/flyteplugins/.golangci.yml index a414f33f79..7f4dbc80e8 100644 --- a/flyteplugins/.golangci.yml +++ b/flyteplugins/.golangci.yml @@ -1,7 +1,7 @@ # WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: +# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: # -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst +# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst run: skip-dirs: @@ -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/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go b/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go index a78b61162a..6c3da04107 100644 --- a/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go +++ b/flyteplugins/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/flyteplugins/boilerplate/flyte/golang_test_targets/download_tooling.sh b/flyteplugins/boilerplate/flyte/golang_test_targets/download_tooling.sh index c7e5577ef3..9cd49959f4 100755 --- a/flyteplugins/boilerplate/flyte/golang_test_targets/download_tooling.sh +++ b/flyteplugins/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/flyteplugins/boilerplate/flyte/golang_test_targets/goimports b/flyteplugins/boilerplate/flyte/golang_test_targets/goimports index af1829036c..40f50d106e 100755 --- a/flyteplugins/boilerplate/flyte/golang_test_targets/goimports +++ b/flyteplugins/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/flyteplugins/boilerplate/flyte/golangci_file/.golangci.yml b/flyteplugins/boilerplate/flyte/golangci_file/.golangci.yml new file mode 100644 index 0000000000..7f4dbc80e8 --- /dev/null +++ b/flyteplugins/boilerplate/flyte/golangci_file/.golangci.yml @@ -0,0 +1,40 @@ +# 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 + +run: + skip-dirs: + - pkg/client + +linters: + disable-all: true + enable: + - deadcode + - errcheck + - gas + - gci + - goconst + - goimports + - golint + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - staticcheck + - structcheck + - typecheck + - unconvert + - unparam + - unused + - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true diff --git a/flyteplugins/boilerplate/flyte/golangci_file/Readme.rst b/flyteplugins/boilerplate/flyte/golangci_file/Readme.rst new file mode 100644 index 0000000000..e4cbd18b96 --- /dev/null +++ b/flyteplugins/boilerplate/flyte/golangci_file/Readme.rst @@ -0,0 +1,8 @@ +GolangCI File +~~~~~~~~~~~~~ + +Provides a ``.golangci`` file with the linters we've agreed upon. + +**To Enable:** + +Add ``flyteorg/golangci_file`` to your ``boilerplate/update.cfg`` file. diff --git a/flyteplugins/boilerplate/flyte/golangci_file/update.sh b/flyteplugins/boilerplate/flyte/golangci_file/update.sh new file mode 100755 index 0000000000..ab2f85c680 --- /dev/null +++ b/flyteplugins/boilerplate/flyte/golangci_file/update.sh @@ -0,0 +1,14 @@ +#!/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 + +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +# Clone the .golangci file +echo " - copying ${DIR}/.golangci to the root directory." +cp ${DIR}/.golangci.yml ${DIR}/../../../.golangci.yml diff --git a/flyteplugins/boilerplate/update.cfg b/flyteplugins/boilerplate/update.cfg index d4c008a812..3a632dbe72 100755 --- a/flyteplugins/boilerplate/update.cfg +++ b/flyteplugins/boilerplate/update.cfg @@ -1,5 +1,6 @@ +flyte/code_of_conduct +flyte/docker_build flyte/golang_test_targets flyte/golang_support_tools +flyte/golangci_file flyte/pull_request_template -flyte/docker_build -flyte/code_of_conduct diff --git a/flyteplugins/go/tasks/aws/client.go b/flyteplugins/go/tasks/aws/client.go index cc0d606c9a..7d6d47d655 100644 --- a/flyteplugins/go/tasks/aws/client.go +++ b/flyteplugins/go/tasks/aws/client.go @@ -6,18 +6,16 @@ package aws import ( + "context" "fmt" "os" - - "github.com/flyteorg/flyte/flytestdlib/errors" - - "context" - "sync" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" + + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flyteplugins/go/tasks/aws/config.go b/flyteplugins/go/tasks/aws/config.go index 9f614bef29..387305ebec 100644 --- a/flyteplugins/go/tasks/aws/config.go +++ b/flyteplugins/go/tasks/aws/config.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/retry" awsConfig "github.com/aws/aws-sdk-go-v2/config" - "github.com/flyteorg/flyte/flytestdlib/config" pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" + "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate pflags Config --default-var defaultConfig diff --git a/flyteplugins/go/tasks/logs/logging_utils.go b/flyteplugins/go/tasks/logs/logging_utils.go index 5fc636e7e0..0ca515d7c8 100644 --- a/flyteplugins/go/tasks/logs/logging_utils.go +++ b/flyteplugins/go/tasks/logs/logging_utils.go @@ -5,11 +5,11 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" + v1 "k8s.io/api/core/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flytestdlib/logger" - v1 "k8s.io/api/core/v1" ) type logPlugin struct { diff --git a/flyteplugins/go/tasks/logs/logging_utils_test.go b/flyteplugins/go/tasks/logs/logging_utils_test.go index 42e6fdd83b..fbf86b9933 100644 --- a/flyteplugins/go/tasks/logs/logging_utils_test.go +++ b/flyteplugins/go/tasks/logs/logging_utils_test.go @@ -4,13 +4,13 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/go-test/deep" - v12 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" + v12 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" ) const podName = "PodName" diff --git a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go index 04ba00528d..a36edf20ea 100644 --- a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go +++ b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go @@ -6,9 +6,7 @@ import ( "time" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go index 956e38a922..c302db8c32 100644 --- a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go @@ -4,13 +4,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) var testHandler = failFastHandler{} diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go index 91470f7994..7e309396fc 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go @@ -3,11 +3,9 @@ package catalog import ( "context" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/errors" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ) type ResponseStatus uint8 diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go index b1acc2c953..4b8e2efb37 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go @@ -5,12 +5,13 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/stretchr/testify/mock" ) var exampleInterface = &core.TypedInterface{ diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/client.go b/flyteplugins/go/tasks/pluginmachinery/catalog/client.go index 4a9b804492..aedc2795dd 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/client.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/client.go @@ -10,7 +10,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go b/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go index 070e023e94..43b6754c02 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestHashLiteralMap_LiteralsWithHashSet(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go b/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go index 29ee207487..a7038b8bf3 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go @@ -6,14 +6,10 @@ import ( "reflect" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type ReaderWorkItem struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go b/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go index 835e5a4f0d..4d5d84c33c 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go @@ -6,11 +6,10 @@ import ( "reflect" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type WriterWorkItem struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go b/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go index 7dc5ece5df..8517b9c385 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go @@ -1,10 +1,11 @@ package core import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) // TaskOverrides interface to expose any overrides that have been set for this task (like resource overrides etc) diff --git a/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go b/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go index 420fc7f60a..1237220374 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go @@ -6,15 +6,13 @@ import ( "reflect" "sync" - "sigs.k8s.io/controller-runtime/pkg/cache" - - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go b/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go index d2538f4032..ba6edc4f37 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "gotest.tools/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "gotest.tools/assert" ) func TestLoadPlugin(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go b/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go index bb24159681..9b5dec96de 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go @@ -1,8 +1,9 @@ package core import ( - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/apimachinery/pkg/types" + + "github.com/flyteorg/flyte/flytestdlib/promutils" ) // When a change is observed, the owning entity with id types.NamespacedName can be triggered for re-validation diff --git a/flyteplugins/go/tasks/pluginmachinery/core/template/template.go b/flyteplugins/go/tasks/pluginmachinery/core/template/template.go index 567c8ab68a..385abf09f4 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/template/template.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/template/template.go @@ -25,12 +25,13 @@ import ( "regexp" "strings" + "github.com/golang/protobuf/ptypes" + "github.com/pkg/errors" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/golang/protobuf/ptypes" - "github.com/pkg/errors" ) var alphaNumericOnly = regexp.MustCompile("[^a-zA-Z0-9_]+") diff --git a/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go b/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go index a7f6c97477..ba2f5f6ae9 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go @@ -7,13 +7,12 @@ import ( "testing" "time" - pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) type dummyInputReader struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go index a58fbfe55c..4c32d290f8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go @@ -8,12 +8,11 @@ package config import ( "time" - "k8s.io/apimachinery/pkg/api/resource" - - config2 "github.com/flyteorg/flyte/flytestdlib/config" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" + config2 "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate pflags K8sPluginConfig --default-var=defaultK8sConfig diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go index dbba1f3b68..b2ed99fbdb 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go @@ -3,17 +3,16 @@ package flytek8s import ( "context" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/rand" + "k8s.io/apimachinery/pkg/util/validation" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginscore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flytestdlib/logger" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/apimachinery/pkg/util/validation" ) const resourceGPU = "gpu" diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go index d4a04ec1c5..4515d6311c 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go @@ -4,19 +4,18 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/validation" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/util/validation" ) var zeroQuantity = resource.MustParse("0") diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go index bec39010be..ca6d3be42f 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go @@ -6,17 +6,17 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/proto" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go index f41262771f..09a9fbf52b 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go @@ -7,9 +7,6 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - config2 "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" @@ -17,9 +14,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + config2 "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var resourceRequirements = &v1.ResourceRequirements{ diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go index 645e9e2233..c2d868c039 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go @@ -5,14 +5,12 @@ import ( "os" "strconv" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/sets" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + "github.com/flyteorg/flyte/flytestdlib/contextutils" ) func GetContextEnvVars(ownerCtx context.Context) []v1.EnvVar { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go index db2cece649..5703b88d81 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go @@ -6,15 +6,14 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" v12 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + "github.com/flyteorg/flyte/flytestdlib/contextutils" ) func TestGetExecutionEnvVars(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go index 6c80fbd09d..8d33305806 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go @@ -7,21 +7,18 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/golang/protobuf/proto" + "github.com/imdario/mergo" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginserrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/golang/protobuf/proto" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/imdario/mergo" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const PodKind = "pod" diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go index 5c503239d0..0c3f8d90f2 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go @@ -9,24 +9,21 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - config1 "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dummyTaskExecutionMetadata(resources *v1.ResourceRequirements, extendedResources *core.ExtendedResources) pluginsCore.TaskExecutionMetadata { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go index 9c8c1d25af..64ac86129f 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go @@ -4,10 +4,10 @@ import ( "context" "sync" - "github.com/flyteorg/flyte/flytestdlib/logger" - v1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/cache" + + "github.com/flyteorg/flyte/flytestdlib/logger" ) var DefaultPodTemplateStore PodTemplateStore = NewPodTemplateStore() diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go index 1b1a163b24..d963c1817a 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go @@ -7,7 +7,6 @@ import ( "time" "github.com/stretchr/testify/assert" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/informers" diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go index d8a2a08664..fe626764a2 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go @@ -1,11 +1,12 @@ package flytek8s import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginmachinery_core "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginmachinery_core "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go index 661d24b14c..8c75f00a90 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go @@ -3,12 +3,12 @@ package flytek8s import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) func TestToK8sEnvVar(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go b/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go index 0a136edfef..7e530f42db 100644 --- a/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go +++ b/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go @@ -3,7 +3,6 @@ package google import ( "context" - pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/pkg/errors" "golang.org/x/oauth2" "google.golang.org/api/impersonate" @@ -11,6 +10,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + + pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go index d31f5a0955..a20ef4a1ab 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go @@ -6,11 +6,9 @@ import ( "k8s.io/utils/clock" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type tokenAllocator struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go index 18fe498e20..881e7a888d 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go @@ -5,23 +5,18 @@ import ( "testing" "time" + "github.com/go-test/deep" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + testing2 "k8s.io/utils/clock/testing" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks" - - "github.com/stretchr/testify/assert" - - testing2 "k8s.io/utils/clock/testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go index 128a812657..a305323dca 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go @@ -3,19 +3,15 @@ package webapi import ( "context" - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/client-go/util/workqueue" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flytestdlib/cache" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go index a341b9172f..53e80cd391 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go @@ -5,17 +5,16 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/internal/webapi/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/cache" cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestNewResourceCache(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go index 91a171bbec..d5e04f7347 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go @@ -8,15 +8,12 @@ import ( "k8s.io/utils/clock" - stdErrs "github.com/flyteorg/flyte/flytestdlib/errors" - - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/cache" + stdErrs "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go index d7db79495c..65d90a6c7e 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go @@ -5,10 +5,9 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/config" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go index 3ee99b2f4b..bf6ef791ac 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go @@ -4,11 +4,10 @@ import ( "context" "time" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/cache" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func launch(ctx context.Context, p webapi.AsyncPlugin, tCtx core.TaskExecutionContext, cache cache.AutoRefresh, diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go index 40f9999ff8..85ba42d0c6 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go @@ -5,12 +5,12 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/stretchr/testify/assert" ) func Test_launch(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go index b014f8df76..f2fa03104c 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go @@ -3,9 +3,10 @@ package webapi import ( "time" + "github.com/prometheus/client_golang/prometheus" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/prometheus/client_golang/prometheus" ) type Metrics struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go index 4876ec2724..c68634d0e0 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go @@ -4,10 +4,9 @@ import ( "context" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) func monitor(ctx context.Context, tCtx core.TaskExecutionContext, p Client, cache cache.AutoRefresh, state *State) ( diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go index bb6f0b089c..c47d77ae76 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go @@ -6,21 +6,17 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "k8s.io/apimachinery/pkg/util/rand" "k8s.io/client-go/util/workqueue" - core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/stretchr/testify/assert" - + core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" internalMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/internal/webapi/mocks" + "github.com/flyteorg/flyte/flytestdlib/cache" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func Test_monitor(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go index ae64646e8a..c46a75f05f 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go index bd0c7b2c24..a9001f20f8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go @@ -4,10 +4,9 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type InMemoryOutputReader struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go index e786365a3b..ad82fca8a3 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestInMemoryOutputReader(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go index eb7224800a..28bacceaed 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go index 1b768578d4..afd884ca02 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go @@ -4,8 +4,9 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestConstructCheckpointPath(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go index 1a4a818bda..896cd2d648 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go @@ -7,9 +7,8 @@ import ( "strconv" core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type precomputedRawOutputPaths struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go index c7bb704da8..6071c40d74 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestNewOutputSandbox(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go index 241f2e553d..5a6f4dd522 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go @@ -3,12 +3,10 @@ package ioutils import ( "context" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go index e20e0e18c0..70304597a2 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go @@ -3,8 +3,9 @@ package ioutils import ( "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestSimpleInputFilePath_GetInputPath(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go index 49b499e114..152644d828 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go @@ -7,9 +7,8 @@ import ( "github.com/pkg/errors" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type RemoteFileOutputReader struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go index 8865e75783..0e7ae179d9 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go @@ -4,13 +4,13 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) type MemoryMetadata struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go index 80cb54ce43..a1ed90934e 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go index 0d58a46cc2..1ca51eb1ad 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestRemoteFileOutputWriter(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go index a7eb38c8eb..9854a3156f 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go @@ -3,12 +3,12 @@ package ioutils import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/pkg/errors" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/atomic" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/pkg/errors" ) var ( diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go index 3e15231e00..175060f2ce 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go @@ -5,14 +5,15 @@ import ( "fmt" "testing" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" ) const dummyPath = storage.DataReference("test") diff --git a/flyteplugins/go/tasks/pluginmachinery/k8s/client.go b/flyteplugins/go/tasks/pluginmachinery/k8s/client.go index fa6ec67d21..97abfefd8a 100644 --- a/flyteplugins/go/tasks/pluginmachinery/k8s/client.go +++ b/flyteplugins/go/tasks/pluginmachinery/k8s/client.go @@ -5,14 +5,13 @@ package k8s import ( "context" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "k8s.io/apimachinery/pkg/api/meta" "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" + + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) type kubeClient struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go b/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go index 0bb3774dcd..8b56f7dd5e 100644 --- a/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go +++ b/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go @@ -5,11 +5,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/registry.go b/flyteplugins/go/tasks/pluginmachinery/registry.go index b792ce80ce..39a241a50e 100644 --- a/flyteplugins/go/tasks/pluginmachinery/registry.go +++ b/flyteplugins/go/tasks/pluginmachinery/registry.go @@ -4,13 +4,11 @@ import ( "context" "sync" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" internalRemote "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/internal/webapi" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) type taskPluginRegistry struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go b/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go index 50c9213afb..e3f03047aa 100644 --- a/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go @@ -3,12 +3,12 @@ package tasklog import ( "reflect" "regexp" - "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/go-test/deep" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestTemplateLog(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/utils/dns.go b/flyteplugins/go/tasks/pluginmachinery/utils/dns.go index 5f5a911ccf..e9a4317e17 100644 --- a/flyteplugins/go/tasks/pluginmachinery/utils/dns.go +++ b/flyteplugins/go/tasks/pluginmachinery/utils/dns.go @@ -4,8 +4,9 @@ import ( "regexp" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "k8s.io/apimachinery/pkg/util/validation" + + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" ) var dns1123InvalidRegex = regexp.MustCompile("[^-.a-z0-9]") diff --git a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go index 9b51db0b82..b6ea59020b 100644 --- a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go +++ b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go @@ -5,11 +5,10 @@ import ( "strconv" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - "github.com/golang/protobuf/proto" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go index c2a3f17e80..de5265fda6 100644 --- a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go @@ -4,9 +4,9 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestEncodeSecretGroup(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go b/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go index ffd462d76c..95b5c7881f 100644 --- a/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/stretchr/testify/assert" ) func TestGetConfig(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go b/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go index bcb34eace7..0ec6c2066e 100644 --- a/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go +++ b/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go @@ -5,13 +5,11 @@ import ( "time" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go b/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go index f6d9906594..37be2c1e40 100644 --- a/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go +++ b/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go @@ -10,12 +10,10 @@ package webapi import ( "context" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go index 09d75bc493..fce1acde89 100644 --- a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go +++ b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go @@ -5,18 +5,14 @@ import ( "fmt" "sync" - "github.com/flyteorg/flyte/flytestdlib/errors" - + lru "github.com/hashicorp/golang-lru" "github.com/prometheus/client_golang/prometheus" + "k8s.io/client-go/util/workqueue" "github.com/flyteorg/flyte/flytestdlib/contextutils" - + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - lru "github.com/hashicorp/golang-lru" - - "k8s.io/client-go/util/workqueue" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go index 76fd52f775..d2ded7d8e8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go @@ -7,13 +7,11 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/go-test/deep" - lru "github.com/hashicorp/golang-lru" "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/array/array_tests_base.go b/flyteplugins/go/tasks/plugins/array/array_tests_base.go index 6d6bd897d0..701b4780aa 100644 --- a/flyteplugins/go/tasks/plugins/array/array_tests_base.go +++ b/flyteplugins/go/tasks/plugins/array/array_tests_base.go @@ -1,22 +1,17 @@ package array import ( + "context" "testing" - "github.com/flyteorg/flyte/flyteplugins/tests" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "context" - - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteplugins/tests" + "github.com/flyteorg/flyte/flytestdlib/utils" ) type AdvanceIteration func(ctx context.Context, tCtx core.TaskExecutionContext) error diff --git a/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go b/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go index 6b17f2c81c..96aabcfcc6 100644 --- a/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go +++ b/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go @@ -7,11 +7,10 @@ package arraystatus import ( "testing" - types "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/stretchr/testify/assert" + types "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/bitarray" - - "github.com/stretchr/testify/assert" ) func TestArrayStatus_HashCode(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/client.go b/flyteplugins/go/tasks/plugins/array/awsbatch/client.go index 74ad8617c4..1ff3a44aff 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/client.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/client.go @@ -12,6 +12,7 @@ import ( a "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/batch" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" definition2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" "github.com/flyteorg/flyte/flytestdlib/logger" diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go index efef99643c..fe35f74e2a 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go @@ -6,20 +6,16 @@ package awsbatch import ( "context" + "testing" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/aws/aws-sdk-go/service/batch" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - - "testing" - - "github.com/aws/aws-sdk-go/service/batch" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func newClientWithMockBatch() *client { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go b/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go index 5187ed7086..99688fe36d 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go @@ -3,25 +3,18 @@ package awsbatch import ( "context" - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" batchConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go index 120fe40d2d..28d1eb8483 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go @@ -5,33 +5,25 @@ import ( "reflect" "testing" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/flyteorg/flyte/flytestdlib/storage" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" v1 "k8s.io/api/core/v1" - - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" queueMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" batchConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/flyteorg/flyte/flytestdlib/utils" ) diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go b/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go index 9629b3d771..1ca10cb39d 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go @@ -5,8 +5,9 @@ package awsbatch import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" v1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go index 22f39c200d..1ef9e4ec5b 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go @@ -6,14 +6,13 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" ) const defaultComputeEngine = "EC2" diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go index 6568fecee3..61f9b137e7 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go @@ -3,20 +3,18 @@ package awsbatch import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "golang.org/x/net/context" v1 "k8s.io/api/core/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" batchMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/utils" - "golang.org/x/net/context" - - "github.com/stretchr/testify/assert" ) func TestContainerImageRepository(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go index ad51d2e789..cd3bca93c4 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go @@ -10,20 +10,15 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/service/batch" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "k8s.io/client-go/util/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "k8s.io/apimachinery/pkg/types" - - "github.com/aws/aws-sdk-go/service/batch" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" "github.com/flyteorg/flyte/flytestdlib/cache" - + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go index cc3c258e38..8196925e15 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go @@ -11,20 +11,15 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" + "github.com/flyteorg/flyte/flytestdlib/cache" mocks3 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - config2 "github.com/flyteorg/flyte/flytestdlib/config" - - "github.com/flyteorg/flyte/flytestdlib/cache" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func createJobWithID(id JobID) *Job { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go index 10752d6f3c..609bab6cf7 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go @@ -5,15 +5,12 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/logger" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func LaunchSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, batchClient Client, pluginConfig *config.Config, diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go index 4b23c6dabb..449280bdcf 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go @@ -3,34 +3,25 @@ package awsbatch import ( "testing" - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/stretchr/testify/mock" - - "k8s.io/apimachinery/pkg/api/resource" - - core3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/go-test/deep" - - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "golang.org/x/net/context" v1 "k8s.io/api/core/v1" - - core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "k8s.io/apimachinery/pkg/api/resource" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/stretchr/testify/assert" - + core3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/utils" - "golang.org/x/net/context" ) func TestLaunchSubTasks(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go b/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go index cf60cbc491..592d602ff4 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go @@ -11,7 +11,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/batch" ) diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go index 967639e6ed..666b1e741a 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go @@ -4,23 +4,17 @@ import ( "context" core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" - - "github.com/flyteorg/flyte/flytestdlib/logger" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func createSubJobList(count int) []*Job { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go index 9188ce0237..d40edd41de 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go @@ -3,34 +3,27 @@ package awsbatch import ( "testing" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/batch" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" + "golang.org/x/net/context" + "k8s.io/apimachinery/pkg/types" flyteIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/batch" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" batchMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/stretchr/testify/assert" - "golang.org/x/net/context" - "k8s.io/apimachinery/pkg/types" - + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go b/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go index c3a05b0fcc..caf2e51a38 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go @@ -3,16 +3,14 @@ package awsbatch import ( "fmt" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "golang.org/x/net/context" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "golang.org/x/net/context" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go index 521189cb67..8c252a7c06 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go @@ -5,21 +5,20 @@ import ( "sort" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" - "github.com/aws/aws-sdk-go/service/batch" + "github.com/golang/protobuf/ptypes/duration" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" config2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "github.com/golang/protobuf/ptypes/duration" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go index 27beea588e..bbe8c88995 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go @@ -10,28 +10,22 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/service/batch" "github.com/golang/protobuf/ptypes/duration" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v12 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" flyteK8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/stretchr/testify/mock" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - - v12 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/aws/aws-sdk-go/service/batch" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/stretchr/testify/assert" ) func createSampleContainerTask() *core.Container { diff --git a/flyteplugins/go/tasks/plugins/array/catalog.go b/flyteplugins/go/tasks/plugins/array/catalog.go index 0efbdc4088..8544555609 100644 --- a/flyteplugins/go/tasks/plugins/array/catalog.go +++ b/flyteplugins/go/tasks/plugins/array/catalog.go @@ -8,18 +8,15 @@ import ( idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" idlPlugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const AwsBatchTaskType = "aws-batch" diff --git a/flyteplugins/go/tasks/plugins/array/catalog_test.go b/flyteplugins/go/tasks/plugins/array/catalog_test.go index fe52dc2ff6..15a36a4dcf 100644 --- a/flyteplugins/go/tasks/plugins/array/catalog_test.go +++ b/flyteplugins/go/tasks/plugins/array/catalog_test.go @@ -5,9 +5,13 @@ import ( "errors" "testing" + "github.com/go-test/deep" + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" catalogMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" @@ -17,18 +21,10 @@ import ( ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flytestdlib/bitarray" stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/go-test/deep" - - structpb "github.com/golang/protobuf/ptypes/struct" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) var ( diff --git a/flyteplugins/go/tasks/plugins/array/core/metadata.go b/flyteplugins/go/tasks/plugins/array/core/metadata.go index f7330d3b6f..4ac7c71b4c 100644 --- a/flyteplugins/go/tasks/plugins/array/core/metadata.go +++ b/flyteplugins/go/tasks/plugins/array/core/metadata.go @@ -4,7 +4,6 @@ import ( "context" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) diff --git a/flyteplugins/go/tasks/plugins/array/core/metadata_test.go b/flyteplugins/go/tasks/plugins/array/core/metadata_test.go index 90275fb844..262bd3b822 100644 --- a/flyteplugins/go/tasks/plugins/array/core/metadata_test.go +++ b/flyteplugins/go/tasks/plugins/array/core/metadata_test.go @@ -4,14 +4,12 @@ import ( "context" "testing" - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flytestdlib/bitarray" - - "github.com/stretchr/testify/assert" ) func TestInitializeExternalResources(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/core/state.go b/flyteplugins/go/tasks/plugins/array/core/state.go index 80cfb1f742..665eec309f 100644 --- a/flyteplugins/go/tasks/plugins/array/core/state.go +++ b/flyteplugins/go/tasks/plugins/array/core/state.go @@ -5,17 +5,16 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flytestdlib/errors" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - "github.com/flyteorg/flyte/flytestdlib/bitarray" + structpb "github.com/golang/protobuf/ptypes/struct" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" idlPlugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - structpb "github.com/golang/protobuf/ptypes/struct" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/plugins/array/core/state_test.go b/flyteplugins/go/tasks/plugins/array/core/state_test.go index 51fe731de0..26a80531b5 100644 --- a/flyteplugins/go/tasks/plugins/array/core/state_test.go +++ b/flyteplugins/go/tasks/plugins/array/core/state_test.go @@ -4,14 +4,13 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytestdlib/bitarray" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/bitarray" ) func TestInvertBitSet(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/inputs_test.go b/flyteplugins/go/tasks/plugins/array/inputs_test.go index 1424731848..8f9c670c57 100644 --- a/flyteplugins/go/tasks/plugins/array/inputs_test.go +++ b/flyteplugins/go/tasks/plugins/array/inputs_test.go @@ -3,12 +3,12 @@ package array import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/plugins/array/k8s/config.go b/flyteplugins/go/tasks/plugins/array/k8s/config.go index c19cbb72a8..d92eeb8c62 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/config.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/config.go @@ -8,14 +8,13 @@ import ( "fmt" "io/ioutil" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - "github.com/pkg/errors" v1 "k8s.io/api/core/v1" restclient "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" ) diff --git a/flyteplugins/go/tasks/plugins/array/k8s/executor.go b/flyteplugins/go/tasks/plugins/array/k8s/executor.go index 172d0b65fd..3e324391b8 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/executor.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/executor.go @@ -3,17 +3,16 @@ package k8s import ( "context" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" ) const executorName = "k8s-array" diff --git a/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go b/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go index 1b8a8224a2..04623c2b47 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go @@ -5,25 +5,21 @@ import ( "strconv" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/stretchr/testify/assert" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" - "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" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "sigs.k8s.io/controller-runtime/pkg/client" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/array/k8s/management.go b/flyteplugins/go/tasks/plugins/array/k8s/management.go index 89996226e6..fdf9d4a182 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/management.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/management.go @@ -6,7 +6,6 @@ import ( "time" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -16,7 +15,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" diff --git a/flyteplugins/go/tasks/plugins/array/k8s/management_test.go b/flyteplugins/go/tasks/plugins/array/k8s/management_test.go index 5e1d37e066..5bead4954d 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/management_test.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/management_test.go @@ -4,8 +4,15 @@ import ( "fmt" "testing" - core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "golang.org/x/net/context" + structpb "google.golang.org/protobuf/types/known/structpb" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" @@ -14,21 +21,9 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/storage" stdmocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "golang.org/x/net/context" - - structpb "google.golang.org/protobuf/types/known/structpb" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type metadata struct { diff --git a/flyteplugins/go/tasks/plugins/array/k8s/subtask.go b/flyteplugins/go/tasks/plugins/array/k8s/subtask.go index a62c275f0c..cb1a2c0b5f 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/subtask.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/subtask.go @@ -8,6 +8,12 @@ import ( "strings" "time" + v1 "k8s.io/api/core/v1" + k8serrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8stypes "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" @@ -16,16 +22,8 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" podPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/pod" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - - v1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8stypes "k8s.io/apimachinery/pkg/types" - - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go index beeb1a7787..8ac4d6edc0 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go @@ -7,7 +7,6 @@ import ( "strconv" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" @@ -16,7 +15,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" podPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/pod" - "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go index ea0078db20..c3e213e403 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go @@ -5,12 +5,11 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" podPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/pod" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) func TestSubTaskExecutionContext(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/outputs.go b/flyteplugins/go/tasks/plugins/array/outputs.go index 1f59f2a7e3..d31988425f 100644 --- a/flyteplugins/go/tasks/plugins/array/outputs.go +++ b/flyteplugins/go/tasks/plugins/array/outputs.go @@ -4,22 +4,17 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/logger" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) var ( diff --git a/flyteplugins/go/tasks/plugins/array/outputs_test.go b/flyteplugins/go/tasks/plugins/array/outputs_test.go index 7ddf06a1dc..f218e9540f 100644 --- a/flyteplugins/go/tasks/plugins/array/outputs_test.go +++ b/flyteplugins/go/tasks/plugins/array/outputs_test.go @@ -7,33 +7,24 @@ import ( "testing" "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestOutputAssembler_Queue(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go b/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go index e5d4664cfe..9d4ad8b822 100644 --- a/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go +++ b/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go @@ -12,11 +12,9 @@ import ( "strconv" "time" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" errors2 "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" ) const ( diff --git a/flyteplugins/go/tasks/plugins/hive/config/config.go b/flyteplugins/go/tasks/plugins/hive/config/config.go index d098b627b1..027e5df801 100644 --- a/flyteplugins/go/tasks/plugins/hive/config/config.go +++ b/flyteplugins/go/tasks/plugins/hive/config/config.go @@ -6,10 +6,9 @@ import ( "context" "net/url" + pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" ) const quboleConfigSectionKey = "qubole" diff --git a/flyteplugins/go/tasks/plugins/hive/execution_state.go b/flyteplugins/go/tasks/plugins/hive/execution_state.go index f245279df4..16ac3835bd 100644 --- a/flyteplugins/go/tasks/plugins/hive/execution_state.go +++ b/flyteplugins/go/tasks/plugins/hive/execution_state.go @@ -6,22 +6,17 @@ import ( "strconv" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" + "github.com/flyteorg/flyte/flytestdlib/cache" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flyteplugins/go/tasks/plugins/hive/execution_state_test.go b/flyteplugins/go/tasks/plugins/hive/execution_state_test.go index b265c31bfb..4e34a04593 100644 --- a/flyteplugins/go/tasks/plugins/hive/execution_state_test.go +++ b/flyteplugins/go/tasks/plugins/hive/execution_state_test.go @@ -7,28 +7,23 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" quboleMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" + mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/hive/executions_cache.go b/flyteplugins/go/tasks/plugins/hive/executions_cache.go index b077da986a..40885ab093 100644 --- a/flyteplugins/go/tasks/plugins/hive/executions_cache.go +++ b/flyteplugins/go/tasks/plugins/hive/executions_cache.go @@ -6,15 +6,12 @@ import ( "k8s.io/client-go/util/workqueue" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go b/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go index 3dfcf62385..82ef507cef 100644 --- a/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go +++ b/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go @@ -4,17 +4,16 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/cache" - cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" quboleMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func TestQuboleHiveExecutionsCache_SyncQuboleQuery(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/hive/executor.go b/flyteplugins/go/tasks/plugins/hive/executor.go index 7be422281f..5e64c6ef93 100644 --- a/flyteplugins/go/tasks/plugins/hive/executor.go +++ b/flyteplugins/go/tasks/plugins/hive/executor.go @@ -3,13 +3,12 @@ package hive import ( "context" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" + "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/hive/executor_metrics.go b/flyteplugins/go/tasks/plugins/hive/executor_metrics.go index 7a0dbe9ed9..815e51135a 100644 --- a/flyteplugins/go/tasks/plugins/hive/executor_metrics.go +++ b/flyteplugins/go/tasks/plugins/hive/executor_metrics.go @@ -1,9 +1,10 @@ package hive import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/prometheus/client_golang/prometheus" ) type QuboleHiveExecutorMetrics struct { diff --git a/flyteplugins/go/tasks/plugins/hive/test_helpers.go b/flyteplugins/go/tasks/plugins/hive/test_helpers.go index 9635526aaf..f8fe8d4148 100644 --- a/flyteplugins/go/tasks/plugins/hive/test_helpers.go +++ b/flyteplugins/go/tasks/plugins/hive/test_helpers.go @@ -1,6 +1,13 @@ package hive import ( + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -8,12 +15,6 @@ import ( ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytestdlib/storage" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) func GetSingleHiveQueryTaskTemplate() idlCore.TaskTemplate { diff --git a/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go b/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go index cfec0d3af4..576740af93 100644 --- a/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go @@ -6,24 +6,24 @@ import ( "time" daskAPI "github.com/dask/dask-kubernetes/v2023/dask_kubernetes/operator/go_client/pkg/apis/kubernetes.dask.org/v1" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/golang/protobuf/jsonpb" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/types/known/structpb" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/golang/protobuf/jsonpb" - "google.golang.org/protobuf/types/known/structpb" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go index f6a9787dbb..e0903d02a3 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go @@ -5,18 +5,18 @@ import ( "sort" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + v1 "k8s.io/api/core/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - v1 "k8s.io/api/core/v1" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go index 6c083b6898..ae77d8c94d 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go @@ -5,17 +5,17 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" commonOp "github.com/kubeflow/common/pkg/apis/common/v1" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) func TestExtractCurrentCondition(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go index 25e45ad727..1358422ec7 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go @@ -6,9 +6,15 @@ import ( "strings" "time" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -17,12 +23,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/controller-runtime/pkg/client" ) const workerSpecCommandKey = "worker_spec_command" diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go index bda0faff75..7b6e1f5611 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go @@ -6,10 +6,19 @@ import ( "testing" "time" + "github.com/golang/protobuf/jsonpb" + structpb "github.com/golang/protobuf/ptypes/struct" + mpiOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" @@ -19,19 +28,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - mpiOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go index 2461c7bc18..e844c05d0f 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go @@ -5,9 +5,15 @@ import ( "fmt" "time" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -16,15 +22,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - - "sigs.k8s.io/controller-runtime/pkg/client" ) type pytorchOperatorResourceHandler struct { diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go index f980c89741..9d95ecc61b 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go @@ -6,34 +6,28 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/golang/protobuf/jsonpb" + structpb "github.com/golang/protobuf/ptypes/struct" commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - - "github.com/stretchr/testify/mock" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - - pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/assert" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go index 1c4c965819..8db340d37e 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go @@ -5,9 +5,15 @@ import ( "fmt" "time" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -16,15 +22,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - - "sigs.k8s.io/controller-runtime/pkg/client" ) type tensorflowOperatorResourceHandler struct { diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go index ee5e97db16..bcabdaa87f 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go @@ -6,33 +6,28 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/golang/protobuf/jsonpb" + structpb "github.com/golang/protobuf/ptypes/struct" commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - - "github.com/stretchr/testify/mock" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - - pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "github.com/stretchr/testify/assert" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go b/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go index 286c2673d7..19000e0c72 100644 --- a/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go @@ -5,23 +5,20 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/api/core/v1" - - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) var containerResourceRequirements = &v1.ResourceRequirements{ diff --git a/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go b/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go index aacfea7425..d21eefb8b9 100644 --- a/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go +++ b/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go @@ -3,6 +3,10 @@ package pod import ( "context" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + pluginserrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" @@ -11,13 +15,7 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go b/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go index bbc797065c..48a000de17 100644 --- a/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go @@ -9,27 +9,23 @@ import ( "path" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) const ResourceNvidiaGPU = "nvidia.com/gpu" diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go index 18499069dd..08c44ce9e1 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go @@ -3,8 +3,9 @@ package ray import ( "testing" - pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "gotest.tools/assert" + + pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) func TestLoadConfig(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go index 9b205beee6..fc39a04bf3 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go @@ -6,24 +6,22 @@ import ( "strconv" "strings" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" + rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - - v1 "k8s.io/api/core/v1" - - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go index 40513e0ffa..9d7abe45a7 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go @@ -5,30 +5,27 @@ import ( "testing" "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s/mocks" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/golang/protobuf/jsonpb" structpb "github.com/golang/protobuf/ptypes/struct" + rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go index 326eadfb8c..4b6bcc2360 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go @@ -5,31 +5,22 @@ import ( "strings" "time" - "sigs.k8s.io/controller-runtime/pkg/client" - + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - - awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/aws/aws-sdk-go/service/sagemaker" + "sigs.k8s.io/controller-runtime/pkg/client" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/aws/aws-sdk-go/service/sagemaker" - - taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - + awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ReconcilingTrainingJobStatus = "ReconcilingTrainingJob" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go index 26b0efddad..cf412edd0c 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go @@ -5,24 +5,20 @@ import ( "fmt" "testing" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/go-test/deep" + "github.com/stretchr/testify/assert" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" - - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - "github.com/aws/aws-sdk-go/service/sagemaker" - sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/stretchr/testify/assert" ) func Test_awsSagemakerPlugin_BuildResourceForTrainingJob(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go index a7364c96ca..fa80bbadf5 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go @@ -7,25 +7,21 @@ import ( "strings" "time" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/service/sagemaker" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func (m awsSagemakerPlugin) buildResourceForCustomTrainingJob( diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go index eac4d696ec..094a9e5b01 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go @@ -6,20 +6,17 @@ import ( "strconv" "testing" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/go-test/deep" + "github.com/stretchr/testify/assert" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/stretchr/testify/assert" - - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - "github.com/aws/aws-sdk-go/service/sagemaker" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" ) diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go index c4fb453acb..b233af182c 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go @@ -5,30 +5,22 @@ import ( "strings" "time" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "sigs.k8s.io/controller-runtime/pkg/client" - awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" - "github.com/aws/aws-sdk-go/service/sagemaker" - - taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - + awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ReconcilingTuningJobStatus = "ReconcilingTuningJob" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go index 4f3caef8d7..ee3452f6b6 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go @@ -5,18 +5,16 @@ import ( "fmt" "testing" + hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" "github.com/go-test/deep" + "github.com/stretchr/testify/assert" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/config/viper" - + sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" - sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/stretchr/testify/assert" + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" ) func Test_awsSagemakerPlugin_BuildResourceForHyperparameterTuningJob(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go index 062fbda449..b26255d78d 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go @@ -4,15 +4,14 @@ import ( "context" "fmt" - "sigs.k8s.io/controller-runtime/pkg/client" - - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func createOutputLiteralMap(tk *core.TaskTemplate, outputPath string) *core.LiteralMap { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go index 6e99ca0ae4..665a31caac 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go @@ -3,10 +3,9 @@ package sagemaker import ( "testing" - "sigs.k8s.io/controller-runtime/pkg/client" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_createModelOutputPath(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go index 623d55f674..328efc2e5c 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go @@ -3,17 +3,14 @@ package sagemaker import ( "context" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - "k8s.io/client-go/kubernetes/scheme" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go index 44150e547f..38cc76bbab 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go @@ -5,16 +5,15 @@ import ( "reflect" "testing" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/stretchr/testify/assert" + "sigs.k8s.io/controller-runtime/pkg/client" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func Test_awsSagemakerPlugin_BuildIdentityResource(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go index 437945fe1e..3733f74725 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go @@ -1,12 +1,16 @@ package sagemaker import ( - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/pkg/errors" - + "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/pkg/errors" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -14,13 +18,8 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go index 95616c249b..047d2ae23c 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go @@ -6,24 +6,21 @@ import ( "sort" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/Masterminds/semver" commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" awsSdk "github.com/aws/aws-sdk-go-v2/aws" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteSagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go index e4266e1fd0..8c5093ddac 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go @@ -7,21 +7,18 @@ import ( "strconv" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - structpb "github.com/golang/protobuf/ptypes/struct" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - sagemakerSpec "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/flyteorg/flyte/flytestdlib/config/viper" + structpb "github.com/golang/protobuf/ptypes/struct" "github.com/stretchr/testify/assert" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteSagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + sagemakerSpec "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" sagemakerConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" ) func makeGenericLiteral(st *structpb.Struct) *core.Literal { diff --git a/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go b/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go index 695b780b06..e23a6ae912 100644 --- a/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go +++ b/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go @@ -4,7 +4,6 @@ import ( "context" "net/http" "net/url" - "time" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" diff --git a/flyteplugins/go/tasks/plugins/presto/config/config.go b/flyteplugins/go/tasks/plugins/presto/config/config.go index 6f8de3c5ff..559d6a1af3 100644 --- a/flyteplugins/go/tasks/plugins/presto/config/config.go +++ b/flyteplugins/go/tasks/plugins/presto/config/config.go @@ -7,10 +7,9 @@ import ( "net/url" "time" + pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" ) const prestoConfigSectionKey = "presto" diff --git a/flyteplugins/go/tasks/plugins/presto/execution_state.go b/flyteplugins/go/tasks/plugins/presto/execution_state.go index 6b8b735548..3399c013ae 100644 --- a/flyteplugins/go/tasks/plugins/presto/execution_state.go +++ b/flyteplugins/go/tasks/plugins/presto/execution_state.go @@ -2,32 +2,23 @@ package presto import ( "context" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "k8s.io/apimachinery/pkg/util/rand" - "fmt" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" - "time" - "github.com/flyteorg/flyte/flytestdlib/cache" + "k8s.io/apimachinery/pkg/util/rand" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" + "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" - - pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type ExecutionPhase int diff --git a/flyteplugins/go/tasks/plugins/presto/execution_state_test.go b/flyteplugins/go/tasks/plugins/presto/execution_state_test.go index ae0741a914..4d20d64ee6 100644 --- a/flyteplugins/go/tasks/plugins/presto/execution_state_test.go +++ b/flyteplugins/go/tasks/plugins/presto/execution_state_test.go @@ -6,7 +6,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" prestoMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" @@ -15,13 +20,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/presto/executions_cache.go b/flyteplugins/go/tasks/plugins/presto/executions_cache.go index 40b81eb705..cc5248c0f2 100644 --- a/flyteplugins/go/tasks/plugins/presto/executions_cache.go +++ b/flyteplugins/go/tasks/plugins/presto/executions_cache.go @@ -5,14 +5,11 @@ import ( "k8s.io/client-go/util/workqueue" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go b/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go index e014d64b66..111f0ad80b 100644 --- a/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go +++ b/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go @@ -4,18 +4,16 @@ import ( "context" "testing" - prestoMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client/mocks" - - "github.com/flyteorg/flyte/flytestdlib/cache" - cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" + prestoMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func TestPrestoExecutionsCache_SyncQuboleQuery(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/presto/executor.go b/flyteplugins/go/tasks/plugins/presto/executor.go index 7b452b0c68..306dfda4c7 100644 --- a/flyteplugins/go/tasks/plugins/presto/executor.go +++ b/flyteplugins/go/tasks/plugins/presto/executor.go @@ -3,14 +3,12 @@ package presto import ( "context" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" - - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" + "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/presto/helpers_test.go b/flyteplugins/go/tasks/plugins/presto/helpers_test.go index 69cc3d4d38..60fc1cc050 100644 --- a/flyteplugins/go/tasks/plugins/presto/helpers_test.go +++ b/flyteplugins/go/tasks/plugins/presto/helpers_test.go @@ -1,6 +1,13 @@ package presto import ( + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -8,12 +15,6 @@ import ( ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytestdlib/storage" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) func GetPrestoQueryTaskTemplate() idlCore.TaskTemplate { diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go index b110897a47..a3e6d69d66 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/config" ) func TestGetAndSetConfig(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go index 1cd92caf9d..0aecffdfc7 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go @@ -8,17 +8,22 @@ import ( "testing" "time" - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/grpc" + "k8s.io/apimachinery/pkg/util/rand" + "k8s.io/utils/strings/slices" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flyteplugins/tests" "github.com/flyteorg/flyte/flytestdlib/contextutils" @@ -26,11 +31,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "google.golang.org/grpc" - "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/utils/strings/slices" ) type MockPlugin struct { diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go index c50d361726..d115bad896 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go @@ -7,13 +7,12 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/config" + "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/grpclog" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" flyteIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" @@ -23,9 +22,9 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "google.golang.org/grpc" ) type GetClientFunc func(ctx context.Context, agent *Agent, connectionCache map[*Agent]*grpc.ClientConn) (service.AsyncAgentServiceClient, error) diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go index 3a8e759908..ee3b699e9d 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go @@ -5,16 +5,15 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/config" - + "github.com/stretchr/testify/assert" "google.golang.org/grpc" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" webapiPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) func TestPlugin(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go b/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go index ec1c641c0e..a1f16163fe 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go @@ -5,23 +5,19 @@ import ( "fmt" "time" - errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - awsSdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/athena" athenaTypes "github.com/aws/aws-sdk-go-v2/service/athena/types" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" + errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go index 0ef2ddf3c7..6e3238d813 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go @@ -4,8 +4,9 @@ import ( "testing" awsSdk "github.com/aws/aws-sdk-go-v2/aws" - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestCreateTaskInfo(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/utils.go b/flyteplugins/go/tasks/plugins/webapi/athena/utils.go index bdee75c282..761e81842a 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/utils.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/utils.go @@ -3,17 +3,14 @@ package athena import ( "context" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - pluginsIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flytestdlib/utils" - pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginsIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func writeOutput(ctx context.Context, tCtx webapi.StatusContext, externalLocation string) error { diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go b/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go index 40106c6b93..da490838fe 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go @@ -6,21 +6,17 @@ import ( "testing" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flytestdlib/storage" - - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - - "github.com/stretchr/testify/assert" - + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func Test_writeOutput(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go index c8c8ff1614..eb118e3211 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go @@ -4,10 +4,9 @@ package bigquery import ( "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" - pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/config" ) diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go index 8db32ad6fa..5509c216f7 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go @@ -9,8 +9,11 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/api/bigquery/v2" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -20,9 +23,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "google.golang.org/api/bigquery/v2" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go index 698eeeb5dc..f08d1d15ea 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go @@ -7,29 +7,23 @@ import ( "net/http" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "golang.org/x/oauth2" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" structpb "github.com/golang/protobuf/ptypes/struct" + "golang.org/x/oauth2" "google.golang.org/api/bigquery/v2" "google.golang.org/api/googleapi" + "google.golang.org/api/option" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "google.golang.org/api/option" - - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go index 499e6c5792..939fe0577a 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go @@ -5,6 +5,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/api/bigquery/v2" + "google.golang.org/api/googleapi" + "k8s.io/apimachinery/pkg/util/rand" + + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" coreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" @@ -13,15 +22,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/mock" - "k8s.io/apimachinery/pkg/util/rand" - - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/stretchr/testify/assert" - "google.golang.org/api/bigquery/v2" - "google.golang.org/api/googleapi" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go index 8a9190d8e5..7ce788e0fe 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go @@ -3,13 +3,13 @@ package bigquery import ( "strconv" + structpb "github.com/golang/protobuf/ptypes/struct" "github.com/pkg/errors" + "google.golang.org/api/bigquery/v2" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - structpb "github.com/golang/protobuf/ptypes/struct" - "google.golang.org/api/bigquery/v2" ) type QueryJobConfig struct { diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go index 665808830d..f39ba4e5e4 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go @@ -3,10 +3,10 @@ package bigquery import ( "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/stretchr/testify/assert" "google.golang.org/api/bigquery/v2" + + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" ) func TestGetQueryParameter(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go index 7fba0f9828..6a933c6e4f 100644 --- a/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go @@ -8,12 +8,13 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flytestdlib/utils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" @@ -21,8 +22,7 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func TestEndToEnd(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go index 238932d638..a0e5aa722e 100644 --- a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go @@ -10,22 +10,19 @@ import ( "net/http" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go index a6976abe88..1bafbba223 100644 --- a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go @@ -9,10 +9,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) type MockClient struct { diff --git a/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go index 92053099e7..97f53ee322 100644 --- a/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go @@ -8,6 +8,9 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" @@ -18,8 +21,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func TestEndToEnd(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go index 037b70d390..33334b4003 100644 --- a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go @@ -13,16 +13,14 @@ import ( flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go index a7d79781e6..7657a9e315 100644 --- a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go @@ -9,10 +9,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) type MockClient struct { diff --git a/flyteplugins/tests/end_to_end.go b/flyteplugins/tests/end_to_end.go index 77522ab1d1..8fad552b57 100644 --- a/flyteplugins/tests/end_to_end.go +++ b/flyteplugins/tests/end_to_end.go @@ -8,37 +8,27 @@ import ( "testing" "time" - "k8s.io/apimachinery/pkg/util/rand" - "github.com/go-test/deep" - - v12 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "k8s.io/apimachinery/pkg/types" - - "k8s.io/apimachinery/pkg/api/resource" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + v12 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/rand" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" catalogMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" - - v1 "k8s.io/api/core/v1" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/stretchr/testify/mock" - + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" coreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func createSampleContainerTask() *idlCore.Container { From de4e72253f5a4fd4018e7641427d5c3bea983d24 Mon Sep 17 00:00:00 2001 From: Andrew Dye Date: Mon, 16 Oct 2023 10:16:54 -0700 Subject: [PATCH 06/15] Format go imports (flytepropeller) (#4225) Signed-off-by: Andrew Dye Signed-off-by: squiishyy --- flytepropeller/.golangci.yml | 10 +++++ .../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 +++++ .../cmd/controller/cmd/init_certs.go | 8 ++-- flytepropeller/cmd/controller/cmd/root.go | 27 +++++------- flytepropeller/cmd/controller/cmd/webhook.go | 18 +++----- flytepropeller/cmd/controller/main.go | 3 +- .../cmd/kubectl-flyte/cmd/compile.go | 5 ++- .../cmd/kubectl-flyte/cmd/create.go | 8 ++-- .../cmd/kubectl-flyte/cmd/create_test.go | 6 +-- .../cmd/kubectl-flyte/cmd/delete.go | 3 +- flytepropeller/cmd/kubectl-flyte/cmd/get.go | 2 +- .../cmd/kubectl-flyte/cmd/printers/node.go | 2 +- flytepropeller/cmd/kubectl-flyte/cmd/root.go | 8 ++-- .../cmd/kubectl-flyte/cmd/visualize.go | 3 +- flytepropeller/cmd/kubectl-flyte/main.go | 3 +- flytepropeller/cmd/manager/cmd/root.go | 22 +++++----- flytepropeller/events/admin_eventsink.go | 6 +-- .../admin_eventsink_integration_test.go | 2 +- flytepropeller/events/admin_eventsink_test.go | 13 +++--- flytepropeller/events/errors/errors.go | 5 ++- flytepropeller/events/errors/errors_test.go | 3 +- flytepropeller/events/event_recorder.go | 3 +- flytepropeller/events/event_recorder_test.go | 4 +- flytepropeller/events/eventsink_test.go | 5 ++- flytepropeller/events/local_eventsink.go | 3 +- flytepropeller/events/node_event_recorder.go | 8 ++-- .../events/node_event_recorder_test.go | 11 ++--- flytepropeller/events/task_event_recorder.go | 8 ++-- .../events/task_event_recorder_test.go | 11 ++--- .../events/workflow_event_recorder.go | 8 ++-- .../events/workflow_event_recorder_test.go | 11 ++--- flytepropeller/manager/manager.go | 23 ++++------ flytepropeller/manager/manager_test.go | 10 ++--- .../manager/shardstrategy/environment.go | 4 +- flytepropeller/manager/shardstrategy/hash.go | 4 +- .../manager/shardstrategy/shard_strategy.go | 4 +- .../shardstrategy/shard_strategy_test.go | 1 - flytepropeller/pkg/apis/flyteworkflow/crd.go | 1 - .../pkg/apis/flyteworkflow/v1alpha1/branch.go | 3 +- .../flyteworkflow/v1alpha1/branch_test.go | 3 +- .../pkg/apis/flyteworkflow/v1alpha1/error.go | 3 +- .../v1alpha1/execution_config.go | 3 +- .../v1alpha1/execution_config_test.go | 5 ++- .../pkg/apis/flyteworkflow/v1alpha1/gate.go | 3 +- .../apis/flyteworkflow/v1alpha1/identifier.go | 3 +- .../pkg/apis/flyteworkflow/v1alpha1/iface.go | 1 - .../flyteworkflow/v1alpha1/node_status.go | 4 +- .../v1alpha1/node_status_test.go | 5 +-- .../pkg/apis/flyteworkflow/v1alpha1/nodes.go | 3 +- .../apis/flyteworkflow/v1alpha1/register.go | 3 +- .../pkg/apis/flyteworkflow/v1alpha1/tasks.go | 3 +- .../apis/flyteworkflow/v1alpha1/tasks_test.go | 3 +- .../apis/flyteworkflow/v1alpha1/workflow.go | 9 ++-- .../flyteworkflow/v1alpha1/workflow_status.go | 4 +- .../flyteworkflow/v1alpha1/workflow_test.go | 3 +- flytepropeller/pkg/compiler/admin_test.go | 3 +- flytepropeller/pkg/compiler/common/index.go | 3 +- .../pkg/compiler/requirements_test.go | 3 +- flytepropeller/pkg/compiler/task_compiler.go | 4 +- .../pkg/compiler/task_compiler_test.go | 7 ++- .../pkg/compiler/test/compiler_test.go | 18 +++----- .../pkg/compiler/transformers/k8s/inputs.go | 3 +- .../pkg/compiler/transformers/k8s/node.go | 5 ++- .../compiler/transformers/k8s/node_test.go | 11 ++--- .../pkg/compiler/transformers/k8s/utils.go | 2 +- .../compiler/transformers/k8s/utils_test.go | 2 +- .../pkg/compiler/transformers/k8s/workflow.go | 3 +- .../transformers/k8s/workflow_test.go | 7 +-- flytepropeller/pkg/compiler/utils.go | 3 +- .../pkg/compiler/validators/bindings.go | 4 +- .../pkg/compiler/validators/bindings_test.go | 7 ++- .../pkg/compiler/validators/branch.go | 3 +- .../pkg/compiler/validators/branch_test.go | 2 +- .../pkg/compiler/validators/interface_test.go | 10 ++--- .../pkg/compiler/validators/node_test.go | 5 +-- .../pkg/compiler/validators/typing.go | 3 +- .../pkg/compiler/validators/typing_test.go | 3 +- .../pkg/compiler/validators/utils.go | 6 +-- .../pkg/compiler/validators/utils_test.go | 3 +- .../pkg/compiler/workflow_compiler.go | 8 ++-- .../pkg/compiler/workflow_compiler_test.go | 6 +-- .../pkg/controller/completed_workflows.go | 3 +- .../controller/completed_workflows_test.go | 3 +- .../pkg/controller/composite_workqueue.go | 8 ++-- .../controller/composite_workqueue_test.go | 4 +- .../pkg/controller/config/config.go | 3 +- flytepropeller/pkg/controller/controller.go | 44 +++++++------------ .../pkg/controller/controller_test.go | 11 +++-- .../pkg/controller/executors/kube.go | 7 ++- .../pkg/controller/executors/kube_test.go | 7 +-- .../pkg/controller/garbage_collector.go | 11 +++-- .../pkg/controller/garbage_collector_test.go | 10 ++--- flytepropeller/pkg/controller/handler.go | 6 +-- flytepropeller/pkg/controller/handler_test.go | 13 +++--- .../controller/nodes/array/event_recorder.go | 3 +- .../pkg/controller/nodes/array/handler.go | 3 -- .../controller/nodes/array/handler_test.go | 13 +++--- .../array/node_execution_context_builder.go | 1 - .../pkg/controller/nodes/array/utils_test.go | 4 +- .../nodes/branch/comparator_test.go | 3 +- .../pkg/controller/nodes/branch/evaluator.go | 6 +-- .../controller/nodes/branch/evaluator_test.go | 9 ++-- .../pkg/controller/nodes/branch/handler.go | 2 - .../controller/nodes/branch/handler_test.go | 18 ++++---- flytepropeller/pkg/controller/nodes/cache.go | 12 ++--- .../pkg/controller/nodes/cache_test.go | 23 ++++------ .../pkg/controller/nodes/catalog/config.go | 4 +- .../nodes/catalog/datacatalog/datacatalog.go | 16 +++---- .../catalog/datacatalog/datacatalog_test.go | 20 ++++----- .../catalog/datacatalog/transformer_test.go | 3 +- .../pkg/controller/nodes/common/utils.go | 1 - .../pkg/controller/nodes/common/utils_test.go | 3 +- .../nodes/dynamic/dynamic_workflow.go | 4 +- .../nodes/dynamic/dynamic_workflow_test.go | 15 +++---- .../pkg/controller/nodes/dynamic/handler.go | 3 -- .../controller/nodes/dynamic/handler_test.go | 20 ++++----- .../pkg/controller/nodes/dynamic/utils.go | 1 - .../controller/nodes/dynamic/utils_test.go | 8 ++-- .../pkg/controller/nodes/end/handler.go | 5 +-- .../pkg/controller/nodes/end/handler_test.go | 14 +++--- .../pkg/controller/nodes/executor.go | 19 +++----- .../pkg/controller/nodes/executor_test.go | 18 +++----- .../nodes/factory/handler_factory.go | 6 +-- .../pkg/controller/nodes/gate/handler.go | 2 - .../pkg/controller/nodes/gate/handler_test.go | 15 +++---- .../pkg/controller/nodes/handler/state.go | 3 -- .../controller/nodes/handler/state_test.go | 4 +- .../nodes/handler/transition_info_test.go | 7 ++- .../nodes/handler/transition_test.go | 5 +-- .../pkg/controller/nodes/interfaces/node.go | 1 - .../nodes/interfaces/node_exec_context.go | 9 ++-- .../pkg/controller/nodes/node_exec_context.go | 10 ++--- .../nodes/node_exec_context_test.go | 9 ++-- .../controller/nodes/node_state_manager.go | 1 - .../pkg/controller/nodes/output_resolver.go | 11 ++--- .../controller/nodes/output_resolver_test.go | 3 +- .../pkg/controller/nodes/predicate.go | 2 +- .../pkg/controller/nodes/predicate_test.go | 3 +- .../pkg/controller/nodes/resolve_test.go | 12 +++-- .../pkg/controller/nodes/setup_context.go | 3 +- .../controller/nodes/start/handler_test.go | 5 +-- .../controller/nodes/subworkflow/handler.go | 14 +++--- .../nodes/subworkflow/handler_test.go | 20 ++++----- .../nodes/subworkflow/launchplan.go | 8 ++-- .../nodes/subworkflow/launchplan/admin.go | 19 +++----- .../subworkflow/launchplan/admin_test.go | 16 +++---- .../subworkflow/launchplan/errors_test.go | 4 +- .../nodes/subworkflow/launchplan/noop.go | 3 +- .../nodes/subworkflow/launchplan/noop_test.go | 3 +- .../nodes/subworkflow/launchplan_test.go | 16 +++---- .../nodes/subworkflow/subworkflow.go | 2 - .../nodes/subworkflow/subworkflow_test.go | 5 +-- .../pkg/controller/nodes/subworkflow/util.go | 1 - .../controller/nodes/subworkflow/util_test.go | 3 +- .../nodes/task/backoff/controller.go | 4 +- .../controller/nodes/task/backoff/handler.go | 7 +-- .../nodes/task/backoff/handler_test.go | 9 ++-- .../nodes/task/backoff/safe_resourcelist.go | 3 +- .../pkg/controller/nodes/task/cache.go | 2 - .../controller/nodes/task/config/config.go | 2 +- .../nodes/task/event_recorder_test.go | 3 +- .../fakeplugins/next_phase_state_plugin.go | 3 +- .../nodes/task/future_file_reader.go | 5 +-- .../pkg/controller/nodes/task/handler.go | 9 +--- .../pkg/controller/nodes/task/handler_test.go | 4 -- .../nodes/task/k8s/event_watcher_test.go | 1 - .../nodes/task/k8s/plugin_collector.go | 4 +- .../nodes/task/k8s/plugin_collector_test.go | 3 +- .../nodes/task/k8s/task_exec_context_test.go | 3 +- .../nodes/task/remote_workflow_store.go | 7 ++- .../nodes/task/remote_workflow_store_test.go | 12 ++--- .../task/resourcemanager/redis_client.go | 4 +- .../resourcemanager/redis_resourcemanager.go | 7 +-- .../redis_resourcemanager_test.go | 5 ++- .../task/resourcemanager/resourcemanager.go | 4 +- .../resourcemanager/resourcemanager_test.go | 6 +-- .../nodes/task/secretmanager/secrets.go | 1 - .../pkg/controller/nodes/task/setup_ctx.go | 6 +-- .../controller/nodes/task/setup_ctx_test.go | 3 +- .../controller/nodes/task/taskexec_context.go | 5 ++- .../nodes/task/taskexec_context_test.go | 27 +++++------- .../controller/nodes/task/transformer_test.go | 22 ++++------ .../pkg/controller/nodes/task_reader.go | 1 - .../pkg/controller/nodes/transformers.go | 9 ++-- .../pkg/controller/nodes/transformers_test.go | 7 ++- flytepropeller/pkg/controller/workers.go | 7 +-- flytepropeller/pkg/controller/workers_test.go | 4 +- .../pkg/controller/workflow/executor.go | 8 ++-- .../pkg/controller/workflowstore/inmemory.go | 3 +- .../controller/workflowstore/passthrough.go | 5 +-- .../workflowstore/passthrough_test.go | 10 ++--- .../workflowstore/resource_version_caching.go | 1 - .../resource_version_caching_test.go | 15 +++---- .../workflowstore/terminated_tracking.go | 1 - .../workflowstore/terminated_tracking_test.go | 2 +- flytepropeller/pkg/controller/workqueue.go | 8 ++-- .../pkg/controller/workqueue_test.go | 4 +- .../pkg/leaderelection/leader_election.go | 8 ++-- flytepropeller/pkg/utils/assert/literals.go | 3 +- .../pkg/utils/failing_datastore_test.go | 3 +- flytepropeller/pkg/utils/k8s.go | 11 ++--- flytepropeller/pkg/utils/k8s_test.go | 2 +- flytepropeller/pkg/visualize/sort.go | 3 +- flytepropeller/pkg/visualize/visualize.go | 3 +- .../pkg/webhook/aws_secret_manager.go | 3 +- .../pkg/webhook/aws_secret_manager_test.go | 7 ++- flytepropeller/pkg/webhook/config/config.go | 3 +- flytepropeller/pkg/webhook/entrypoint.go | 9 ++-- .../pkg/webhook/gcp_secret_manager.go | 3 +- .../pkg/webhook/gcp_secret_manager_test.go | 7 ++- flytepropeller/pkg/webhook/global_secrets.go | 4 +- .../pkg/webhook/global_secrets_test.go | 10 ++--- flytepropeller/pkg/webhook/init_cert.go | 9 ++-- flytepropeller/pkg/webhook/k8s_secrets.go | 4 +- .../pkg/webhook/k8s_secrets_test.go | 2 +- flytepropeller/pkg/webhook/pod.go | 14 +++--- flytepropeller/pkg/webhook/pod_test.go | 18 +++----- flytepropeller/pkg/webhook/secrets.go | 7 +-- flytepropeller/pkg/webhook/secrets_test.go | 11 ++--- flytepropeller/pkg/webhook/utils.go | 9 ++-- flytepropeller/pkg/webhook/utils_test.go | 1 - .../pkg/webhook/vault_secret_manager.go | 3 +- .../pkg/webhook/vault_secret_manager_test.go | 5 ++- 226 files changed, 685 insertions(+), 825 deletions(-) diff --git a/flytepropeller/.golangci.yml b/flytepropeller/.golangci.yml index 5d53f35295..7f4dbc80e8 100644 --- a/flytepropeller/.golangci.yml +++ b/flytepropeller/.golangci.yml @@ -13,6 +13,7 @@ linters: - deadcode - errcheck - gas + - gci - goconst - goimports - golint @@ -28,3 +29,12 @@ linters: - unparam - unused - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true diff --git a/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go b/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go index a78b61162a..6c3da04107 100644 --- a/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go +++ b/flytepropeller/boilerplate/flyte/golang_support_tools/tools.go @@ -6,7 +6,8 @@ package tools import ( _ "github.com/EngHabu/mockery/cmd/mockery" _ "github.com/alvaroloes/enumer" - _ "github.com/flyteorg/flyte/flytestdlib/cli/pflags" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" + + _ "github.com/flyteorg/flyte/flytestdlib/cli/pflags" ) diff --git a/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh b/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh index c7e5577ef3..9cd49959f4 100755 --- a/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh +++ b/flytepropeller/boilerplate/flyte/golang_test_targets/download_tooling.sh @@ -19,6 +19,7 @@ tools=( "github.com/EngHabu/mockery/cmd/mockery" "github.com/flyteorg/flytestdlib/cli/pflags@latest" "github.com/golangci/golangci-lint/cmd/golangci-lint" + "github.com/daixiang0/gci" "github.com/alvaroloes/enumer" "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" ) diff --git a/flytepropeller/boilerplate/flyte/golang_test_targets/goimports b/flytepropeller/boilerplate/flyte/golang_test_targets/goimports index af1829036c..40f50d106e 100755 --- a/flytepropeller/boilerplate/flyte/golang_test_targets/goimports +++ b/flytepropeller/boilerplate/flyte/golang_test_targets/goimports @@ -6,3 +6,4 @@ # TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/client/*" -not -path "./boilerplate/*") +gci write -s standard -s default -s "prefix(github.com/flyteorg)" --custom-order --skip-generated . diff --git a/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml b/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml index 5d53f35295..7f4dbc80e8 100644 --- a/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml +++ b/flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml @@ -13,6 +13,7 @@ linters: - deadcode - errcheck - gas + - gci - goconst - goimports - golint @@ -28,3 +29,12 @@ linters: - unparam - unused - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true diff --git a/flytepropeller/cmd/controller/cmd/init_certs.go b/flytepropeller/cmd/controller/cmd/init_certs.go index 588984ffd6..17c68ef514 100644 --- a/flytepropeller/cmd/controller/cmd/init_certs.go +++ b/flytepropeller/cmd/controller/cmd/init_certs.go @@ -3,13 +3,11 @@ package cmd import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/spf13/cobra" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook" - - "github.com/spf13/cobra" + webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) // initCertsCmd initializes x509 TLS Certificates and saves them to a secret. diff --git a/flytepropeller/cmd/controller/cmd/root.go b/flytepropeller/cmd/controller/cmd/root.go index 7547418a71..1381b8180e 100644 --- a/flytepropeller/cmd/controller/cmd/root.go +++ b/flytepropeller/cmd/controller/cmd/root.go @@ -8,11 +8,21 @@ import ( "os" "runtime" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "golang.org/x/sync/errgroup" + "k8s.io/client-go/rest" + "k8s.io/klog" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/metrics" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller" config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/signals" - "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/flyteorg/flyte/flytestdlib/contextutils" @@ -21,21 +31,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/version" - - "github.com/prometheus/client_golang/prometheus/promhttp" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" - - "golang.org/x/sync/errgroup" - - "k8s.io/client-go/rest" - "k8s.io/klog" - - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/metrics" ) const ( diff --git a/flytepropeller/cmd/controller/cmd/webhook.go b/flytepropeller/cmd/controller/cmd/webhook.go index a6b9be0492..dd0528e806 100644 --- a/flytepropeller/cmd/controller/cmd/webhook.go +++ b/flytepropeller/cmd/controller/cmd/webhook.go @@ -3,28 +3,24 @@ package cmd import ( "context" + "github.com/spf13/cobra" + "golang.org/x/sync/errgroup" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/signals" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook" webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/profutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/spf13/cobra" - - "golang.org/x/sync/errgroup" - - "k8s.io/client-go/rest" - - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" ) var webhookCmd = &cobra.Command{ diff --git a/flytepropeller/cmd/controller/main.go b/flytepropeller/cmd/controller/main.go index ac30364d30..0f94b9b9fb 100644 --- a/flytepropeller/cmd/controller/main.go +++ b/flytepropeller/cmd/controller/main.go @@ -1,9 +1,8 @@ package main import ( - _ "github.com/flyteorg/flyte/flytepropeller/plugins" - "github.com/flyteorg/flyte/flytepropeller/cmd/controller/cmd" + _ "github.com/flyteorg/flyte/flytepropeller/plugins" ) func main() { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/compile.go b/flytepropeller/cmd/kubectl-flyte/cmd/compile.go index eec5efaf30..056b546849 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/compile.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/compile.go @@ -5,12 +5,13 @@ import ( "io/ioutil" "os" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/pkg/errors" - "github.com/spf13/cobra" ) type CompileOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/create.go b/flytepropeller/cmd/kubectl-flyte/cmd/create.go index 4fcdbec620..24688ef7e2 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/create.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/create.go @@ -7,11 +7,12 @@ import ( "fmt" "io/ioutil" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/ghodss/yaml" "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + "github.com/pkg/errors" + "github.com/spf13/cobra" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -19,9 +20,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" - - "github.com/pkg/errors" - "github.com/spf13/cobra" ) const ( diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go b/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go index e506a272cd..5036201482 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/create_test.go @@ -9,15 +9,15 @@ import ( "testing" "github.com/ghodss/yaml" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" ) var update = flag.Bool("update", false, "Update .golden files") diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/delete.go b/flytepropeller/cmd/kubectl-flyte/cmd/delete.go index 13dfb63eeb..2f70cfa6ba 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/delete.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/delete.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller" "github.com/spf13/cobra" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller" ) type DeleteOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/get.go b/flytepropeller/cmd/kubectl-flyte/cmd/get.go index 765f1e433e..8609a2b62f 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/get.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/get.go @@ -7,13 +7,13 @@ import ( "strings" gotree "github.com/DiSiqueira/GoTree" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/spf13/cobra" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/cmd/kubectl-flyte/cmd/printers" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type GetOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go b/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go index b1d5e2936f..aaaad8282b 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go @@ -9,9 +9,9 @@ import ( gotree "github.com/DiSiqueira/GoTree" "github.com/fatih/color" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" ) diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/root.go b/flytepropeller/cmd/kubectl-flyte/cmd/root.go index ebc642c15f..4bfabe47b5 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/root.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/root.go @@ -8,16 +8,16 @@ import ( "runtime" "time" - "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/version" + "github.com/spf13/cobra" "github.com/spf13/pflag" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" flyteclient "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned" - "github.com/spf13/cobra" + "github.com/flyteorg/flyte/flytestdlib/config/viper" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/version" ) func init() { diff --git a/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go b/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go index 6b6a3e82ad..9b1c439e0a 100644 --- a/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go +++ b/flytepropeller/cmd/kubectl-flyte/cmd/visualize.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" "github.com/spf13/cobra" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" ) type VisualizeOpts struct { diff --git a/flytepropeller/cmd/kubectl-flyte/main.go b/flytepropeller/cmd/kubectl-flyte/main.go index 9fdaab95fe..7d5a8c4540 100644 --- a/flytepropeller/cmd/kubectl-flyte/main.go +++ b/flytepropeller/cmd/kubectl-flyte/main.go @@ -4,10 +4,11 @@ import ( "fmt" "os" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + "github.com/flyteorg/flyte/flytepropeller/cmd/kubectl-flyte/cmd" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" ) func init() { diff --git a/flytepropeller/cmd/manager/cmd/root.go b/flytepropeller/cmd/manager/cmd/root.go index 2b8aeae5cb..dc9dd3fffd 100644 --- a/flytepropeller/cmd/manager/cmd/root.go +++ b/flytepropeller/cmd/manager/cmd/root.go @@ -7,24 +7,22 @@ import ( "os" "runtime" - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/profutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/version" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog" "github.com/flyteorg/flyte/flytepropeller/manager" managerConfig "github.com/flyteorg/flyte/flytepropeller/manager/config" propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/signals" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog" + "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/profutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/version" ) const ( diff --git a/flytepropeller/events/admin_eventsink.go b/flytepropeller/events/admin_eventsink.go index c3ea312a37..beeb3d35f7 100644 --- a/flytepropeller/events/admin_eventsink.go +++ b/flytepropeller/events/admin_eventsink.go @@ -4,8 +4,10 @@ import ( "context" "fmt" - admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" + "github.com/golang/protobuf/proto" + "golang.org/x/time/rate" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" @@ -13,8 +15,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/fastcheck" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/golang/protobuf/proto" - "golang.org/x/time/rate" ) type adminEventSink struct { diff --git a/flytepropeller/events/admin_eventsink_integration_test.go b/flytepropeller/events/admin_eventsink_integration_test.go index adcdabad57..d29e4e032a 100644 --- a/flytepropeller/events/admin_eventsink_integration_test.go +++ b/flytepropeller/events/admin_eventsink_integration_test.go @@ -12,13 +12,13 @@ import ( "testing" "time" + "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/golang/protobuf/ptypes" ) var ( diff --git a/flytepropeller/events/admin_eventsink_test.go b/flytepropeller/events/admin_eventsink_test.go index fa8b56b39b..c13b7ad47f 100644 --- a/flytepropeller/events/admin_eventsink_test.go +++ b/flytepropeller/events/admin_eventsink_test.go @@ -5,18 +5,19 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/errors" - fastcheckMocks "github.com/flyteorg/flyte/flytestdlib/fastcheck/mocks" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/errors" + fastcheckMocks "github.com/flyteorg/flyte/flytestdlib/fastcheck/mocks" ) var ( diff --git a/flytepropeller/events/errors/errors.go b/flytepropeller/events/errors/errors.go index a956b8ecce..879b8b07d7 100644 --- a/flytepropeller/events/errors/errors.go +++ b/flytepropeller/events/errors/errors.go @@ -6,10 +6,11 @@ import ( "fmt" "strings" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type ErrorCode string diff --git a/flytepropeller/events/errors/errors_test.go b/flytepropeller/events/errors/errors_test.go index e8df4c2bf1..745acea474 100644 --- a/flytepropeller/events/errors/errors_test.go +++ b/flytepropeller/events/errors/errors_test.go @@ -4,10 +4,11 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) type testErrorWithReason struct { diff --git a/flytepropeller/events/event_recorder.go b/flytepropeller/events/event_recorder.go index da2dc61013..8c12d0d501 100644 --- a/flytepropeller/events/event_recorder.go +++ b/flytepropeller/events/event_recorder.go @@ -5,12 +5,13 @@ import ( "fmt" "time" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/golang/protobuf/proto" ) const MaxErrorMessageLength = 104857600 //100KB diff --git a/flytepropeller/events/event_recorder_test.go b/flytepropeller/events/event_recorder_test.go index b5f7aa8d4e..2b633b72ff 100644 --- a/flytepropeller/events/event_recorder_test.go +++ b/flytepropeller/events/event_recorder_test.go @@ -5,14 +5,14 @@ import ( "math/rand" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/events/mocks" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/stretchr/testify/assert" ) var ( diff --git a/flytepropeller/events/eventsink_test.go b/flytepropeller/events/eventsink_test.go index 497605fe85..63732d9831 100644 --- a/flytepropeller/events/eventsink_test.go +++ b/flytepropeller/events/eventsink_test.go @@ -9,10 +9,11 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" ) func TestFileEvent(t *testing.T) { diff --git a/flytepropeller/events/local_eventsink.go b/flytepropeller/events/local_eventsink.go index 3dc4cfe897..40a505d62b 100644 --- a/flytepropeller/events/local_eventsink.go +++ b/flytepropeller/events/local_eventsink.go @@ -7,9 +7,10 @@ import ( "os" "sync" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" ) type localSink struct { diff --git a/flytepropeller/events/node_event_recorder.go b/flytepropeller/events/node_event_recorder.go index cb856fcbac..8beb488ce6 100644 --- a/flytepropeller/events/node_event_recorder.go +++ b/flytepropeller/events/node_event_recorder.go @@ -4,16 +4,16 @@ import ( "context" "strings" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) //go:generate mockery -all -output=mocks -case=underscore diff --git a/flytepropeller/events/node_event_recorder_test.go b/flytepropeller/events/node_event_recorder_test.go index 4234108d62..5d2025b525 100644 --- a/flytepropeller/events/node_event_recorder_test.go +++ b/flytepropeller/events/node_event_recorder_test.go @@ -4,17 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/golang/protobuf/proto" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) func getReferenceNodeEv() *event.NodeExecutionEvent { diff --git a/flytepropeller/events/task_event_recorder.go b/flytepropeller/events/task_event_recorder.go index f2ca2dc666..8b531ae85f 100644 --- a/flytepropeller/events/task_event_recorder.go +++ b/flytepropeller/events/task_event_recorder.go @@ -4,16 +4,16 @@ import ( "context" "strings" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) //go:generate mockery -all -output=mocks -case=underscore diff --git a/flytepropeller/events/task_event_recorder_test.go b/flytepropeller/events/task_event_recorder_test.go index 3e622efdc9..be8d2b1ff2 100644 --- a/flytepropeller/events/task_event_recorder_test.go +++ b/flytepropeller/events/task_event_recorder_test.go @@ -4,17 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/golang/protobuf/proto" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) var taskID = &core.Identifier{ diff --git a/flytepropeller/events/workflow_event_recorder.go b/flytepropeller/events/workflow_event_recorder.go index b898dc9b98..f0f48a7f9d 100644 --- a/flytepropeller/events/workflow_event_recorder.go +++ b/flytepropeller/events/workflow_event_recorder.go @@ -4,16 +4,16 @@ import ( "context" "strings" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) //go:generate mockery -all -output=mocks -case=underscore diff --git a/flytepropeller/events/workflow_event_recorder_test.go b/flytepropeller/events/workflow_event_recorder_test.go index 83de680cdf..010c24bf5d 100644 --- a/flytepropeller/events/workflow_event_recorder_test.go +++ b/flytepropeller/events/workflow_event_recorder_test.go @@ -4,17 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/golang/protobuf/proto" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flytepropeller/events/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) func getReferenceWorkflowEv() *event.WorkflowExecutionEvent { diff --git a/flytepropeller/manager/manager.go b/flytepropeller/manager/manager.go index e8ea79a435..566c5c3b2d 100644 --- a/flytepropeller/manager/manager.go +++ b/flytepropeller/manager/manager.go @@ -5,28 +5,23 @@ import ( "fmt" "time" - managerConfig "github.com/flyteorg/flyte/flytepropeller/manager/config" - "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" - propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - leader "github.com/flyteorg/flyte/flytepropeller/pkg/leaderelection" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - - stderrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/imdario/mergo" - "github.com/prometheus/client_golang/prometheus" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/leaderelection" + + managerConfig "github.com/flyteorg/flyte/flytepropeller/manager/config" + "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" + propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + leader "github.com/flyteorg/flyte/flytepropeller/pkg/leaderelection" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + stderrors "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flytepropeller/manager/manager_test.go b/flytepropeller/manager/manager_test.go index 08f3edb1dd..5b1c061151 100644 --- a/flytepropeller/manager/manager_test.go +++ b/flytepropeller/manager/manager_test.go @@ -5,18 +5,16 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" - "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy/mocks" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" + + "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy" + "github.com/flyteorg/flyte/flytepropeller/manager/shardstrategy/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) var ( diff --git a/flytepropeller/manager/shardstrategy/environment.go b/flytepropeller/manager/shardstrategy/environment.go index e0b35d3c48..92bb6cacb1 100644 --- a/flytepropeller/manager/shardstrategy/environment.go +++ b/flytepropeller/manager/shardstrategy/environment.go @@ -3,9 +3,9 @@ package shardstrategy import ( "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - v1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" ) // EnvironmentShardStrategy assigns either project or domain identifiers to individual diff --git a/flytepropeller/manager/shardstrategy/hash.go b/flytepropeller/manager/shardstrategy/hash.go index 357e49d303..3ebdcd5419 100644 --- a/flytepropeller/manager/shardstrategy/hash.go +++ b/flytepropeller/manager/shardstrategy/hash.go @@ -3,10 +3,10 @@ package shardstrategy import ( "fmt" + v1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - - v1 "k8s.io/api/core/v1" ) // HashShardStrategy evenly assigns disjoint keyspace responsibilities over a collection of pods. diff --git a/flytepropeller/manager/shardstrategy/shard_strategy.go b/flytepropeller/manager/shardstrategy/shard_strategy.go index 46d8567dc1..6792a23b96 100644 --- a/flytepropeller/manager/shardstrategy/shard_strategy.go +++ b/flytepropeller/manager/shardstrategy/shard_strategy.go @@ -7,10 +7,10 @@ import ( "fmt" "hash/fnv" + v1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flytepropeller/manager/config" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - - v1 "k8s.io/api/core/v1" ) //go:generate mockery -name ShardStrategy -case=underscore diff --git a/flytepropeller/manager/shardstrategy/shard_strategy_test.go b/flytepropeller/manager/shardstrategy/shard_strategy_test.go index 5be9cfddcf..e33c7be3e0 100644 --- a/flytepropeller/manager/shardstrategy/shard_strategy_test.go +++ b/flytepropeller/manager/shardstrategy/shard_strategy_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1 "k8s.io/api/core/v1" ) diff --git a/flytepropeller/pkg/apis/flyteworkflow/crd.go b/flytepropeller/pkg/apis/flyteworkflow/crd.go index a78a949013..9b8b71f00d 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/crd.go +++ b/flytepropeller/pkg/apis/flyteworkflow/crd.go @@ -4,7 +4,6 @@ import ( "fmt" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go index 65c794335c..07a493b8be 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type Error struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go index 6defc55bf1..d5adf91d77 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go @@ -5,9 +5,10 @@ import ( "io/ioutil" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/stretchr/testify/assert" ) func TestMarshalUnMarshal_BranchTask(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go index e505ac56e9..39ec19c165 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/error.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) // Wrapper around core.Execution error. Execution Error has a protobuf enum and hence needs to be wrapped by custom marshaller diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go index 9250de9db8..30cd9fa0de 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config.go @@ -1,8 +1,9 @@ package v1alpha1 import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // This contains an OutputLocationPrefix. When running against AWS, this should be something of the form diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go index ab0633742f..b3751b4268 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/execution_config_test.go @@ -1,10 +1,11 @@ package v1alpha1 import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "testing" + "github.com/stretchr/testify/assert" - "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func TestRawOutputConfig(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go index 3610fadce2..a7ffa799fa 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/gate.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type ConditionKind string diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go index 1f07927804..7d6a3622c8 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/identifier.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type Identifier struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go index ab9562e4a3..b3d744bd77 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/iface.go @@ -7,7 +7,6 @@ import ( "time" "github.com/golang/protobuf/proto" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go index 6332762742..9fb891d01a 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status.go @@ -9,12 +9,12 @@ import ( "strconv" "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type MutableStruct struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go index 5618d8ffb6..45c299687a 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/node_status_test.go @@ -6,12 +6,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestIsPhaseTerminal(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go index d061408d76..8a22cae974 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go @@ -4,10 +4,11 @@ import ( "bytes" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" typesv1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) var marshaler = jsonpb.Marshaler{} diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go index 8c5ea987a7..065b8a8852 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/register.go @@ -1,10 +1,11 @@ package v1alpha1 import ( - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow" ) const FlyteWorkflowKind = "flyteworkflow" diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go index f480ee3b2e..23b6b2cb47 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks.go @@ -3,8 +3,9 @@ package v1alpha1 import ( "bytes" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type TaskSpec struct { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go index 2d1ab15dc6..0bc1240c95 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/tasks_test.go @@ -4,8 +4,9 @@ import ( "encoding/json" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) func TestTaskSpec(t *testing.T) { diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go index 8144c8619b..225a49ac3f 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow.go @@ -5,14 +5,13 @@ import ( "context" "encoding/json" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "k8s.io/apimachinery/pkg/types" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/jsonpb" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/storage" ) // Defines a non-configurable keyspace size for shard keys. This needs to be a small value because we use label diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go index 1c69721ffd..db6175cadf 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_status.go @@ -4,11 +4,11 @@ import ( "context" "strconv" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const maxMessageSize = 1024 diff --git a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go index 001d3abf57..6e72b95ec7 100644 --- a/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go +++ b/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/workflow_test.go @@ -5,10 +5,11 @@ import ( "io/ioutil" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" "k8s.io/apimachinery/pkg/util/sets" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) func TestMarshalUnmarshal_Connections(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/admin_test.go b/flytepropeller/pkg/compiler/admin_test.go index 484a75ebff..2545d293ee 100644 --- a/flytepropeller/pkg/compiler/admin_test.go +++ b/flytepropeller/pkg/compiler/admin_test.go @@ -3,10 +3,11 @@ package compiler import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) var launchPlanIdentifier = core.Identifier{ diff --git a/flytepropeller/pkg/compiler/common/index.go b/flytepropeller/pkg/compiler/common/index.go index b6f4c7c023..01344e46a4 100644 --- a/flytepropeller/pkg/compiler/common/index.go +++ b/flytepropeller/pkg/compiler/common/index.go @@ -1,9 +1,10 @@ package common import ( + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/util/sets" ) // Defines an index of nodebuilders based on the id. diff --git a/flytepropeller/pkg/compiler/requirements_test.go b/flytepropeller/pkg/compiler/requirements_test.go index 1a2681d724..5eeb2e6964 100644 --- a/flytepropeller/pkg/compiler/requirements_test.go +++ b/flytepropeller/pkg/compiler/requirements_test.go @@ -3,8 +3,9 @@ package compiler import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestGetRequirements(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/task_compiler.go b/flytepropeller/pkg/compiler/task_compiler.go index b6bea171f8..4d8fea46db 100644 --- a/flytepropeller/pkg/compiler/task_compiler.go +++ b/flytepropeller/pkg/compiler/task_compiler.go @@ -3,14 +3,14 @@ package compiler import ( "fmt" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/validation" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/api/resource" ) func validateResource(resourceName core.Resources_ResourceName, resourceVal string, errs errors.CompileErrors) (ok bool) { diff --git a/flytepropeller/pkg/compiler/task_compiler_test.go b/flytepropeller/pkg/compiler/task_compiler_test.go index b16d71d94c..bf4949a1a9 100644 --- a/flytepropeller/pkg/compiler/task_compiler_test.go +++ b/flytepropeller/pkg/compiler/task_compiler_test.go @@ -3,13 +3,12 @@ package compiler import ( "testing" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" ) func MakeResource(name core.Resources_ResourceName, v string) *core.Resources_ResourceEntry { diff --git a/flytepropeller/pkg/compiler/test/compiler_test.go b/flytepropeller/pkg/compiler/test/compiler_test.go index b06a367c79..e2dd63431e 100644 --- a/flytepropeller/pkg/compiler/test/compiler_test.go +++ b/flytepropeller/pkg/compiler/test/compiler_test.go @@ -11,25 +11,21 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - - "k8s.io/apimachinery/pkg/util/sets" - - "github.com/go-test/deep" - "github.com/ghodss/yaml" + "github.com/go-test/deep" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" ) var update = flag.Bool("update", false, "Update .golden files") diff --git a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go index 8ec20ef840..2d967c560e 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go @@ -1,11 +1,12 @@ package k8s import ( + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" - "k8s.io/apimachinery/pkg/util/sets" ) func validateInputs(nodeID common.NodeID, iface *core.TypedInterface, inputs core.LiteralMap, errs errors.CompileErrors) (ok bool) { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/node.go b/flytepropeller/pkg/compiler/transformers/k8s/node.go index 7ab6502946..2ac06ebd89 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/node.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/node.go @@ -3,13 +3,14 @@ package k8s import ( "strings" + "github.com/go-test/deep" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/go-test/deep" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Gets the compiled subgraph if this node contains an inline-declared coreWorkflow. Otherwise nil. diff --git a/flytepropeller/pkg/compiler/transformers/k8s/node_test.go b/flytepropeller/pkg/compiler/transformers/k8s/node_test.go index 4ba9010c96..f2d6c79494 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/node_test.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/node_test.go @@ -4,17 +4,14 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/durationpb" + "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - - "github.com/stretchr/testify/assert" - - "google.golang.org/protobuf/types/known/durationpb" - - "k8s.io/apimachinery/pkg/api/resource" ) func createNodeWithTask() *core.Node { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/utils.go b/flytepropeller/pkg/compiler/transformers/k8s/utils.go index 963eefa614..06884f4b75 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/utils.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/utils.go @@ -3,11 +3,11 @@ package k8s import ( "math" + "github.com/golang/protobuf/ptypes" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/golang/protobuf/ptypes" ) func refInt(i int) *int { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go b/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go index 46e092a29e..d2d9b10866 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/utils_test.go @@ -5,9 +5,9 @@ import ( "github.com/go-test/deep" _struct "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestComputeRetryStrategy(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/transformers/k8s/workflow.go b/flytepropeller/pkg/compiler/transformers/k8s/workflow.go index 3817cb7762..2421ddf9bb 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/workflow.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/workflow.go @@ -6,12 +6,13 @@ import ( "hash/fnv" "strings" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( diff --git a/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go b/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go index 362fee8990..ae3b82b8b9 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/workflow_test.go @@ -5,13 +5,14 @@ import ( "io/ioutil" "testing" + "github.com/golang/protobuf/jsonpb" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/golang/protobuf/jsonpb" - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/util/sets" ) func createSampleMockWorkflow() *mockWorkflow { diff --git a/flytepropeller/pkg/compiler/utils.go b/flytepropeller/pkg/compiler/utils.go index 19da73a92c..76c372c9e7 100644 --- a/flytepropeller/pkg/compiler/utils.go +++ b/flytepropeller/pkg/compiler/utils.go @@ -1,9 +1,10 @@ package compiler import ( + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" - "k8s.io/apimachinery/pkg/util/sets" ) func toInterfaceProviderMap(tasks []common.InterfaceProvider) map[string]common.InterfaceProvider { diff --git a/flytepropeller/pkg/compiler/validators/bindings.go b/flytepropeller/pkg/compiler/validators/bindings.go index 7c6f0e60e6..d9ec6b6ae2 100644 --- a/flytepropeller/pkg/compiler/validators/bindings.go +++ b/flytepropeller/pkg/compiler/validators/bindings.go @@ -3,12 +3,12 @@ package validators import ( "reflect" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/typing" + "k8s.io/apimachinery/pkg/util/sets" flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/typing" ) func validateBinding(w c.WorkflowBuilder, nodeID c.NodeID, nodeParam string, binding *flyte.BindingData, diff --git a/flytepropeller/pkg/compiler/validators/bindings_test.go b/flytepropeller/pkg/compiler/validators/bindings_test.go index 9d90e1c843..30f0bee2c6 100644 --- a/flytepropeller/pkg/compiler/validators/bindings_test.go +++ b/flytepropeller/pkg/compiler/validators/bindings_test.go @@ -3,15 +3,14 @@ package validators import ( "testing" - c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) // LiteralToBinding converts a literal to a non-promise binding data. diff --git a/flytepropeller/pkg/compiler/validators/branch.go b/flytepropeller/pkg/compiler/validators/branch.go index c7aabc19cf..386f1cecda 100644 --- a/flytepropeller/pkg/compiler/validators/branch.go +++ b/flytepropeller/pkg/compiler/validators/branch.go @@ -1,10 +1,11 @@ package validators import ( + "k8s.io/apimachinery/pkg/util/sets" + flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "k8s.io/apimachinery/pkg/util/sets" ) func validateBranchInterface(w c.WorkflowBuilder, node c.NodeBuilder, errs errors.CompileErrors) (iface *flyte.TypedInterface, ok bool) { diff --git a/flytepropeller/pkg/compiler/validators/branch_test.go b/flytepropeller/pkg/compiler/validators/branch_test.go index 537f0d9b4f..05be9ab510 100644 --- a/flytepropeller/pkg/compiler/validators/branch_test.go +++ b/flytepropeller/pkg/compiler/validators/branch_test.go @@ -3,12 +3,12 @@ package validators import ( "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/stretchr/testify/assert" ) func createBooleanOperand(val bool) *core.Operand { diff --git a/flytepropeller/pkg/compiler/validators/interface_test.go b/flytepropeller/pkg/compiler/validators/interface_test.go index 9a2147d9b1..b3394ea8db 100644 --- a/flytepropeller/pkg/compiler/validators/interface_test.go +++ b/flytepropeller/pkg/compiler/validators/interface_test.go @@ -5,17 +5,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/types/known/durationpb" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "google.golang.org/protobuf/types/known/durationpb" ) func TestValidateInterface(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/validators/node_test.go b/flytepropeller/pkg/compiler/validators/node_test.go index d2368ac850..3982b71344 100644 --- a/flytepropeller/pkg/compiler/validators/node_test.go +++ b/flytepropeller/pkg/compiler/validators/node_test.go @@ -3,13 +3,12 @@ package validators import ( "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/stretchr/testify/assert" ) func TestValidateBranchNode(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/validators/typing.go b/flytepropeller/pkg/compiler/validators/typing.go index c88c062430..388cb32123 100644 --- a/flytepropeller/pkg/compiler/validators/typing.go +++ b/flytepropeller/pkg/compiler/validators/typing.go @@ -3,8 +3,9 @@ package validators import ( "strings" - flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" structpb "github.com/golang/protobuf/ptypes/struct" + + flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type typeChecker interface { diff --git a/flytepropeller/pkg/compiler/validators/typing_test.go b/flytepropeller/pkg/compiler/validators/typing_test.go index e920e39774..17e55b1e0a 100644 --- a/flytepropeller/pkg/compiler/validators/typing_test.go +++ b/flytepropeller/pkg/compiler/validators/typing_test.go @@ -3,9 +3,10 @@ package validators import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" structpb "github.com/golang/protobuf/ptypes/struct" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestSimpleLiteralCasting(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/validators/utils.go b/flytepropeller/pkg/compiler/validators/utils.go index 462cb94905..8c4cda12ce 100644 --- a/flytepropeller/pkg/compiler/validators/utils.go +++ b/flytepropeller/pkg/compiler/validators/utils.go @@ -4,12 +4,12 @@ import ( "fmt" "strings" - "golang.org/x/exp/slices" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/proto" "golang.org/x/exp/maps" + "golang.org/x/exp/slices" "k8s.io/apimachinery/pkg/util/sets" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func containsBindingByVariableName(bindings []*core.Binding, name string) (found bool) { diff --git a/flytepropeller/pkg/compiler/validators/utils_test.go b/flytepropeller/pkg/compiler/validators/utils_test.go index ae320e7855..a5e5d3f23c 100644 --- a/flytepropeller/pkg/compiler/validators/utils_test.go +++ b/flytepropeller/pkg/compiler/validators/utils_test.go @@ -3,9 +3,10 @@ package validators import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestLiteralTypeForLiterals(t *testing.T) { diff --git a/flytepropeller/pkg/compiler/workflow_compiler.go b/flytepropeller/pkg/compiler/workflow_compiler.go index 200997aedb..07fc7bf938 100644 --- a/flytepropeller/pkg/compiler/workflow_compiler.go +++ b/flytepropeller/pkg/compiler/workflow_compiler.go @@ -34,14 +34,14 @@ package compiler import ( "strings" + // #noSA1019 + "github.com/golang/protobuf/proto" + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" v "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" - - // #noSA1019 - "github.com/golang/protobuf/proto" - "k8s.io/apimachinery/pkg/util/sets" ) // Updates workflows and tasks references to reflect the needed ones for this workflow (ignoring subworkflows) diff --git a/flytepropeller/pkg/compiler/workflow_compiler_test.go b/flytepropeller/pkg/compiler/workflow_compiler_test.go index 08ab6f3ad7..e9e01d36c2 100644 --- a/flytepropeller/pkg/compiler/workflow_compiler_test.go +++ b/flytepropeller/pkg/compiler/workflow_compiler_test.go @@ -5,16 +5,16 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" + "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" v "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" "github.com/flyteorg/flyte/flytepropeller/pkg/visualize" - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/util/sets" ) func createEmptyVariableMap() *core.VariableMap { diff --git a/flytepropeller/pkg/controller/completed_workflows.go b/flytepropeller/pkg/controller/completed_workflows.go index 53d4fae69b..32f70c9be3 100644 --- a/flytepropeller/pkg/controller/completed_workflows.go +++ b/flytepropeller/pkg/controller/completed_workflows.go @@ -4,8 +4,9 @@ import ( "strconv" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) const ( diff --git a/flytepropeller/pkg/controller/completed_workflows_test.go b/flytepropeller/pkg/controller/completed_workflows_test.go index be78be665d..a069a7b55d 100644 --- a/flytepropeller/pkg/controller/completed_workflows_test.go +++ b/flytepropeller/pkg/controller/completed_workflows_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) func TestIgnoreCompletedWorkflowsLabelSelector(t *testing.T) { diff --git a/flytepropeller/pkg/controller/composite_workqueue.go b/flytepropeller/pkg/controller/composite_workqueue.go index b60d0ea79b..56780c6706 100644 --- a/flytepropeller/pkg/controller/composite_workqueue.go +++ b/flytepropeller/pkg/controller/composite_workqueue.go @@ -4,13 +4,13 @@ import ( "context" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/workqueue" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) // A CompositeWorkQueue can be used in cases where the work is enqueued by two sources. It can be enqueued by either diff --git a/flytepropeller/pkg/controller/composite_workqueue_test.go b/flytepropeller/pkg/controller/composite_workqueue_test.go index 1680131f47..b52ade5443 100644 --- a/flytepropeller/pkg/controller/composite_workqueue_test.go +++ b/flytepropeller/pkg/controller/composite_workqueue_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/stretchr/testify/assert" + config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) func TestNewCompositeWorkQueue(t *testing.T) { diff --git a/flytepropeller/pkg/controller/config/config.go b/flytepropeller/pkg/controller/config/config.go index f7d898634b..10a83cd2fc 100644 --- a/flytepropeller/pkg/controller/config/config.go +++ b/flytepropeller/pkg/controller/config/config.go @@ -36,9 +36,10 @@ package config import ( "time" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/contextutils" - "k8s.io/apimachinery/pkg/types" ) //go:generate pflags Config --default-var=defaultConfig diff --git a/flytepropeller/pkg/controller/controller.go b/flytepropeller/pkg/controller/controller.go index 85d6850325..be26404a98 100644 --- a/flytepropeller/pkg/controller/controller.go +++ b/flytepropeller/pkg/controller/controller.go @@ -9,12 +9,27 @@ import ( "runtime/pprof" "time" + grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" + "github.com/pkg/errors" + "github.com/prometheus/client_golang/prometheus" + "google.golang.org/grpc" + _ "google.golang.org/grpc/balancer/roundrobin" //nolint + apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + apierrors "k8s.io/apimachinery/pkg/api/errors" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/util/clock" + k8sInformers "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/tools/leaderelection" + "k8s.io/client-go/tools/record" + "sigs.k8s.io/controller-runtime/pkg/manager" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" flyteK8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flytepropeller/events" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -34,37 +49,12 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore" leader "github.com/flyteorg/flyte/flytepropeller/pkg/leaderelection" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/contextutils" stdErrs "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" - - "github.com/pkg/errors" - - "github.com/prometheus/client_golang/prometheus" - - "google.golang.org/grpc" - _ "google.golang.org/grpc/balancer/roundrobin" //nolint - - apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/clock" - - k8sInformers "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/leaderelection" - "k8s.io/client-go/tools/record" - - "sigs.k8s.io/controller-runtime/pkg/manager" ) const ( diff --git a/flytepropeller/pkg/controller/controller_test.go b/flytepropeller/pkg/controller/controller_test.go index 5f67668dcc..6cb94e4d73 100644 --- a/flytepropeller/pkg/controller/controller_test.go +++ b/flytepropeller/pkg/controller/controller_test.go @@ -6,17 +6,16 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/labels" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/labels" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) var wfs = []*v1alpha1.FlyteWorkflow{ diff --git a/flytepropeller/pkg/controller/executors/kube.go b/flytepropeller/pkg/controller/executors/kube.go index d7bf3db776..7dc62135b6 100644 --- a/flytepropeller/pkg/controller/executors/kube.go +++ b/flytepropeller/pkg/controller/executors/kube.go @@ -4,13 +4,12 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/fastcheck" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/flyteorg/flyte/flytestdlib/fastcheck" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) //go:generate mockery -name Client -case=underscore diff --git a/flytepropeller/pkg/controller/executors/kube_test.go b/flytepropeller/pkg/controller/executors/kube_test.go index 8b2aa4d626..bcaa64ff6f 100644 --- a/flytepropeller/pkg/controller/executors/kube_test.go +++ b/flytepropeller/pkg/controller/executors/kube_test.go @@ -6,13 +6,14 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func TestIdFromObject(t *testing.T) { diff --git a/flytepropeller/pkg/controller/garbage_collector.go b/flytepropeller/pkg/controller/garbage_collector.go index 0b5e9094eb..55b026ecb0 100644 --- a/flytepropeller/pkg/controller/garbage_collector.go +++ b/flytepropeller/pkg/controller/garbage_collector.go @@ -3,20 +3,19 @@ package controller import ( "context" "runtime/pprof" + "strings" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "strings" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/clock" + corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/typed/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/clock" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" ) type gcMetrics struct { diff --git a/flytepropeller/pkg/controller/garbage_collector_test.go b/flytepropeller/pkg/controller/garbage_collector_test.go index c972bc4c6a..9fb72154c7 100644 --- a/flytepropeller/pkg/controller/garbage_collector_test.go +++ b/flytepropeller/pkg/controller/garbage_collector_test.go @@ -7,16 +7,16 @@ import ( "testing" "time" - config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/typed/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/stretchr/testify/assert" corev1Types "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/clock" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/typed/flyteworkflow/v1alpha1" + config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestNewGarbageCollector(t *testing.T) { diff --git a/flytepropeller/pkg/controller/handler.go b/flytepropeller/pkg/controller/handler.go index 9f3f8d67c6..7a01181e2a 100644 --- a/flytepropeller/pkg/controller/handler.go +++ b/flytepropeller/pkg/controller/handler.go @@ -7,23 +7,21 @@ import ( "runtime/debug" "time" + "github.com/prometheus/client_golang/prometheus" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/prometheus/client_golang/prometheus" ) // TODO Lets move everything to use controller runtime diff --git a/flytepropeller/pkg/controller/handler_test.go b/flytepropeller/pkg/controller/handler_test.go index 96ceb34350..ce1ca63818 100644 --- a/flytepropeller/pkg/controller/handler_test.go +++ b/flytepropeller/pkg/controller/handler_test.go @@ -6,25 +6,22 @@ import ( "testing" "time" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - eventErrors "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" workflowErrors "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflow/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflowstore/mocks" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" storagemocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type mockExecutor struct { diff --git a/flytepropeller/pkg/controller/nodes/array/event_recorder.go b/flytepropeller/pkg/controller/nodes/array/event_recorder.go index d202fa3fbd..55cbbce89f 100644 --- a/flytepropeller/pkg/controller/nodes/array/event_recorder.go +++ b/flytepropeller/pkg/controller/nodes/array/event_recorder.go @@ -5,13 +5,14 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes" + idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/golang/protobuf/ptypes" ) type arrayEventRecorder interface { diff --git a/flytepropeller/pkg/controller/nodes/array/handler.go b/flytepropeller/pkg/controller/nodes/array/handler.go index b24e513857..35076d0a97 100644 --- a/flytepropeller/pkg/controller/nodes/array/handler.go +++ b/flytepropeller/pkg/controller/nodes/array/handler.go @@ -7,11 +7,9 @@ import ( "strconv" idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - "github.com/flyteorg/flyte/flytepropeller/events" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" @@ -22,7 +20,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" diff --git a/flytepropeller/pkg/controller/nodes/array/handler_test.go b/flytepropeller/pkg/controller/nodes/array/handler_test.go index 5dd2b1f62d..f9086218c2 100644 --- a/flytepropeller/pkg/controller/nodes/array/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/array/handler_test.go @@ -5,9 +5,13 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" eventmocks "github.com/flyteorg/flyte/flytepropeller/events/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" @@ -20,18 +24,11 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" recoverymocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go b/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go index d5523253af..6d0cfd3bfb 100644 --- a/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go +++ b/flytepropeller/pkg/controller/nodes/array/node_execution_context_builder.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" diff --git a/flytepropeller/pkg/controller/nodes/array/utils_test.go b/flytepropeller/pkg/controller/nodes/array/utils_test.go index eed23b248b..fde3d0fa80 100644 --- a/flytepropeller/pkg/controller/nodes/array/utils_test.go +++ b/flytepropeller/pkg/controller/nodes/array/utils_test.go @@ -3,9 +3,9 @@ package array import ( "testing" - idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + + idlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestAppendLiteral(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/branch/comparator_test.go b/flytepropeller/pkg/controller/nodes/branch/comparator_test.go index 5aaa5a105d..61da281c4b 100644 --- a/flytepropeller/pkg/controller/nodes/branch/comparator_test.go +++ b/flytepropeller/pkg/controller/nodes/branch/comparator_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestEvaluate_int(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/branch/evaluator.go b/flytepropeller/pkg/controller/nodes/branch/evaluator.go index b3f887617b..44dc8711e8 100644 --- a/flytepropeller/pkg/controller/nodes/branch/evaluator.go +++ b/flytepropeller/pkg/controller/nodes/branch/evaluator.go @@ -3,13 +3,13 @@ package branch import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ErrorCodeUserProvidedError = "UserProvidedError" diff --git a/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go b/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go index ca3d8203c1..45bb850358 100644 --- a/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go +++ b/flytepropeller/pkg/controller/nodes/branch/evaluator_test.go @@ -5,15 +5,14 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) // Creates a ComparisonExpression, comparing 2 literals diff --git a/flytepropeller/pkg/controller/nodes/branch/handler.go b/flytepropeller/pkg/controller/nodes/branch/handler.go index 31efae470c..d2a4fcfa68 100644 --- a/flytepropeller/pkg/controller/nodes/branch/handler.go +++ b/flytepropeller/pkg/controller/nodes/branch/handler.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" @@ -13,7 +12,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" diff --git a/flytepropeller/pkg/controller/nodes/branch/handler_test.go b/flytepropeller/pkg/controller/nodes/branch/handler_test.go index a783c0a1bb..a194452ff5 100644 --- a/flytepropeller/pkg/controller/nodes/branch/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/branch/handler_test.go @@ -5,29 +5,27 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var eventConfig = &config.EventConfig{ diff --git a/flytepropeller/pkg/controller/nodes/cache.go b/flytepropeller/pkg/controller/nodes/cache.go index 9145d4eb95..136d070de4 100644 --- a/flytepropeller/pkg/controller/nodes/cache.go +++ b/flytepropeller/pkg/controller/nodes/cache.go @@ -5,27 +5,23 @@ import ( "strconv" "time" + "github.com/pkg/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" nodeserrors "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/pkg/errors" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // computeCatalogReservationOwnerID constructs a unique identifier which includes the nodes diff --git a/flytepropeller/pkg/controller/nodes/cache_test.go b/flytepropeller/pkg/controller/nodes/cache_test.go index 75145a2e60..b0c0a3a351 100644 --- a/flytepropeller/pkg/controller/nodes/cache_test.go +++ b/flytepropeller/pkg/controller/nodes/cache_test.go @@ -7,31 +7,26 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + catalogmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" executorsmocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" interfacesmocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - catalogmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "k8s.io/apimachinery/pkg/types" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/catalog/config.go b/flytepropeller/pkg/controller/nodes/catalog/config.go index 2d890ec824..2b0c484fb7 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/config.go +++ b/flytepropeller/pkg/controller/nodes/catalog/config.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flytestdlib/config" "google.golang.org/grpc" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/catalog/datacatalog" + "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate pflags Config --default-var defaultConfig diff --git a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go index e27e1a1103..717c65739f 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go +++ b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog.go @@ -6,22 +6,22 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/golang/protobuf/ptypes" grpcRetry "github.com/grpc-ecosystem/go-grpc-middleware/retry" grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/pkg/errors" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/golang/protobuf/ptypes" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/status" "k8s.io/apimachinery/pkg/util/uuid" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go index bce6f4e974..2c16420f8c 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go +++ b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/datacatalog_test.go @@ -6,25 +6,23 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/clients/go/datacatalog/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" "github.com/google/uuid" "github.com/pkg/errors" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/golang/protobuf/ptypes" + "github.com/flyteorg/flyte/flyteidl/clients/go/datacatalog/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go index 7bca94e5f4..74277dcda0 100644 --- a/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go +++ b/flytepropeller/pkg/controller/nodes/catalog/datacatalog/transformer_test.go @@ -6,11 +6,12 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/stretchr/testify/assert" ) // add test for raarranged Literal maps for input values diff --git a/flytepropeller/pkg/controller/nodes/common/utils.go b/flytepropeller/pkg/controller/nodes/common/utils.go index a88107638e..19714da3d5 100644 --- a/flytepropeller/pkg/controller/nodes/common/utils.go +++ b/flytepropeller/pkg/controller/nodes/common/utils.go @@ -4,7 +4,6 @@ import ( "strconv" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" ) diff --git a/flytepropeller/pkg/controller/nodes/common/utils_test.go b/flytepropeller/pkg/controller/nodes/common/utils_test.go index f185631617..0639605589 100644 --- a/flytepropeller/pkg/controller/nodes/common/utils_test.go +++ b/flytepropeller/pkg/controller/nodes/common/utils_test.go @@ -3,8 +3,9 @@ package common import ( "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) type ParentInfo struct { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go index cd804faf22..cbc5414e11 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go @@ -5,6 +5,8 @@ import ( "fmt" "strconv" + "k8s.io/apimachinery/pkg/util/rand" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" @@ -20,8 +22,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "k8s.io/apimachinery/pkg/util/rand" ) type dynamicWorkflowContext struct { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go index 56a72fa446..07527d0013 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go @@ -7,19 +7,15 @@ import ( "testing" "github.com/pkg/errors" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" mocks4 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" @@ -27,6 +23,9 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" mocks5 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" + storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" ) func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/handler.go b/flytepropeller/pkg/controller/nodes/dynamic/handler.go index 42a4c416d6..21ef2da487 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/handler.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/handler.go @@ -6,10 +6,8 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" @@ -18,7 +16,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" diff --git a/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go b/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go index 7e02534f24..e66dadbebf 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go @@ -5,32 +5,28 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v12 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - lpMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" executorMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/dynamic/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" nodeMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + lpMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type dynamicNodeStateHolder struct { diff --git a/flytepropeller/pkg/controller/nodes/dynamic/utils.go b/flytepropeller/pkg/controller/nodes/dynamic/utils.go index 710d7b4ff6..690cbe06a1 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/utils.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/utils.go @@ -6,7 +6,6 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" diff --git a/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go b/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go index f0907b626a..6afdd487b9 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/utils_test.go @@ -4,13 +4,11 @@ import ( "context" "testing" - mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" ) func TestHierarchicalNodeID(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/end/handler.go b/flytepropeller/pkg/controller/nodes/end/handler.go index 1e128ca116..d10140fb39 100644 --- a/flytepropeller/pkg/controller/nodes/end/handler.go +++ b/flytepropeller/pkg/controller/nodes/end/handler.go @@ -3,13 +3,12 @@ package end import ( "context" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type endHandler struct { diff --git a/flytepropeller/pkg/controller/nodes/end/handler_test.go b/flytepropeller/pkg/controller/nodes/end/handler_test.go index 502265585a..4e7fcdaf01 100644 --- a/flytepropeller/pkg/controller/nodes/end/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/end/handler_test.go @@ -5,24 +5,24 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/proto" regErrors "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" flyteassert "github.com/flyteorg/flyte/flytepropeller/pkg/utils/assert" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var testScope = promutils.NewScope("end_test") diff --git a/flytepropeller/pkg/controller/nodes/executor.go b/flytepropeller/pkg/controller/nodes/executor.go index 3a03949c0c..b9d727db7e 100644 --- a/flytepropeller/pkg/controller/nodes/executor.go +++ b/flytepropeller/pkg/controller/nodes/executor.go @@ -21,11 +21,17 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -38,23 +44,12 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/contextutils" errors2 "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/golang/protobuf/ptypes" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const cacheSerializedReason = "waiting on serialized cache" diff --git a/flytepropeller/pkg/controller/nodes/executor_test.go b/flytepropeller/pkg/controller/nodes/executor_test.go index 0d67edcec5..222e0a05d5 100644 --- a/flytepropeller/pkg/controller/nodes/executor_test.go +++ b/flytepropeller/pkg/controller/nodes/executor_test.go @@ -8,16 +8,20 @@ import ( "testing" "time" + "github.com/golang/protobuf/proto" + "github.com/prometheus/client_golang/prometheus" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - pluginscatalog "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" catalogmocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" eventMocks "github.com/flyteorg/flyte/flytepropeller/events/mocks" @@ -34,21 +38,11 @@ import ( recoveryMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" flyteassert "github.com/flyteorg/flyte/flytepropeller/pkg/utils/assert" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - - "github.com/golang/protobuf/proto" - - "github.com/prometheus/client_golang/prometheus" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var fakeKubeClient = mocks4.NewFakeKubeClient() diff --git a/flytepropeller/pkg/controller/nodes/factory/handler_factory.go b/flytepropeller/pkg/controller/nodes/factory/handler_factory.go index 594b810916..424bd15f10 100644 --- a/flytepropeller/pkg/controller/nodes/factory/handler_factory.go +++ b/flytepropeller/pkg/controller/nodes/factory/handler_factory.go @@ -3,12 +3,11 @@ package factory import ( "context" + "github.com/pkg/errors" "k8s.io/client-go/kubernetes" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" @@ -23,10 +22,7 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/pkg/errors" ) type handlerFactory struct { diff --git a/flytepropeller/pkg/controller/nodes/gate/handler.go b/flytepropeller/pkg/controller/nodes/gate/handler.go index d9bd02dcf5..00d2cb989f 100644 --- a/flytepropeller/pkg/controller/nodes/gate/handler.go +++ b/flytepropeller/pkg/controller/nodes/gate/handler.go @@ -8,13 +8,11 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" diff --git a/flytepropeller/pkg/controller/nodes/gate/handler_test.go b/flytepropeller/pkg/controller/nodes/gate/handler_test.go index b3e7991714..488cb58a07 100644 --- a/flytepropeller/pkg/controller/nodes/gate/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/gate/handler_test.go @@ -6,11 +6,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/types/known/durationpb" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" @@ -18,18 +21,10 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/gate/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" nodeMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "google.golang.org/protobuf/types/known/durationpb" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/handler/state.go b/flytepropeller/pkg/controller/nodes/handler/state.go index 07fdb8fef3..a7fa7bdf87 100644 --- a/flytepropeller/pkg/controller/nodes/handler/state.go +++ b/flytepropeller/pkg/controller/nodes/handler/state.go @@ -4,11 +4,8 @@ import ( "time" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flytepropeller/pkg/controller/nodes/handler/state_test.go b/flytepropeller/pkg/controller/nodes/handler/state_test.go index a431ca275a..95f12b6f49 100644 --- a/flytepropeller/pkg/controller/nodes/handler/state_test.go +++ b/flytepropeller/pkg/controller/nodes/handler/state_test.go @@ -6,9 +6,9 @@ import ( "encoding/gob" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s" ) // A test to demonstrate how to unmarshal a serialized state from a workflow CRD. diff --git a/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go b/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go index a04c93dc93..883dbd5f45 100644 --- a/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go +++ b/flytepropeller/pkg/controller/nodes/handler/transition_info_test.go @@ -3,12 +3,11 @@ package handler import ( "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestPhaseInfoQueued(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/handler/transition_test.go b/flytepropeller/pkg/controller/nodes/handler/transition_test.go index d6b92fc257..b2d62c793a 100644 --- a/flytepropeller/pkg/controller/nodes/handler/transition_test.go +++ b/flytepropeller/pkg/controller/nodes/handler/transition_test.go @@ -3,11 +3,10 @@ package handler import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) func AsPointer[T any](val T) *T { diff --git a/flytepropeller/pkg/controller/nodes/interfaces/node.go b/flytepropeller/pkg/controller/nodes/interfaces/node.go index c2f30a2aa1..fd9c12ebb7 100644 --- a/flytepropeller/pkg/controller/nodes/interfaces/node.go +++ b/flytepropeller/pkg/controller/nodes/interfaces/node.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" ) diff --git a/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go b/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go index d22619a856..8f10becca4 100644 --- a/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go +++ b/flytepropeller/pkg/controller/nodes/interfaces/node_exec_context.go @@ -3,19 +3,16 @@ package interfaces import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/events" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - "github.com/flyteorg/flyte/flytestdlib/storage" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) type TaskReader interface { diff --git a/flytepropeller/pkg/controller/nodes/node_exec_context.go b/flytepropeller/pkg/controller/nodes/node_exec_context.go index 96531a7e0a..f42f8b0324 100644 --- a/flytepropeller/pkg/controller/nodes/node_exec_context.go +++ b/flytepropeller/pkg/controller/nodes/node_exec_context.go @@ -5,12 +5,13 @@ import ( "fmt" "strconv" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -19,13 +20,8 @@ import ( nodeerrors "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/pkg/errors" - - "k8s.io/apimachinery/pkg/types" ) const NodeIDLabel = "node-id" diff --git a/flytepropeller/pkg/controller/nodes/node_exec_context_test.go b/flytepropeller/pkg/controller/nodes/node_exec_context_test.go index d96942c632..e64abb4c99 100644 --- a/flytepropeller/pkg/controller/nodes/node_exec_context_test.go +++ b/flytepropeller/pkg/controller/nodes/node_exec_context_test.go @@ -6,10 +6,12 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -17,14 +19,9 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) type TaskReader struct{} diff --git a/flytepropeller/pkg/controller/nodes/node_state_manager.go b/flytepropeller/pkg/controller/nodes/node_state_manager.go index 589a3c3a8e..91cf1f2679 100644 --- a/flytepropeller/pkg/controller/nodes/node_state_manager.go +++ b/flytepropeller/pkg/controller/nodes/node_state_manager.go @@ -4,7 +4,6 @@ import ( "context" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" ) diff --git a/flytepropeller/pkg/controller/nodes/output_resolver.go b/flytepropeller/pkg/controller/nodes/output_resolver.go index 4a771c3172..91e5a0975e 100644 --- a/flytepropeller/pkg/controller/nodes/output_resolver.go +++ b/flytepropeller/pkg/controller/nodes/output_resolver.go @@ -4,15 +4,12 @@ import ( "context" "reflect" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type VarName = string diff --git a/flytepropeller/pkg/controller/nodes/output_resolver_test.go b/flytepropeller/pkg/controller/nodes/output_resolver_test.go index 692406c724..89840ae371 100644 --- a/flytepropeller/pkg/controller/nodes/output_resolver_test.go +++ b/flytepropeller/pkg/controller/nodes/output_resolver_test.go @@ -3,9 +3,10 @@ package nodes import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/stretchr/testify/assert" ) func TestCreateAliasMap(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/predicate.go b/flytepropeller/pkg/controller/nodes/predicate.go index 5ce24bf926..37fe482267 100644 --- a/flytepropeller/pkg/controller/nodes/predicate.go +++ b/flytepropeller/pkg/controller/nodes/predicate.go @@ -4,12 +4,12 @@ import ( "context" "time" - "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) // Special enum to indicate if the node under consideration is ready to be executed or should be skipped diff --git a/flytepropeller/pkg/controller/nodes/predicate_test.go b/flytepropeller/pkg/controller/nodes/predicate_test.go index 3498ccd2c9..379bbe51f9 100644 --- a/flytepropeller/pkg/controller/nodes/predicate_test.go +++ b/flytepropeller/pkg/controller/nodes/predicate_test.go @@ -5,9 +5,10 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" - "github.com/stretchr/testify/assert" ) func TestCanExecute(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/resolve_test.go b/flytepropeller/pkg/controller/nodes/resolve_test.go index 9734f0fdee..19a8be1e7d 100644 --- a/flytepropeller/pkg/controller/nodes/resolve_test.go +++ b/flytepropeller/pkg/controller/nodes/resolve_test.go @@ -4,20 +4,18 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - + "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" flyteassert "github.com/flyteorg/flyte/flytepropeller/pkg/utils/assert" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var testScope = promutils.NewScope("test") diff --git a/flytepropeller/pkg/controller/nodes/setup_context.go b/flytepropeller/pkg/controller/nodes/setup_context.go index c4fdab9897..fb0cafcbe2 100644 --- a/flytepropeller/pkg/controller/nodes/setup_context.go +++ b/flytepropeller/pkg/controller/nodes/setup_context.go @@ -3,10 +3,9 @@ package nodes import ( "context" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type setupContext struct { diff --git a/flytepropeller/pkg/controller/nodes/start/handler_test.go b/flytepropeller/pkg/controller/nodes/start/handler_test.go index 03260179f1..6f74b7ff54 100644 --- a/flytepropeller/pkg/controller/nodes/start/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/start/handler_test.go @@ -4,12 +4,11 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/handler.go b/flytepropeller/pkg/controller/nodes/subworkflow/handler.go index 09ecb83fc8..5f9f16d206 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/handler.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/handler.go @@ -3,21 +3,17 @@ package subworkflow import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) type workflowNodeHandler struct { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go index 58907b505d..6bf6781eac 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go @@ -6,29 +6,27 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - mocks5 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + mocks5 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type workflowNodeStateHolder struct { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go index 24c3933064..dd09c5d5d7 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan.go @@ -4,8 +4,10 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" @@ -14,12 +16,8 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) type launchPlanHandler struct { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go index e66e630fe3..0c552560a9 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin.go @@ -5,25 +5,20 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes/wrappers" + "golang.org/x/time/rate" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "k8s.io/client-go/util/workqueue" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - + evtErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytestdlib/cache" stdErr "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - evtErr "github.com/flyteorg/flyte/flytepropeller/events/errors" - - "github.com/golang/protobuf/ptypes/wrappers" - - "golang.org/x/time/rate" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "k8s.io/client-go/util/workqueue" ) var isRecovery = true diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go index fe072b1607..0af8d1eb16 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/admin_test.go @@ -6,19 +6,17 @@ import ( "time" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flytestdlib/cache" - mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/cache" + mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestAdminLaunchPlanExecutor_GetStatus(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go index 8e436cc17b..9330b0c865 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/errors_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/errors" ) func TestRemoteError(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go index 21dd6b7b3d..666d3b1797 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop.go @@ -4,10 +4,9 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go index b82ec0d81b..bf26ee0d60 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/noop_test.go @@ -4,8 +4,9 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestFailFastWorkflowLauncher(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go index a5c4fdfc83..2e042d72a4 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go @@ -6,29 +6,27 @@ import ( "reflect" "testing" - mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - + mocks4 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" + mocks3 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" recoveryMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/recovery/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/subworkflow/launchplan/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func createInmemoryStore(t testing.TB) *storage.DataStore { diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go index c79f559c5b..10e48358dd 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" @@ -13,7 +12,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go index d8fb93d247..f2391048af 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go @@ -5,14 +5,13 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" coreMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" execMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/util.go b/flytepropeller/pkg/controller/nodes/subworkflow/util.go index 831aa67bae..ae23439c97 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/util.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/util.go @@ -4,7 +4,6 @@ import ( "strconv" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" ) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go index 6f3010913a..f1df02deb6 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/util_test.go @@ -3,8 +3,9 @@ package subworkflow import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestGetChildWorkflowExecutionID(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/controller.go b/flytepropeller/pkg/controller/nodes/task/backoff/controller.go index 89faff559a..fb12872639 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/controller.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/controller.go @@ -5,13 +5,11 @@ import ( "fmt" "time" + "k8s.io/apimachinery/pkg/util/clock" "sigs.k8s.io/controller-runtime/pkg/client" stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "k8s.io/apimachinery/pkg/util/clock" ) // Controller is a name-spaced collection of back-off handlers diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/handler.go b/flytepropeller/pkg/controller/nodes/task/backoff/handler.go index 8decfa09eb..e6677e7c7a 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/handler.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/handler.go @@ -7,13 +7,14 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" - "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/clock" + + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go b/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go index a164348b46..98e084850a 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/handler_test.go @@ -8,17 +8,16 @@ import ( "testing" "time" - stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" - "github.com/stretchr/testify/assert" - - taskErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdlibErrors "github.com/flyteorg/flyte/flytestdlib/errors" v1 "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/clock" + + taskErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + stdAtomic "github.com/flyteorg/flyte/flytestdlib/atomic" + stdlibErrors "github.com/flyteorg/flyte/flytestdlib/errors" ) func TestComputeResourceAwareBackOffHandler_Handle(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go b/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go index 6a55011e60..13a8329bab 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/safe_resourcelist.go @@ -4,10 +4,9 @@ import ( "strings" "sync" - "k8s.io/apimachinery/pkg/util/sets" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/sets" ) // SyncResourceList is a thread-safe Map. It's meant to replace v1.ResourceList for concurrency-sensitive diff --git a/flytepropeller/pkg/controller/nodes/task/cache.go b/flytepropeller/pkg/controller/nodes/task/cache.go index 865d2b005d..2be27dd8d3 100644 --- a/flytepropeller/pkg/controller/nodes/task/cache.go +++ b/flytepropeller/pkg/controller/nodes/task/cache.go @@ -5,10 +5,8 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - errors2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flytepropeller/pkg/controller/nodes/task/config/config.go b/flytepropeller/pkg/controller/nodes/task/config/config.go index 26373219d4..6baccebc44 100644 --- a/flytepropeller/pkg/controller/nodes/task/config/config.go +++ b/flytepropeller/pkg/controller/nodes/task/config/config.go @@ -6,10 +6,10 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flytestdlib/logger" "k8s.io/apimachinery/pkg/util/sets" "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) //go:generate pflags Config diff --git a/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go b/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go index 3d8b608cc3..53e1755281 100644 --- a/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go +++ b/flytepropeller/pkg/controller/nodes/task/event_recorder_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/stretchr/testify/assert" + + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) func TestBufferedEventRecorder(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go b/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go index 6f93028d15..1bf2c5bb41 100644 --- a/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go +++ b/flytepropeller/pkg/controller/nodes/task/fakeplugins/next_phase_state_plugin.go @@ -5,10 +5,11 @@ import ( "fmt" "time" + "github.com/stretchr/testify/mock" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/stretchr/testify/mock" ) type NextPhaseState struct { diff --git a/flytepropeller/pkg/controller/nodes/task/future_file_reader.go b/flytepropeller/pkg/controller/nodes/task/future_file_reader.go index 5b2023155d..fa23986812 100644 --- a/flytepropeller/pkg/controller/nodes/task/future_file_reader.go +++ b/flytepropeller/pkg/controller/nodes/task/future_file_reader.go @@ -4,12 +4,11 @@ import ( "context" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" ) // TODO this file exists only until we need to support dynamic nodes instead of closure. diff --git a/flytepropeller/pkg/controller/nodes/task/handler.go b/flytepropeller/pkg/controller/nodes/task/handler.go index 936cf3fa9d..6a0f44d648 100644 --- a/flytepropeller/pkg/controller/nodes/task/handler.go +++ b/flytepropeller/pkg/controller/nodes/task/handler.go @@ -6,19 +6,19 @@ import ( "runtime/debug" "time" + "github.com/golang/protobuf/ptypes" + regErrors "github.com/pkg/errors" "k8s.io/client-go/kubernetes" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" pluginK8s "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" controllerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" @@ -31,16 +31,11 @@ import ( rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/secretmanager" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/golang/protobuf/ptypes" - - regErrors "github.com/pkg/errors" ) const pluginContextKey = contextutils.Key("plugin") diff --git a/flytepropeller/pkg/controller/nodes/task/handler_test.go b/flytepropeller/pkg/controller/nodes/task/handler_test.go index 70d8887a2e..0e778a5e48 100644 --- a/flytepropeller/pkg/controller/nodes/task/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/task/handler_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v1 "k8s.io/api/core/v1" @@ -19,7 +18,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginCatalogMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -29,7 +27,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" pluginK8s "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" pluginK8sMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s/mocks" - eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" @@ -43,7 +40,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/fakeplugins" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager" rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go b/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go index 9247a3e723..460f64bbc4 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/event_watcher_test.go @@ -5,7 +5,6 @@ import ( "time" "github.com/stretchr/testify/assert" - corev1 "k8s.io/api/core/v1" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go index 138444d4cb..e747c65785 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector.go @@ -7,14 +7,14 @@ import ( "sync" "time" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) const resourceLevelMonitorCycleDuration = 10 * time.Second diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go index aad8456fd0..2dcec03e16 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/plugin_collector_test.go @@ -6,13 +6,14 @@ import ( "strings" "testing" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/prometheus/client_golang/prometheus/testutil" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/cache" + + "github.com/flyteorg/flyte/flytestdlib/promutils" ) var pods = []interface{}{ diff --git a/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go b/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go index 9fef4557d7..8807236bff 100644 --- a/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go +++ b/flytepropeller/pkg/controller/nodes/task/k8s/task_exec_context_test.go @@ -3,9 +3,10 @@ package k8s import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/stretchr/testify/assert" ) func Test_newTaskExecutionMetadata(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go index acbb2e98e2..7b425e08f2 100644 --- a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go +++ b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store.go @@ -5,13 +5,12 @@ import ( "context" "encoding/json" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/pkg/errors" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type RemoteFileWorkflowStore struct { diff --git a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go index c8050de3e7..ac745247b4 100644 --- a/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go +++ b/flytepropeller/pkg/controller/nodes/task/remote_workflow_store_test.go @@ -4,20 +4,16 @@ import ( "context" "testing" - "k8s.io/apimachinery/pkg/api/resource" - "github.com/go-test/deep" - "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func createInmemoryStore(t testing.TB) *storage.DataStore { diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go index ba6d1df6f9..d616839b3c 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_client.go @@ -3,10 +3,10 @@ package resourcemanager import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" + "github.com/go-redis/redis" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/go-redis/redis" ) //go:generate mockery -name RedisClient -case=underscore diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go index 465c24b881..be1373e8a4 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager.go @@ -6,13 +6,14 @@ import ( "sync" "time" + "github.com/pkg/errors" + "github.com/prometheus/client_golang/prometheus" + "k8s.io/apimachinery/pkg/util/wait" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/pkg/errors" - "github.com/prometheus/client_golang/prometheus" - "k8s.io/apimachinery/pkg/util/wait" ) // This is the key that will point to the Redis Set. diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go index f0e3eb8cee..db4371cd67 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/redis_resourcemanager_test.go @@ -5,11 +5,12 @@ import ( "sync" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func createMockNamespacedResourcesMap(mScope promutils.Scope) map[core.ResourceNamespace]*Resource { diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go index fa7ebd5b4b..1912b9324e 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager.go @@ -5,10 +5,8 @@ import ( "fmt" "sync" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go index c2ca5388cc..f508dd8f10 100644 --- a/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go +++ b/flytepropeller/pkg/controller/nodes/task/resourcemanager/resourcemanager_test.go @@ -4,13 +4,13 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" rmConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestComposeTokenPrefix(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go b/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go index 21dcd3c521..230017d7d3 100644 --- a/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go +++ b/flytepropeller/pkg/controller/nodes/task/secretmanager/secrets.go @@ -9,7 +9,6 @@ import ( "strings" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flytepropeller/pkg/controller/nodes/task/setup_ctx.go b/flytepropeller/pkg/controller/nodes/task/setup_ctx.go index 97790c0f98..ddbaba90a4 100644 --- a/flytepropeller/pkg/controller/nodes/task/setup_ctx.go +++ b/flytepropeller/pkg/controller/nodes/task/setup_ctx.go @@ -1,13 +1,11 @@ package task import ( - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "k8s.io/apimachinery/pkg/types" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "k8s.io/apimachinery/pkg/types" ) type setupContext struct { diff --git a/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go b/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go index bfb32ac8c9..3de204ecfb 100644 --- a/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go +++ b/flytepropeller/pkg/controller/nodes/task/setup_ctx_test.go @@ -3,10 +3,11 @@ package task import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) type dummySetupCtx struct { diff --git a/flytepropeller/pkg/controller/nodes/task/taskexec_context.go b/flytepropeller/pkg/controller/nodes/task/taskexec_context.go index 0d9a226cf1..8b819c79eb 100644 --- a/flytepropeller/pkg/controller/nodes/task/taskexec_context.go +++ b/flytepropeller/pkg/controller/nodes/task/taskexec_context.go @@ -6,6 +6,9 @@ import ( "strconv" "strings" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginCatalog "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -21,8 +24,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/utils" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" ) var ( diff --git a/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go b/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go index 22506e649e..a8cbc7d6d3 100644 --- a/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go +++ b/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go @@ -5,35 +5,30 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" flyteMocks "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" nodeMocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/codex" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/resourcemanager" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/secretmanager" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestHandler_newTaskExecutionContext(t *testing.T) { diff --git a/flytepropeller/pkg/controller/nodes/task/transformer_test.go b/flytepropeller/pkg/controller/nodes/task/transformer_test.go index 1c58bdf561..a26705baee 100644 --- a/flytepropeller/pkg/controller/nodes/task/transformer_test.go +++ b/flytepropeller/pkg/controller/nodes/task/transformer_test.go @@ -4,27 +4,23 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/ptypes" structpb "github.com/golang/protobuf/ptypes/struct" "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" nodemocks "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const containerTaskType = "container" diff --git a/flytepropeller/pkg/controller/nodes/task_reader.go b/flytepropeller/pkg/controller/nodes/task_reader.go index 588f861984..5cc5654f63 100644 --- a/flytepropeller/pkg/controller/nodes/task_reader.go +++ b/flytepropeller/pkg/controller/nodes/task_reader.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) diff --git a/flytepropeller/pkg/controller/nodes/transformers.go b/flytepropeller/pkg/controller/nodes/transformers.go index 047cb03b68..8c0db1e57a 100644 --- a/flytepropeller/pkg/controller/nodes/transformers.go +++ b/flytepropeller/pkg/controller/nodes/transformers.go @@ -6,21 +6,18 @@ import ( "strconv" "time" + "github.com/golang/protobuf/ptypes" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/golang/protobuf/ptypes" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // This is used by flyteadmin to indicate that the events will now contain populated IsParent and IsDynamic bits. diff --git a/flytepropeller/pkg/controller/nodes/transformers_test.go b/flytepropeller/pkg/controller/nodes/transformers_test.go index 823096b68d..f1d5202401 100644 --- a/flytepropeller/pkg/controller/nodes/transformers_test.go +++ b/flytepropeller/pkg/controller/nodes/transformers_test.go @@ -3,19 +3,18 @@ package nodes import ( "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1/mocks" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" mocks2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors/mocks" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/handler" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestToNodeExecutionEvent(t *testing.T) { diff --git a/flytepropeller/pkg/controller/workers.go b/flytepropeller/pkg/controller/workers.go index 9b3f8555d3..c21da019c8 100644 --- a/flytepropeller/pkg/controller/workers.go +++ b/flytepropeller/pkg/controller/workers.go @@ -6,12 +6,13 @@ import ( "runtime/pprof" "time" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/prometheus/client_golang/prometheus" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/cache" + + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type Handler interface { diff --git a/flytepropeller/pkg/controller/workers_test.go b/flytepropeller/pkg/controller/workers_test.go index c3c271e7a0..3ada76ade2 100644 --- a/flytepropeller/pkg/controller/workers_test.go +++ b/flytepropeller/pkg/controller/workers_test.go @@ -5,10 +5,10 @@ import ( "sync" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) var testLocalScope2 = promutils.NewScope("worker_pool") diff --git a/flytepropeller/pkg/controller/workflow/executor.go b/flytepropeller/pkg/controller/workflow/executor.go index 5e06f333f9..13957606d1 100644 --- a/flytepropeller/pkg/controller/workflow/executor.go +++ b/flytepropeller/pkg/controller/workflow/executor.go @@ -5,9 +5,11 @@ import ( "fmt" "time" + corev1 "k8s.io/api/core/v1" + "k8s.io/client-go/tools/record" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" - "github.com/flyteorg/flyte/flytepropeller/events" eventsErr "github.com/flyteorg/flyte/flytepropeller/events/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -16,14 +18,10 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces" "github.com/flyteorg/flyte/flytepropeller/pkg/controller/workflow/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - corev1 "k8s.io/api/core/v1" - "k8s.io/client-go/tools/record" ) type workflowMetrics struct { diff --git a/flytepropeller/pkg/controller/workflowstore/inmemory.go b/flytepropeller/pkg/controller/workflowstore/inmemory.go index e376de8f1a..6f2c294782 100644 --- a/flytepropeller/pkg/controller/workflowstore/inmemory.go +++ b/flytepropeller/pkg/controller/workflowstore/inmemory.go @@ -4,8 +4,9 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" kubeerrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) type InmemoryWorkflowStore struct { diff --git a/flytepropeller/pkg/controller/workflowstore/passthrough.go b/flytepropeller/pkg/controller/workflowstore/passthrough.go index 2d92b8249f..ab10482b78 100644 --- a/flytepropeller/pkg/controller/workflowstore/passthrough.go +++ b/flytepropeller/pkg/controller/workflowstore/passthrough.go @@ -4,6 +4,8 @@ import ( "context" "time" + "github.com/prometheus/client_golang/prometheus" + kubeerrors "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" @@ -11,9 +13,6 @@ import ( listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/prometheus/client_golang/prometheus" - - kubeerrors "k8s.io/apimachinery/pkg/api/errors" ) type workflowstoreMetrics struct { diff --git a/flytepropeller/pkg/controller/workflowstore/passthrough_test.go b/flytepropeller/pkg/controller/workflowstore/passthrough_test.go index 322f1d21cd..3ddbb45ed6 100644 --- a/flytepropeller/pkg/controller/workflowstore/passthrough_test.go +++ b/flytepropeller/pkg/controller/workflowstore/passthrough_test.go @@ -5,17 +5,15 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/stretchr/testify/assert" + kubeerrors "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/fake" - - kubeerrors "k8s.io/apimachinery/pkg/api/errors" + listers "github.com/flyteorg/flyte/flytepropeller/pkg/client/listers/flyteworkflow/v1alpha1" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) type mockWFNamespaceLister struct { diff --git a/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go b/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go index c216b7a9d1..7f2f850f22 100644 --- a/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go +++ b/flytepropeller/pkg/controller/workflowstore/resource_version_caching.go @@ -6,7 +6,6 @@ import ( "sync" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) diff --git a/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go b/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go index 8d9b2d6a84..8537e2209b 100644 --- a/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go +++ b/flytepropeller/pkg/controller/workflowstore/resource_version_caching_test.go @@ -5,22 +5,19 @@ import ( "fmt" "testing" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - + goObjectHash "github.com/benlaurie/objecthash/go/objecthash" + "github.com/stretchr/testify/assert" + kubeerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" - + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" testing2 "k8s.io/client-go/testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - goObjectHash "github.com/benlaurie/objecthash/go/objecthash" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/fake" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - kubeerrors "k8s.io/apimachinery/pkg/api/errors" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) const ( diff --git a/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go b/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go index 2bf0be51da..eaab16b327 100644 --- a/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go +++ b/flytepropeller/pkg/controller/workflowstore/terminated_tracking.go @@ -6,7 +6,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytestdlib/fastcheck" - "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go b/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go index d17d394f8a..d57cfcc43d 100644 --- a/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go +++ b/flytepropeller/pkg/controller/workflowstore/terminated_tracking_test.go @@ -4,12 +4,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/fake" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) const ( diff --git a/flytepropeller/pkg/controller/workqueue.go b/flytepropeller/pkg/controller/workqueue.go index 3209c632f6..1d10cb5f2a 100644 --- a/flytepropeller/pkg/controller/workqueue.go +++ b/flytepropeller/pkg/controller/workqueue.go @@ -3,14 +3,12 @@ package controller import ( "context" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "golang.org/x/time/rate" + "k8s.io/client-go/util/workqueue" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/logger" - // Setup workqueue metrics - _ "github.com/flyteorg/flyte/flytestdlib/promutils" - "k8s.io/client-go/util/workqueue" + _ "github.com/flyteorg/flyte/flytestdlib/promutils" // Setup workqueue metrics ) func NewWorkQueue(ctx context.Context, cfg config.WorkqueueConfig, name string) (workqueue.RateLimitingInterface, error) { diff --git a/flytepropeller/pkg/controller/workqueue_test.go b/flytepropeller/pkg/controller/workqueue_test.go index 74a8108014..e73ee8eb50 100644 --- a/flytepropeller/pkg/controller/workqueue_test.go +++ b/flytepropeller/pkg/controller/workqueue_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" - config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/stretchr/testify/assert" + config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/stretchr/testify/assert" ) func TestNewWorkQueue(t *testing.T) { diff --git a/flytepropeller/pkg/leaderelection/leader_election.go b/flytepropeller/pkg/leaderelection/leader_election.go index cbd895d036..a3d28a944b 100644 --- a/flytepropeller/pkg/leaderelection/leader_election.go +++ b/flytepropeller/pkg/leaderelection/leader_election.go @@ -5,16 +5,14 @@ import ( "fmt" "os" - v12 "k8s.io/client-go/kubernetes/typed/coordination/v1" - - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "k8s.io/apimachinery/pkg/util/rand" - + v12 "k8s.io/client-go/kubernetes/typed/coordination/v1" v1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/record" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" ) const ( diff --git a/flytepropeller/pkg/utils/assert/literals.go b/flytepropeller/pkg/utils/assert/literals.go index c0a8ca497f..66f57c328e 100644 --- a/flytepropeller/pkg/utils/assert/literals.go +++ b/flytepropeller/pkg/utils/assert/literals.go @@ -4,8 +4,9 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func EqualPrimitive(t *testing.T, p1 *core.Primitive, p2 *core.Primitive) { diff --git a/flytepropeller/pkg/utils/failing_datastore_test.go b/flytepropeller/pkg/utils/failing_datastore_test.go index 820ab8b84b..cb28e153a3 100644 --- a/flytepropeller/pkg/utils/failing_datastore_test.go +++ b/flytepropeller/pkg/utils/failing_datastore_test.go @@ -5,8 +5,9 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestFailingRawStore(t *testing.T) { diff --git a/flytepropeller/pkg/utils/k8s.go b/flytepropeller/pkg/utils/k8s.go index a56ef84ab5..f666fd9013 100644 --- a/flytepropeller/pkg/utils/k8s.go +++ b/flytepropeller/pkg/utils/k8s.go @@ -7,11 +7,6 @@ import ( "regexp" "strings" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" - flyteScheme "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/scheme" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/timestamp" "github.com/pkg/errors" @@ -24,6 +19,12 @@ import ( restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/record" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + flyteScheme "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned/scheme" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) var NotTheOwnerError = errors.Errorf("FlytePropeller is not the owner") diff --git a/flytepropeller/pkg/utils/k8s_test.go b/flytepropeller/pkg/utils/k8s_test.go index 0ea0d8e654..47cc5c6e68 100644 --- a/flytepropeller/pkg/utils/k8s_test.go +++ b/flytepropeller/pkg/utils/k8s_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) diff --git a/flytepropeller/pkg/visualize/sort.go b/flytepropeller/pkg/visualize/sort.go index 7dbe96df50..2d2d24e4e4 100644 --- a/flytepropeller/pkg/visualize/sort.go +++ b/flytepropeller/pkg/visualize/sort.go @@ -1,8 +1,9 @@ package visualize import ( - "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/pkg/errors" + + "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) type VisitStatus int8 diff --git a/flytepropeller/pkg/visualize/visualize.go b/flytepropeller/pkg/visualize/visualize.go index 911cfb7944..6a5ee7ba11 100644 --- a/flytepropeller/pkg/visualize/visualize.go +++ b/flytepropeller/pkg/visualize/visualize.go @@ -5,10 +5,11 @@ import ( "reflect" "strings" + "k8s.io/apimachinery/pkg/util/sets" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" - "k8s.io/apimachinery/pkg/util/sets" ) const executionEdgeLabel = "execution" diff --git a/flytepropeller/pkg/webhook/aws_secret_manager.go b/flytepropeller/pkg/webhook/aws_secret_manager.go index 696a02f8ab..d1595ffc1e 100644 --- a/flytepropeller/pkg/webhook/aws_secret_manager.go +++ b/flytepropeller/pkg/webhook/aws_secret_manager.go @@ -7,10 +7,11 @@ import ( "path/filepath" "strings" + corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/aws_secret_manager_test.go b/flytepropeller/pkg/webhook/aws_secret_manager_test.go index 9596efb664..d2a74de80b 100644 --- a/flytepropeller/pkg/webhook/aws_secret_manager_test.go +++ b/flytepropeller/pkg/webhook/aws_secret_manager_test.go @@ -4,13 +4,12 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) func TestAWSSecretManagerInjector_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/config/config.go b/flytepropeller/pkg/webhook/config/config.go index 9bf5b57323..4c640bde9e 100644 --- a/flytepropeller/pkg/webhook/config/config.go +++ b/flytepropeller/pkg/webhook/config/config.go @@ -1,9 +1,10 @@ package config import ( - "github.com/flyteorg/flyte/flytestdlib/config" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate enumer --type=SecretManagerType --trimprefix=SecretManagerType -json -yaml diff --git a/flytepropeller/pkg/webhook/entrypoint.go b/flytepropeller/pkg/webhook/entrypoint.go index de8f9ab820..466cbbde33 100644 --- a/flytepropeller/pkg/webhook/entrypoint.go +++ b/flytepropeller/pkg/webhook/entrypoint.go @@ -7,15 +7,16 @@ import ( "fmt" "os" + "k8s.io/apimachinery/pkg/api/errors" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "sigs.k8s.io/controller-runtime/pkg/manager" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" "github.com/flyteorg/flyte/flytepropeller/pkg/utils" config2 "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "k8s.io/apimachinery/pkg/api/errors" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" - "sigs.k8s.io/controller-runtime/pkg/manager" ) const ( diff --git a/flytepropeller/pkg/webhook/gcp_secret_manager.go b/flytepropeller/pkg/webhook/gcp_secret_manager.go index 75226a1f9a..c69705594e 100644 --- a/flytepropeller/pkg/webhook/gcp_secret_manager.go +++ b/flytepropeller/pkg/webhook/gcp_secret_manager.go @@ -7,10 +7,11 @@ import ( "path/filepath" "strings" + corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/gcp_secret_manager_test.go b/flytepropeller/pkg/webhook/gcp_secret_manager_test.go index fb66006523..7095614d24 100644 --- a/flytepropeller/pkg/webhook/gcp_secret_manager_test.go +++ b/flytepropeller/pkg/webhook/gcp_secret_manager_test.go @@ -4,13 +4,12 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) func TestGCPSecretManagerInjector_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/global_secrets.go b/flytepropeller/pkg/webhook/global_secrets.go index 989bb77d9c..a4b3543fb1 100644 --- a/flytepropeller/pkg/webhook/global_secrets.go +++ b/flytepropeller/pkg/webhook/global_secrets.go @@ -5,11 +5,11 @@ import ( "fmt" "strings" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + corev1 "k8s.io/api/core/v1" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) //go:generate mockery -all -case=underscore diff --git a/flytepropeller/pkg/webhook/global_secrets_test.go b/flytepropeller/pkg/webhook/global_secrets_test.go index f8e8b591b3..c8df41b50f 100644 --- a/flytepropeller/pkg/webhook/global_secrets_test.go +++ b/flytepropeller/pkg/webhook/global_secrets_test.go @@ -5,16 +5,14 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - "github.com/stretchr/testify/assert" - "github.com/go-test/deep" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" - "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" ) func TestGlobalSecrets_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/init_cert.go b/flytepropeller/pkg/webhook/init_cert.go index ba9c2c7f64..61b86dd66a 100644 --- a/flytepropeller/pkg/webhook/init_cert.go +++ b/flytepropeller/pkg/webhook/init_cert.go @@ -14,14 +14,15 @@ import ( "path" "time" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" - "github.com/flyteorg/flyte/flytepropeller/pkg/utils" - webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/flyteorg/flyte/flytestdlib/logger" corev1 "k8s.io/api/core/v1" kubeErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytepropeller/pkg/utils" + webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type webhookCerts struct { diff --git a/flytepropeller/pkg/webhook/k8s_secrets.go b/flytepropeller/pkg/webhook/k8s_secrets.go index 70ab77354c..102d1ae6c1 100644 --- a/flytepropeller/pkg/webhook/k8s_secrets.go +++ b/flytepropeller/pkg/webhook/k8s_secrets.go @@ -6,11 +6,11 @@ import ( "os" "path/filepath" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + corev1 "k8s.io/api/core/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/k8s_secrets_test.go b/flytepropeller/pkg/webhook/k8s_secrets_test.go index 3b422fc911..ac8cdf0649 100644 --- a/flytepropeller/pkg/webhook/k8s_secrets_test.go +++ b/flytepropeller/pkg/webhook/k8s_secrets_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/go-test/deep" + corev1 "k8s.io/api/core/v1" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - corev1 "k8s.io/api/core/v1" ) func TestK8sSecretInjector_Inject(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/pod.go b/flytepropeller/pkg/webhook/pod.go index 412bb24ff3..556b6053d9 100644 --- a/flytepropeller/pkg/webhook/pod.go +++ b/flytepropeller/pkg/webhook/pod.go @@ -36,21 +36,19 @@ import ( "path/filepath" "strings" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const webhookName = "flyte-pod-webhook.flyte.org" diff --git a/flytepropeller/pkg/webhook/pod_test.go b/flytepropeller/pkg/webhook/pod_test.go index 3c334a75cc..08a4284728 100644 --- a/flytepropeller/pkg/webhook/pod_test.go +++ b/flytepropeller/pkg/webhook/pod_test.go @@ -5,21 +5,17 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - "k8s.io/client-go/tools/clientcmd/api/latest" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + admissionv1 "k8s.io/api/admission/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/tools/clientcmd/api/latest" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - "github.com/flyteorg/flyte/flytestdlib/promutils" - + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" - "github.com/stretchr/testify/mock" - - "github.com/stretchr/testify/assert" - admissionv1 "k8s.io/api/admission/v1" - corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestPodMutator_Mutate(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/secrets.go b/flytepropeller/pkg/webhook/secrets.go index 812290dd30..02557ebd37 100644 --- a/flytepropeller/pkg/webhook/secrets.go +++ b/flytepropeller/pkg/webhook/secrets.go @@ -3,17 +3,14 @@ package webhook import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + corev1 "k8s.io/api/core/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" secretUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" - "github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/secretmanager" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - corev1 "k8s.io/api/core/v1" ) const ( diff --git a/flytepropeller/pkg/webhook/secrets_test.go b/flytepropeller/pkg/webhook/secrets_test.go index 7deb7beb5f..a0bdb9846b 100644 --- a/flytepropeller/pkg/webhook/secrets_test.go +++ b/flytepropeller/pkg/webhook/secrets_test.go @@ -5,16 +5,13 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/mocks" ) func TestSecretsWebhook_Mutate(t *testing.T) { diff --git a/flytepropeller/pkg/webhook/utils.go b/flytepropeller/pkg/webhook/utils.go index 7d7e7e3673..92a4995c24 100644 --- a/flytepropeller/pkg/webhook/utils.go +++ b/flytepropeller/pkg/webhook/utils.go @@ -5,13 +5,12 @@ import ( "path/filepath" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/uuid" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) func hasEnvVar(envVars []corev1.EnvVar, envVarKey string) bool { diff --git a/flytepropeller/pkg/webhook/utils_test.go b/flytepropeller/pkg/webhook/utils_test.go index 15079ca8fb..ed4669e7e5 100644 --- a/flytepropeller/pkg/webhook/utils_test.go +++ b/flytepropeller/pkg/webhook/utils_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/go-test/deep" - corev1 "k8s.io/api/core/v1" ) diff --git a/flytepropeller/pkg/webhook/vault_secret_manager.go b/flytepropeller/pkg/webhook/vault_secret_manager.go index d149cd4e6f..658e3970d1 100644 --- a/flytepropeller/pkg/webhook/vault_secret_manager.go +++ b/flytepropeller/pkg/webhook/vault_secret_manager.go @@ -6,11 +6,12 @@ import ( "os" "path/filepath" + corev1 "k8s.io/api/core/v1" + coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/flyteorg/flyte/flytestdlib/logger" - corev1 "k8s.io/api/core/v1" ) var ( diff --git a/flytepropeller/pkg/webhook/vault_secret_manager_test.go b/flytepropeller/pkg/webhook/vault_secret_manager_test.go index 19941a431f..cd7803d27d 100644 --- a/flytepropeller/pkg/webhook/vault_secret_manager_test.go +++ b/flytepropeller/pkg/webhook/vault_secret_manager_test.go @@ -5,11 +5,12 @@ import ( "fmt" "testing" - coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" "github.com/go-test/deep" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" ) var ( From 497e1949cb53db15805a908c2a9bbd46ab68d6d0 Mon Sep 17 00:00:00 2001 From: Andrew Dye Date: Mon, 16 Oct 2023 10:17:16 -0700 Subject: [PATCH 07/15] Format go imports (flyteadmin) (#4227) 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 | 6 ++--- .../authzserver/metadata_provider_test.go | 3 +-- 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, 1018 insertions(+), 1147 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 87db579e6e..61802964c6 100644 --- a/flyteadmin/auth/authzserver/metadata_provider.go +++ b/flyteadmin/auth/authzserver/metadata_provider.go @@ -13,13 +13,11 @@ import ( "google.golang.org/grpc/codes" "github.com/flyteorg/flyte/flyteadmin/auth" + authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" "github.com/flyteorg/flyte/flyteadmin/pkg/async" flyteErrors "github.com/flyteorg/flyte/flyteadmin/pkg/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type OAuth2MetadataProvider struct { diff --git a/flyteadmin/auth/authzserver/metadata_provider_test.go b/flyteadmin/auth/authzserver/metadata_provider_test.go index 6e36b6734c..1ed8b0b56a 100644 --- a/flyteadmin/auth/authzserver/metadata_provider_test.go +++ b/flyteadmin/auth/authzserver/metadata_provider_test.go @@ -8,13 +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" + config2 "github.com/flyteorg/flyte/flytestdlib/config" ) var oauthMetadataFailureErrorMessage = "Failed to get oauth metadata" 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 = "