From 9edec591a99aed72f3de6a785ed290498da58fb6 Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Fri, 6 Oct 2023 13:01:19 -0700 Subject: [PATCH 1/4] wowzas Signed-off-by: Katrina Rogan --- .../flyte/golang_support_tools/tools.go | 2 +- cmd/compile/compile.go | 8 +- cmd/config/config.go | 2 +- .../clusterresourceattribute/file_config.go | 2 +- .../file_config_test.go | 2 +- cmd/config/subcommand/config/console_flags.go | 2 +- .../executionclusterlabel/file_config.go | 2 +- .../executionclusterlabel/file_config_test.go | 2 +- .../executionqueueattribute/file_config.go | 2 +- .../file_config_test.go | 2 +- .../matchable_attribute_decorator.go | 2 +- .../subcommand/plugin_override/file_config.go | 2 +- .../plugin_override/file_config_test.go | 2 +- .../subcommand/project/project_config.go | 2 +- .../subcommand/project/project_config_test.go | 2 +- .../subcommand/register/files_config.go | 2 +- .../taskresourceattribute/file_config.go | 2 +- .../taskresourceattribute/file_config_test.go | 2 +- .../workflowexecutionconfig/file_config.go | 2 +- .../file_config_test.go | 2 +- cmd/configuration/configuration.go | 2 +- cmd/configuration/configuration_test.go | 2 +- cmd/core/cmd.go | 2 +- cmd/core/cmd_ctx.go | 4 +- cmd/core/cmd_test.go | 4 +- cmd/create/execution.go | 4 +- cmd/create/execution_test.go | 4 +- cmd/create/execution_util.go | 6 +- cmd/create/execution_util_test.go | 4 +- cmd/create/project.go | 4 +- cmd/create/project_test.go | 2 +- cmd/create/serialization_utils.go | 4 +- cmd/create/serialization_utils_test.go | 2 +- cmd/delete/execution.go | 6 +- cmd/delete/execution_test.go | 4 +- cmd/delete/matchable_attribute_util.go | 2 +- .../matchable_cluster_resource_attribute.go | 2 +- ...tchable_cluster_resource_attribute_test.go | 2 +- .../matchable_execution_cluster_label.go | 2 +- .../matchable_execution_cluster_label_test.go | 2 +- .../matchable_execution_queue_attribute.go | 2 +- ...atchable_execution_queue_attribute_test.go | 2 +- cmd/delete/matchable_plugin_override.go | 2 +- cmd/delete/matchable_plugin_override_test.go | 2 +- .../matchable_task_resource_attribute.go | 2 +- .../matchable_task_resource_attribute_test.go | 2 +- .../matchable_workflow_execution_config.go | 2 +- ...atchable_workflow_execution_config_test.go | 2 +- cmd/demo/exec_test.go | 2 +- cmd/demo/reload.go | 2 +- cmd/get/execution.go | 4 +- cmd/get/execution_test.go | 4 +- cmd/get/execution_util.go | 6 +- cmd/get/execution_util_test.go | 4 +- cmd/get/launch_plan.go | 4 +- cmd/get/launch_plan_test.go | 4 +- cmd/get/matchable_attribute_util.go | 2 +- .../matchable_cluster_resource_attribute.go | 2 +- ...tchable_cluster_resource_attribute_test.go | 2 +- cmd/get/matchable_execution_cluster_label.go | 2 +- .../matchable_execution_cluster_label_test.go | 2 +- .../matchable_execution_queue_attribute.go | 2 +- ...atchable_execution_queue_attribute_test.go | 2 +- cmd/get/matchable_plugin_override.go | 2 +- cmd/get/matchable_plugin_override_test.go | 2 +- cmd/get/matchable_task_resource_attribute.go | 2 +- .../matchable_task_resource_attribute_test.go | 2 +- .../matchable_workflow_execution_config.go | 4 +- ...atchable_workflow_execution_config_test.go | 2 +- cmd/get/node_execution.go | 6 +- cmd/get/node_execution_test.go | 6 +- cmd/get/project.go | 4 +- cmd/get/project_test.go | 2 +- cmd/get/task.go | 4 +- cmd/get/task_test.go | 4 +- cmd/get/workflow.go | 4 +- cmd/get/workflow_test.go | 4 +- cmd/register/examples.go | 2 +- cmd/register/files.go | 4 +- cmd/register/files_test.go | 12 +- cmd/register/register_util.go | 20 +- cmd/register/register_util_test.go | 18 +- cmd/root.go | 4 +- cmd/sandbox/exec_test.go | 2 +- cmd/testutils/test_utils.go | 4 +- cmd/update/execution.go | 6 +- cmd/update/execution_test.go | 2 +- cmd/update/interfaces/mocks/updater.go | 2 +- cmd/update/interfaces/updater.go | 2 +- cmd/update/launch_plan.go | 6 +- cmd/update/launch_plan_meta.go | 2 +- cmd/update/launch_plan_meta_test.go | 2 +- cmd/update/launch_plan_test.go | 2 +- cmd/update/named_entity.go | 6 +- cmd/update/named_entity_test.go | 4 +- cmd/update/project.go | 2 +- cmd/update/project_test.go | 2 +- cmd/update/task_meta.go | 2 +- cmd/update/task_meta_test.go | 2 +- cmd/update/workflow_meta.go | 2 +- cmd/update/workflow_meta_test.go | 2 +- cmd/upgrade/upgrade.go | 4 +- cmd/upgrade/upgrade_test.go | 2 +- cmd/version/version.go | 6 +- cmd/version/version_test.go | 8 +- go.mod | 109 ++- go.sum | 783 +++--------------- main.go | 2 +- pkg/adminutils/config.go | 2 +- pkg/ext/attribute_match_deleter_test.go | 4 +- pkg/ext/attribute_match_fetcher.go | 2 +- pkg/ext/attribute_match_fetcher_test.go | 4 +- pkg/ext/attribute_match_updater.go | 2 +- pkg/ext/attribute_match_updater_test.go | 4 +- pkg/ext/attribute_matcher_deleter.go | 2 +- pkg/ext/deleter.go | 4 +- pkg/ext/deleter_test.go | 2 +- pkg/ext/execution_fetcher.go | 4 +- pkg/ext/execution_fetcher_test.go | 6 +- pkg/ext/fetcher.go | 4 +- pkg/ext/fetcher_test.go | 2 +- pkg/ext/launch_plan_fetcher.go | 4 +- pkg/ext/launch_plan_fetcher_test.go | 6 +- pkg/ext/mocks/admin_deleter_ext_interface.go | 4 +- pkg/ext/mocks/admin_fetcher_ext_interface.go | 4 +- .../admin_service_fetcher_ext_interface.go | 4 +- pkg/ext/mocks/admin_updater_ext_interface.go | 4 +- pkg/ext/project_fetcher.go | 2 +- pkg/ext/project_fetcher_test.go | 4 +- pkg/ext/task_fetcher.go | 4 +- pkg/ext/task_fetcher_test.go | 6 +- pkg/ext/updater.go | 4 +- pkg/ext/updater_test.go | 2 +- pkg/ext/workflow_fetcher.go | 4 +- pkg/ext/workflow_fetcher_test.go | 6 +- pkg/filters/util.go | 4 +- pkg/filters/util_test.go | 2 +- pkg/github/githubutil.go | 4 +- pkg/github/githubutil_test.go | 2 +- pkg/printer/printer.go | 6 +- pkg/printer/printer_test.go | 4 +- pkg/sandbox/start.go | 2 +- pkg/visualize/graphviz.go | 4 +- pkg/visualize/graphviz_test.go | 2 +- 144 files changed, 437 insertions(+), 937 deletions(-) diff --git a/boilerplate/flyte/golang_support_tools/tools.go b/boilerplate/flyte/golang_support_tools/tools.go index 43de0345..a78b6116 100644 --- a/boilerplate/flyte/golang_support_tools/tools.go +++ b/boilerplate/flyte/golang_support_tools/tools.go @@ -6,7 +6,7 @@ package tools import ( _ "github.com/EngHabu/mockery/cmd/mockery" _ "github.com/alvaroloes/enumer" - _ "github.com/flyteorg/flytestdlib/cli/pflags" + _ "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" ) diff --git a/cmd/compile/compile.go b/cmd/compile/compile.go index f8f6957b..f3f6753c 100644 --- a/cmd/compile/compile.go +++ b/cmd/compile/compile.go @@ -9,10 +9,10 @@ import ( config "github.com/flyteorg/flytectl/cmd/config/subcommand/compile" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/cmd/register" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flytepropeller/pkg/compiler" - "github.com/flyteorg/flytepropeller/pkg/compiler/common" + "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" ) // Utility function for compiling a list of Tasks diff --git a/cmd/config/config.go b/cmd/config/config.go index 0283313f..8bf5cc98 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/flyteorg/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flytectl/pkg/printer" ) diff --git a/cmd/config/subcommand/clusterresourceattribute/file_config.go b/cmd/config/subcommand/clusterresourceattribute/file_config.go index 5bfece37..1e954398 100644 --- a/cmd/config/subcommand/clusterresourceattribute/file_config.go +++ b/cmd/config/subcommand/clusterresourceattribute/file_config.go @@ -1,7 +1,7 @@ package clusterresourceattribute import ( - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // AttrFileConfig shadow Config for ClusterResourceAttributes. diff --git a/cmd/config/subcommand/clusterresourceattribute/file_config_test.go b/cmd/config/subcommand/clusterresourceattribute/file_config_test.go index f9510c7d..92b791cf 100644 --- a/cmd/config/subcommand/clusterresourceattribute/file_config_test.go +++ b/cmd/config/subcommand/clusterresourceattribute/file_config_test.go @@ -3,7 +3,7 @@ package clusterresourceattribute import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/config/subcommand/config/console_flags.go b/cmd/config/subcommand/config/console_flags.go index f980b3ce..168aca95 100644 --- a/cmd/config/subcommand/config/console_flags.go +++ b/cmd/config/subcommand/config/console_flags.go @@ -1,6 +1,6 @@ package config -import "github.com/flyteorg/flytestdlib/config" +import "github.com/flyteorg/flyte/flytestdlib/config" //go:generate pflags ConsoleConfig --default-var DefaultConsoleConfig --bind-default-var diff --git a/cmd/config/subcommand/executionclusterlabel/file_config.go b/cmd/config/subcommand/executionclusterlabel/file_config.go index c05c6ca1..39dfc2b5 100644 --- a/cmd/config/subcommand/executionclusterlabel/file_config.go +++ b/cmd/config/subcommand/executionclusterlabel/file_config.go @@ -1,7 +1,7 @@ package executionclusterlabel import ( - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // FileConfig shadow Config for ExecutionClusterLabel. diff --git a/cmd/config/subcommand/executionclusterlabel/file_config_test.go b/cmd/config/subcommand/executionclusterlabel/file_config_test.go index 662f6658..79ea0599 100644 --- a/cmd/config/subcommand/executionclusterlabel/file_config_test.go +++ b/cmd/config/subcommand/executionclusterlabel/file_config_test.go @@ -3,7 +3,7 @@ package executionclusterlabel import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/config/subcommand/executionqueueattribute/file_config.go b/cmd/config/subcommand/executionqueueattribute/file_config.go index 1726f0b6..cd538da6 100644 --- a/cmd/config/subcommand/executionqueueattribute/file_config.go +++ b/cmd/config/subcommand/executionqueueattribute/file_config.go @@ -1,7 +1,7 @@ package executionqueueattribute import ( - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // AttrFileConfig shadow Config for ExecutionQueueAttributes. diff --git a/cmd/config/subcommand/executionqueueattribute/file_config_test.go b/cmd/config/subcommand/executionqueueattribute/file_config_test.go index 8148d8b7..191cabb0 100644 --- a/cmd/config/subcommand/executionqueueattribute/file_config_test.go +++ b/cmd/config/subcommand/executionqueueattribute/file_config_test.go @@ -3,7 +3,7 @@ package executionqueueattribute import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/config/subcommand/matchable_attribute_decorator.go b/cmd/config/subcommand/matchable_attribute_decorator.go index 728be858..9e6aadfa 100644 --- a/cmd/config/subcommand/matchable_attribute_decorator.go +++ b/cmd/config/subcommand/matchable_attribute_decorator.go @@ -1,6 +1,6 @@ package subcommand -import "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" +import "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" // MatchableAttributeDecorator defines a decorator for any matchable attribute target. type MatchableAttributeDecorator interface { diff --git a/cmd/config/subcommand/plugin_override/file_config.go b/cmd/config/subcommand/plugin_override/file_config.go index af40066d..15349c83 100644 --- a/cmd/config/subcommand/plugin_override/file_config.go +++ b/cmd/config/subcommand/plugin_override/file_config.go @@ -1,7 +1,7 @@ package pluginoverride import ( - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // FileConfig shadow Config for PluginOverrides. diff --git a/cmd/config/subcommand/plugin_override/file_config_test.go b/cmd/config/subcommand/plugin_override/file_config_test.go index e2ecaa5d..13037945 100644 --- a/cmd/config/subcommand/plugin_override/file_config_test.go +++ b/cmd/config/subcommand/plugin_override/file_config_test.go @@ -3,7 +3,7 @@ package pluginoverride import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/config/subcommand/project/project_config.go b/cmd/config/subcommand/project/project_config.go index 96b9c643..38f13136 100644 --- a/cmd/config/subcommand/project/project_config.go +++ b/cmd/config/subcommand/project/project_config.go @@ -7,7 +7,7 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "gopkg.in/yaml.v3" ) diff --git a/cmd/config/subcommand/project/project_config_test.go b/cmd/config/subcommand/project/project_config_test.go index b02daa49..d66aff2c 100644 --- a/cmd/config/subcommand/project/project_config_test.go +++ b/cmd/config/subcommand/project/project_config_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/config/subcommand/register/files_config.go b/cmd/config/subcommand/register/files_config.go index 3a542034..c1441d05 100644 --- a/cmd/config/subcommand/register/files_config.go +++ b/cmd/config/subcommand/register/files_config.go @@ -1,6 +1,6 @@ package register -import "github.com/flyteorg/flytestdlib/config" +import "github.com/flyteorg/flyte/flytestdlib/config" //go:generate pflags FilesConfig --default-var DefaultFilesConfig --bind-default-var diff --git a/cmd/config/subcommand/taskresourceattribute/file_config.go b/cmd/config/subcommand/taskresourceattribute/file_config.go index 6c31553f..9629a71e 100644 --- a/cmd/config/subcommand/taskresourceattribute/file_config.go +++ b/cmd/config/subcommand/taskresourceattribute/file_config.go @@ -1,7 +1,7 @@ package taskresourceattribute import ( - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // TaskResourceAttrFileConfig shadow Config for TaskResourceAttribute. diff --git a/cmd/config/subcommand/taskresourceattribute/file_config_test.go b/cmd/config/subcommand/taskresourceattribute/file_config_test.go index 73b22489..cba5ea67 100644 --- a/cmd/config/subcommand/taskresourceattribute/file_config_test.go +++ b/cmd/config/subcommand/taskresourceattribute/file_config_test.go @@ -3,7 +3,7 @@ package taskresourceattribute import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/config/subcommand/workflowexecutionconfig/file_config.go b/cmd/config/subcommand/workflowexecutionconfig/file_config.go index 9dc6b01e..33ef8e16 100644 --- a/cmd/config/subcommand/workflowexecutionconfig/file_config.go +++ b/cmd/config/subcommand/workflowexecutionconfig/file_config.go @@ -1,7 +1,7 @@ package workflowexecutionconfig import ( - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) // FileConfig shadow Config for WorkflowExecutionConfig. diff --git a/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go b/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go index b6b8cfd8..45454f45 100644 --- a/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go +++ b/cmd/config/subcommand/workflowexecutionconfig/file_config_test.go @@ -3,7 +3,7 @@ package workflowexecutionconfig import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/configuration/configuration.go b/cmd/configuration/configuration.go index e7597581..a11fab3a 100644 --- a/cmd/configuration/configuration.go +++ b/cmd/configuration/configuration.go @@ -15,7 +15,7 @@ import ( initConfig "github.com/flyteorg/flytectl/cmd/config/subcommand/config" cmdcore "github.com/flyteorg/flytectl/cmd/core" cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" - "github.com/flyteorg/flytestdlib/config/viper" + "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/go-ozzo/ozzo-validation/v4/is" "github.com/spf13/cobra" ) diff --git a/cmd/configuration/configuration_test.go b/cmd/configuration/configuration_test.go index 19c90a13..59f8ddc3 100644 --- a/cmd/configuration/configuration_test.go +++ b/cmd/configuration/configuration_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - admin2 "github.com/flyteorg/flyteidl/clients/go/admin" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flytectl/pkg/configutil" diff --git a/cmd/core/cmd.go b/cmd/core/cmd.go index a6f7c391..2555cb4a 100644 --- a/cmd/core/cmd.go +++ b/cmd/core/cmd.go @@ -10,7 +10,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/pkg/pkce" - "github.com/flyteorg/flyteidl/clients/go/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/spf13/cobra" "github.com/spf13/pflag" diff --git a/cmd/core/cmd_ctx.go b/cmd/core/cmd_ctx.go index f5cd095c..d42fdee5 100644 --- a/cmd/core/cmd_ctx.go +++ b/cmd/core/cmd_ctx.go @@ -3,10 +3,10 @@ package cmdcore import ( "io" - "github.com/flyteorg/flyteidl/clients/go/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) type CommandContext struct { diff --git a/cmd/core/cmd_test.go b/cmd/core/cmd_test.go index 7ed13743..13737b4a 100644 --- a/cmd/core/cmd_test.go +++ b/cmd/core/cmd_test.go @@ -5,8 +5,8 @@ import ( "net/url" "testing" - "github.com/flyteorg/flyteidl/clients/go/admin" - "github.com/flyteorg/flytestdlib/config" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" diff --git a/cmd/create/execution.go b/cmd/create/execution.go index 839fa6e3..7fc62f20 100644 --- a/cmd/create/execution.go +++ b/cmd/create/execution.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" diff --git a/cmd/create/execution_test.go b/cmd/create/execution_test.go index 6f25bab3..ee5dc268 100644 --- a/cmd/create/execution_test.go +++ b/cmd/create/execution_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/suite" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" diff --git a/cmd/create/execution_util.go b/cmd/create/execution_util.go index ea679800..63b6fe08 100644 --- a/cmd/create/execution_util.go +++ b/cmd/create/execution_util.go @@ -6,9 +6,9 @@ import ( "io/ioutil" "strings" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/google/uuid" "sigs.k8s.io/yaml" diff --git a/cmd/create/execution_util_test.go b/cmd/create/execution_util_test.go index bbfeccdc..a865e77a 100644 --- a/cmd/create/execution_util_test.go +++ b/cmd/create/execution_util_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/cmd/config" diff --git a/cmd/create/project.go b/cmd/create/project.go index c6db389d..60bfa3f3 100644 --- a/cmd/create/project.go +++ b/cmd/create/project.go @@ -7,10 +7,10 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/project" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/cmd/create/project_test.go b/cmd/create/project_test.go index f0263bc4..a1f970e2 100644 --- a/cmd/create/project_test.go +++ b/cmd/create/project_test.go @@ -10,7 +10,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/project" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/create/serialization_utils.go b/cmd/create/serialization_utils.go index 53045d2c..dfd772c6 100644 --- a/cmd/create/serialization_utils.go +++ b/cmd/create/serialization_utils.go @@ -3,8 +3,8 @@ package create import ( "fmt" - "github.com/flyteorg/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) // TODO: Move all functions to flyteidl diff --git a/cmd/create/serialization_utils_test.go b/cmd/create/serialization_utils_test.go index 5c732649..7b10cf1b 100644 --- a/cmd/create/serialization_utils_test.go +++ b/cmd/create/serialization_utils_test.go @@ -3,7 +3,7 @@ package create import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" ) diff --git a/cmd/delete/execution.go b/cmd/delete/execution.go index fab4cbe5..1a9003c2 100644 --- a/cmd/delete/execution.go +++ b/cmd/delete/execution.go @@ -6,9 +6,9 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/logger" ) // Long descriptions are whitespace sensitive when generating docs using Sphinx. diff --git a/cmd/delete/execution_test.go b/cmd/delete/execution_test.go index 09d8a0e0..38469d59 100644 --- a/cmd/delete/execution_test.go +++ b/cmd/delete/execution_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" ) diff --git a/cmd/delete/matchable_attribute_util.go b/cmd/delete/matchable_attribute_util.go index 020a6096..efdd0d74 100644 --- a/cmd/delete/matchable_attribute_util.go +++ b/cmd/delete/matchable_attribute_util.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func deleteMatchableAttr(ctx context.Context, project, domain, workflowName string, diff --git a/cmd/delete/matchable_cluster_resource_attribute.go b/cmd/delete/matchable_cluster_resource_attribute.go index 2f3eec61..b1a5251f 100644 --- a/cmd/delete/matchable_cluster_resource_attribute.go +++ b/cmd/delete/matchable_cluster_resource_attribute.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_cluster_resource_attribute_test.go b/cmd/delete/matchable_cluster_resource_attribute_test.go index 17d8f02a..689cbe31 100644 --- a/cmd/delete/matchable_cluster_resource_attribute_test.go +++ b/cmd/delete/matchable_cluster_resource_attribute_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_execution_cluster_label.go b/cmd/delete/matchable_execution_cluster_label.go index eea32e32..787c6475 100644 --- a/cmd/delete/matchable_execution_cluster_label.go +++ b/cmd/delete/matchable_execution_cluster_label.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_execution_cluster_label_test.go b/cmd/delete/matchable_execution_cluster_label_test.go index 30d60f93..9b697d5f 100644 --- a/cmd/delete/matchable_execution_cluster_label_test.go +++ b/cmd/delete/matchable_execution_cluster_label_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_execution_queue_attribute.go b/cmd/delete/matchable_execution_queue_attribute.go index 63ae7ff5..004821fc 100644 --- a/cmd/delete/matchable_execution_queue_attribute.go +++ b/cmd/delete/matchable_execution_queue_attribute.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_execution_queue_attribute_test.go b/cmd/delete/matchable_execution_queue_attribute_test.go index 834ae48e..e911a0c6 100644 --- a/cmd/delete/matchable_execution_queue_attribute_test.go +++ b/cmd/delete/matchable_execution_queue_attribute_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_plugin_override.go b/cmd/delete/matchable_plugin_override.go index a7705ed8..1fda9459 100644 --- a/cmd/delete/matchable_plugin_override.go +++ b/cmd/delete/matchable_plugin_override.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_plugin_override_test.go b/cmd/delete/matchable_plugin_override_test.go index 38041229..7c1f6667 100644 --- a/cmd/delete/matchable_plugin_override_test.go +++ b/cmd/delete/matchable_plugin_override_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_task_resource_attribute.go b/cmd/delete/matchable_task_resource_attribute.go index f948ff8c..4f355f1f 100644 --- a/cmd/delete/matchable_task_resource_attribute.go +++ b/cmd/delete/matchable_task_resource_attribute.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_task_resource_attribute_test.go b/cmd/delete/matchable_task_resource_attribute_test.go index 71efaafa..be3a18c6 100644 --- a/cmd/delete/matchable_task_resource_attribute_test.go +++ b/cmd/delete/matchable_task_resource_attribute_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_workflow_execution_config.go b/cmd/delete/matchable_workflow_execution_config.go index ad387d4c..00d591b6 100644 --- a/cmd/delete/matchable_workflow_execution_config.go +++ b/cmd/delete/matchable_workflow_execution_config.go @@ -8,7 +8,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_workflow_execution_config_test.go b/cmd/delete/matchable_workflow_execution_config_test.go index 800c7329..07206538 100644 --- a/cmd/delete/matchable_workflow_execution_config_test.go +++ b/cmd/delete/matchable_workflow_execution_config_test.go @@ -7,7 +7,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/demo/exec_test.go b/cmd/demo/exec_test.go index 0375be91..a842e396 100644 --- a/cmd/demo/exec_test.go +++ b/cmd/demo/exec_test.go @@ -10,7 +10,7 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" - admin2 "github.com/flyteorg/flyteidl/clients/go/admin" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/stretchr/testify/assert" diff --git a/cmd/demo/reload.go b/cmd/demo/reload.go index e7100802..faf6663d 100644 --- a/cmd/demo/reload.go +++ b/cmd/demo/reload.go @@ -7,7 +7,7 @@ import ( cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/docker" "github.com/flyteorg/flytectl/pkg/k8s" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/cmd/get/execution.go b/cmd/get/execution.go index 26ec0b79..21b8d03d 100644 --- a/cmd/get/execution.go +++ b/cmd/get/execution.go @@ -8,8 +8,8 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" ) diff --git a/cmd/get/execution_test.go b/cmd/get/execution_test.go index 64476ad8..ca88b90c 100644 --- a/cmd/get/execution_test.go +++ b/cmd/get/execution_test.go @@ -10,8 +10,8 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/execution_util.go b/cmd/get/execution_util.go index 2397ee2f..2a2d3482 100644 --- a/cmd/get/execution_util.go +++ b/cmd/get/execution_util.go @@ -9,9 +9,9 @@ import ( "gopkg.in/yaml.v3" cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" - "github.com/flyteorg/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "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" ) // ExecutionConfig is duplicated struct from create with the same structure. This is to avoid the circular dependency. Only works with go-yaml. diff --git a/cmd/get/execution_util_test.go b/cmd/get/execution_util_test.go index 2d98c8b8..ff316ca4 100644 --- a/cmd/get/execution_util_test.go +++ b/cmd/get/execution_util_test.go @@ -3,8 +3,8 @@ package get import ( "testing" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/cmd/get/launch_plan.go b/cmd/get/launch_plan.go index f83a1d1d..5f17729e 100644 --- a/cmd/get/launch_plan.go +++ b/cmd/get/launch_plan.go @@ -9,8 +9,8 @@ import ( cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/ext" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" ) diff --git a/cmd/get/launch_plan_test.go b/cmd/get/launch_plan_test.go index 4055b723..9dda91c5 100644 --- a/cmd/get/launch_plan_test.go +++ b/cmd/get/launch_plan_test.go @@ -16,8 +16,8 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" "github.com/flyteorg/flytectl/pkg/ext/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/cmd/get/matchable_attribute_util.go b/cmd/get/matchable_attribute_util.go index 0a6358bf..85cca29f 100644 --- a/cmd/get/matchable_attribute_util.go +++ b/cmd/get/matchable_attribute_util.go @@ -5,7 +5,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func FetchAndUnDecorateMatchableAttr(ctx context.Context, project, domain, workflowName string, diff --git a/cmd/get/matchable_cluster_resource_attribute.go b/cmd/get/matchable_cluster_resource_attribute.go index 6fcf6621..5074a7c9 100644 --- a/cmd/get/matchable_cluster_resource_attribute.go +++ b/cmd/get/matchable_cluster_resource_attribute.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_cluster_resource_attribute_test.go b/cmd/get/matchable_cluster_resource_attribute_test.go index 5bf48ad8..6cc0a60e 100644 --- a/cmd/get/matchable_cluster_resource_attribute_test.go +++ b/cmd/get/matchable_cluster_resource_attribute_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_execution_cluster_label.go b/cmd/get/matchable_execution_cluster_label.go index 89cf5cf4..be3f46fb 100644 --- a/cmd/get/matchable_execution_cluster_label.go +++ b/cmd/get/matchable_execution_cluster_label.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_execution_cluster_label_test.go b/cmd/get/matchable_execution_cluster_label_test.go index 590fa1b5..5db7f9d0 100644 --- a/cmd/get/matchable_execution_cluster_label_test.go +++ b/cmd/get/matchable_execution_cluster_label_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_execution_queue_attribute.go b/cmd/get/matchable_execution_queue_attribute.go index 533b53a6..5af523fe 100644 --- a/cmd/get/matchable_execution_queue_attribute.go +++ b/cmd/get/matchable_execution_queue_attribute.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_execution_queue_attribute_test.go b/cmd/get/matchable_execution_queue_attribute_test.go index e4e33e7e..ecb1080b 100644 --- a/cmd/get/matchable_execution_queue_attribute_test.go +++ b/cmd/get/matchable_execution_queue_attribute_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_plugin_override.go b/cmd/get/matchable_plugin_override.go index 8ff08ee6..cdf4748a 100644 --- a/cmd/get/matchable_plugin_override.go +++ b/cmd/get/matchable_plugin_override.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_plugin_override_test.go b/cmd/get/matchable_plugin_override_test.go index 24363966..91f1f1e9 100644 --- a/cmd/get/matchable_plugin_override_test.go +++ b/cmd/get/matchable_plugin_override_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_task_resource_attribute.go b/cmd/get/matchable_task_resource_attribute.go index 40183615..98f9babb 100644 --- a/cmd/get/matchable_task_resource_attribute.go +++ b/cmd/get/matchable_task_resource_attribute.go @@ -7,7 +7,7 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_task_resource_attribute_test.go b/cmd/get/matchable_task_resource_attribute_test.go index f9faba6e..7e6c9a98 100644 --- a/cmd/get/matchable_task_resource_attribute_test.go +++ b/cmd/get/matchable_task_resource_attribute_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_workflow_execution_config.go b/cmd/get/matchable_workflow_execution_config.go index 59098e4a..457b53b1 100644 --- a/cmd/get/matchable_workflow_execution_config.go +++ b/cmd/get/matchable_workflow_execution_config.go @@ -8,8 +8,8 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/cmd/get/matchable_workflow_execution_config_test.go b/cmd/get/matchable_workflow_execution_config_test.go index 1206e5b7..046873e6 100644 --- a/cmd/get/matchable_workflow_execution_config_test.go +++ b/cmd/get/matchable_workflow_execution_config_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/node_execution.go b/cmd/get/node_execution.go index 61695ece..e719e070 100644 --- a/cmd/get/node_execution.go +++ b/cmd/get/node_execution.go @@ -9,9 +9,9 @@ import ( cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/disiqueira/gotree" "github.com/golang/protobuf/jsonpb" diff --git a/cmd/get/node_execution_test.go b/cmd/get/node_execution_test.go index 1958f6a5..ca12baa4 100644 --- a/cmd/get/node_execution_test.go +++ b/cmd/get/node_execution_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event" "github.com/disiqueira/gotree" "github.com/stretchr/testify/assert" diff --git a/cmd/get/project.go b/cmd/get/project.go index 092935c5..bf4b1473 100644 --- a/cmd/get/project.go +++ b/cmd/get/project.go @@ -5,8 +5,8 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/project" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" "github.com/flyteorg/flytectl/cmd/config" diff --git a/cmd/get/project_test.go b/cmd/get/project_test.go index d2a3a1ab..3380e492 100644 --- a/cmd/get/project_test.go +++ b/cmd/get/project_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/project" "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/get/task.go b/cmd/get/task.go index 7a5e9dc7..7e346b23 100644 --- a/cmd/get/task.go +++ b/cmd/get/task.go @@ -8,8 +8,8 @@ import ( cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/ext" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" ) diff --git a/cmd/get/task_test.go b/cmd/get/task_test.go index aea8e41c..5c6b279b 100644 --- a/cmd/get/task_test.go +++ b/cmd/get/task_test.go @@ -16,8 +16,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/flyteorg/flytectl/pkg/ext/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/cmd/get/workflow.go b/cmd/get/workflow.go index c428c2d6..4d95e615 100644 --- a/cmd/get/workflow.go +++ b/cmd/get/workflow.go @@ -5,14 +5,14 @@ import ( workflowconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/workflow" "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/workflow_test.go b/cmd/get/workflow_test.go index ec8da176..17f62219 100644 --- a/cmd/get/workflow_test.go +++ b/cmd/get/workflow_test.go @@ -16,8 +16,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/flyteorg/flytectl/pkg/ext/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflow" ) diff --git a/cmd/register/examples.go b/cmd/register/examples.go index 04d34be9..a6e9f1e2 100644 --- a/cmd/register/examples.go +++ b/cmd/register/examples.go @@ -8,7 +8,7 @@ import ( rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" cmdCore "github.com/flyteorg/flytectl/cmd/core" g "github.com/flyteorg/flytectl/pkg/github" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/google/go-github/v42/github" ) diff --git a/cmd/register/files.go b/cmd/register/files.go index e8667431..5582305b 100644 --- a/cmd/register/files.go +++ b/cmd/register/files.go @@ -8,12 +8,12 @@ import ( "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flytestdlib/storage" + "github.com/flyteorg/flyte/flytestdlib/storage" rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/cmd/register/files_test.go b/cmd/register/files_test.go index 0a9eb330..ee5aad7f 100644 --- a/cmd/register/files_test.go +++ b/cmd/register/files_test.go @@ -4,16 +4,16 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flytestdlib/contextutils" - "github.com/flyteorg/flytestdlib/promutils/labeled" - "github.com/flyteorg/flytestdlib/storage" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" - "github.com/flyteorg/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/cmd/register/register_util.go b/cmd/register/register_util.go index 87d8be43..87ef7ac7 100644 --- a/cmd/register/register_util.go +++ b/cmd/register/register_util.go @@ -18,25 +18,25 @@ import ( "strconv" "strings" - errors2 "github.com/flyteorg/flytestdlib/errors" + errors2 "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" g "github.com/flyteorg/flytectl/pkg/github" - "github.com/flyteorg/flytestdlib/contextutils" - "github.com/flyteorg/flytestdlib/promutils" - "github.com/flyteorg/flytestdlib/promutils/labeled" - "github.com/flyteorg/flytestdlib/utils" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/utils" "github.com/flyteorg/flytectl/cmd/config" rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flytestdlib/logger" - "github.com/flyteorg/flytestdlib/storage" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/google/go-github/v42/github" "github.com/golang/protobuf/jsonpb" diff --git a/cmd/register/register_util_test.go b/cmd/register/register_util_test.go index 9c9877ab..705b491c 100644 --- a/cmd/register/register_util_test.go +++ b/cmd/register/register_util_test.go @@ -13,22 +13,22 @@ import ( "testing" ghMocks "github.com/flyteorg/flytectl/pkg/github/mocks" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flytestdlib/utils" + "github.com/flyteorg/flyte/flytestdlib/utils" v1 "k8s.io/api/core/v1" - "github.com/flyteorg/flytestdlib/contextutils" - "github.com/flyteorg/flytestdlib/promutils" - "github.com/flyteorg/flytestdlib/promutils/labeled" - "github.com/flyteorg/flytestdlib/storage" + "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/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/google/go-github/v42/github" "github.com/stretchr/testify/assert" diff --git a/cmd/root.go b/cmd/root.go index 760cf3ba..4f651e8c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -20,8 +20,8 @@ import ( "github.com/flyteorg/flytectl/cmd/version" f "github.com/flyteorg/flytectl/pkg/filesystemutils" "github.com/flyteorg/flytectl/pkg/printer" - stdConfig "github.com/flyteorg/flytestdlib/config" - "github.com/flyteorg/flytestdlib/config/viper" + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/cmd/sandbox/exec_test.go b/cmd/sandbox/exec_test.go index 8cd7059c..b86a9a78 100644 --- a/cmd/sandbox/exec_test.go +++ b/cmd/sandbox/exec_test.go @@ -10,7 +10,7 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" - admin2 "github.com/flyteorg/flyteidl/clients/go/admin" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/stretchr/testify/assert" diff --git a/cmd/testutils/test_utils.go b/cmd/testutils/test_utils.go index 067720c8..6a16fa45 100644 --- a/cmd/testutils/test_utils.go +++ b/cmd/testutils/test_utils.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/clients/go/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/stretchr/testify/assert" diff --git a/cmd/update/execution.go b/cmd/update/execution.go index 517a28a3..049f5976 100644 --- a/cmd/update/execution.go +++ b/cmd/update/execution.go @@ -8,9 +8,9 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/cmd/update/execution_test.go b/cmd/update/execution_test.go index 35ab5912..444f6647 100644 --- a/cmd/update/execution_test.go +++ b/cmd/update/execution_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/update/interfaces/mocks/updater.go b/cmd/update/interfaces/mocks/updater.go index 3b56f35a..c7023271 100644 --- a/cmd/update/interfaces/mocks/updater.go +++ b/cmd/update/interfaces/mocks/updater.go @@ -7,7 +7,7 @@ import ( cmdcore "github.com/flyteorg/flytectl/cmd/core" - core "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + core "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" mock "github.com/stretchr/testify/mock" ) diff --git a/cmd/update/interfaces/updater.go b/cmd/update/interfaces/updater.go index 3ea18f67..acafe958 100644 --- a/cmd/update/interfaces/updater.go +++ b/cmd/update/interfaces/updater.go @@ -4,7 +4,7 @@ import ( "context" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) //go:generate mockery -name=Updater -case=underscore diff --git a/cmd/update/launch_plan.go b/cmd/update/launch_plan.go index 369f756c..c335a4e2 100644 --- a/cmd/update/launch_plan.go +++ b/cmd/update/launch_plan.go @@ -8,9 +8,9 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/cmd/update/launch_plan_meta.go b/cmd/update/launch_plan_meta.go index e9aa1ae9..f0bdaee6 100644 --- a/cmd/update/launch_plan_meta.go +++ b/cmd/update/launch_plan_meta.go @@ -7,7 +7,7 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/cmd/update/launch_plan_meta_test.go b/cmd/update/launch_plan_meta_test.go index f0119b9e..2df31f80 100644 --- a/cmd/update/launch_plan_meta_test.go +++ b/cmd/update/launch_plan_meta_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/update/launch_plan_test.go b/cmd/update/launch_plan_test.go index 0e5010c5..ce19336d 100644 --- a/cmd/update/launch_plan_test.go +++ b/cmd/update/launch_plan_test.go @@ -6,7 +6,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/update/named_entity.go b/cmd/update/named_entity.go index c7644f49..7ca988b2 100644 --- a/cmd/update/named_entity.go +++ b/cmd/update/named_entity.go @@ -6,9 +6,9 @@ import ( "github.com/flyteorg/flytectl/clierrors" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flytestdlib/logger" ) //go:generate pflags NamedEntityConfig --default-var namedEntityConfig --bind-default-var diff --git a/cmd/update/named_entity_test.go b/cmd/update/named_entity_test.go index 4e0086d7..b763d2f8 100644 --- a/cmd/update/named_entity_test.go +++ b/cmd/update/named_entity_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/assert" diff --git a/cmd/update/project.go b/cmd/update/project.go index bec3d36b..d9f4b5f1 100644 --- a/cmd/update/project.go +++ b/cmd/update/project.go @@ -8,7 +8,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/project" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/cmd/update/project_test.go b/cmd/update/project_test.go index 25fb768f..8146cd2b 100644 --- a/cmd/update/project_test.go +++ b/cmd/update/project_test.go @@ -9,7 +9,7 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/update/task_meta.go b/cmd/update/task_meta.go index 82f6d7a2..aba87d4b 100644 --- a/cmd/update/task_meta.go +++ b/cmd/update/task_meta.go @@ -7,7 +7,7 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/cmd/update/task_meta_test.go b/cmd/update/task_meta_test.go index e121cbe8..c0d5b0ca 100644 --- a/cmd/update/task_meta_test.go +++ b/cmd/update/task_meta_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/update/workflow_meta.go b/cmd/update/workflow_meta.go index b30743b6..07857770 100644 --- a/cmd/update/workflow_meta.go +++ b/cmd/update/workflow_meta.go @@ -7,7 +7,7 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/cmd/update/workflow_meta_test.go b/cmd/update/workflow_meta_test.go index 7c7a1fc7..6f881af7 100644 --- a/cmd/update/workflow_meta_test.go +++ b/cmd/update/workflow_meta_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/upgrade/upgrade.go b/cmd/upgrade/upgrade.go index b760975a..b01a795a 100644 --- a/cmd/upgrade/upgrade.go +++ b/cmd/upgrade/upgrade.go @@ -10,11 +10,11 @@ import ( "github.com/flyteorg/flytectl/pkg/util" - stdlibversion "github.com/flyteorg/flytestdlib/version" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/flyteorg/flytectl/pkg/github" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/mouuff/go-rocket-update/pkg/updater" cmdCore "github.com/flyteorg/flytectl/cmd/core" diff --git a/cmd/upgrade/upgrade_test.go b/cmd/upgrade/upgrade_test.go index 44095a5c..852d93dd 100644 --- a/cmd/upgrade/upgrade_test.go +++ b/cmd/upgrade/upgrade_test.go @@ -11,7 +11,7 @@ import ( "github.com/flyteorg/flytectl/pkg/platformutil" - stdlibversion "github.com/flyteorg/flytestdlib/version" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/spf13/cobra" diff --git a/cmd/version/version.go b/cmd/version/version.go index b5ff9cfe..03a2a753 100644 --- a/cmd/version/version.go +++ b/cmd/version/version.go @@ -11,9 +11,9 @@ import ( "github.com/flyteorg/flytectl/pkg/platformutil" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flytestdlib/logger" - stdlibversion "github.com/flyteorg/flytestdlib/version" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/spf13/cobra" ) diff --git a/cmd/version/version_test.go b/cmd/version/version_test.go index 9f67577a..649f4302 100644 --- a/cmd/version/version_test.go +++ b/cmd/version/version_test.go @@ -10,14 +10,14 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" - admin2 "github.com/flyteorg/flyteidl/clients/go/admin" + admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/spf13/cobra" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - stdlibversion "github.com/flyteorg/flytestdlib/version" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/stretchr/testify/assert" ) diff --git a/go.mod b/go.mod index a3587885..dde2783c 100644 --- a/go.mod +++ b/go.mod @@ -9,17 +9,17 @@ require ( github.com/docker/docker v20.10.7+incompatible github.com/docker/go-connections v0.4.0 github.com/enescakir/emoji v1.0.0 - github.com/flyteorg/flyteidl v1.5.12 - github.com/flyteorg/flytepropeller v1.1.1 - github.com/flyteorg/flytestdlib v1.0.13 + github.com/flyteorg/flyte/flyteidl v1.9.12 + github.com/flyteorg/flyte/flytepropeller v1.9.12 + github.com/flyteorg/flyte/flytestdlib v1.9.12 github.com/go-ozzo/ozzo-validation/v4 v4.3.0 - github.com/golang/protobuf v1.5.2 + github.com/golang/protobuf v1.5.3 github.com/google/go-github/v42 v42.0.0 - github.com/google/uuid v1.2.0 + github.com/google/uuid v1.3.0 github.com/hashicorp/go-version v1.3.0 github.com/kataras/tablewriter v0.0.0-20180708051242-e063d29b7c23 github.com/landoop/tableprinter v0.0.0-20180806200924-8bd8c2576d27 - github.com/mitchellh/mapstructure v1.4.3 + github.com/mitchellh/mapstructure v1.5.0 github.com/mouuff/go-rocket-update v1.5.1 github.com/opencontainers/image-spec v1.0.2 github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 @@ -27,26 +27,27 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.4.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.7.1 + github.com/stretchr/testify v1.8.4 github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 github.com/zalando/go-keyring v0.1.1 - golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 - golang.org/x/text v0.3.7 - google.golang.org/grpc v1.46.0 - google.golang.org/protobuf v1.28.0 + golang.org/x/oauth2 v0.7.0 + golang.org/x/text v0.9.0 + google.golang.org/grpc v1.56.1 + google.golang.org/protobuf v1.30.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools v2.2.0+incompatible - k8s.io/api v0.21.3 - k8s.io/apimachinery v0.21.3 - k8s.io/client-go v0.21.3 + k8s.io/api v0.24.1 + k8s.io/apimachinery v0.24.1 + k8s.io/client-go v0.24.1 sigs.k8s.io/yaml v1.3.0 ) require ( - cloud.google.com/go v0.101.0 // indirect - cloud.google.com/go/compute v1.6.1 // indirect - cloud.google.com/go/iam v0.3.0 // indirect - cloud.google.com/go/storage v1.22.0 // indirect + cloud.google.com/go v0.110.0 // indirect + cloud.google.com/go/compute v1.19.1 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v0.13.0 // indirect + cloud.google.com/go/storage v1.28.1 // indirect github.com/Azure/azure-sdk-for-go v63.4.0+incompatible // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2 // indirect @@ -62,45 +63,51 @@ require ( github.com/aws/aws-sdk-go v1.44.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/containerd/containerd v1.5.10 // indirect github.com/coocood/freecache v1.1.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect github.com/danieljoos/wincred v1.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dnaeon/go-vcr v1.2.0 // indirect github.com/docker/distribution v2.8.0+incompatible // indirect github.com/docker/go-units v0.4.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect - github.com/evanphx/json-patch v4.9.0+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/fatih/color v1.13.0 // indirect - github.com/flyteorg/flyteplugins v1.0.0 // indirect - github.com/flyteorg/stow v0.3.6 // indirect + github.com/flyteorg/flyte/flyteplugins v0.0.0-00010101000000-000000000000 // indirect + github.com/flyteorg/stow v0.3.7 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-logr/logr v0.4.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/godbus/dbus/v5 v5.0.4 // indirect github.com/gofrs/uuid v4.2.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/google/gnostic v0.5.7-v3refs // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/googleapis/gax-go/v2 v2.3.0 // indirect - github.com/googleapis/gnostic v0.5.1 // indirect - github.com/googleapis/go-type-adapters v1.0.0 // indirect - github.com/gorilla/mux v1.8.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/googleapis/gax-go/v2 v2.7.1 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/magiconair/properties v1.8.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect @@ -109,6 +116,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/ncw/swift v1.0.53 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pelletier/go-toml v1.9.4 // indirect @@ -120,28 +128,37 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/viper v1.11.0 // indirect - github.com/stretchr/objx v0.3.0 // indirect + github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect - go.opencensus.io v0.23.0 // indirect - golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f // indirect - golang.org/x/exp v0.0.0-20220428152302-39d4317da171 // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect - golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect - golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect - google.golang.org/api v0.76.0 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/term v0.7.0 // indirect + golang.org/x/time v0.1.0 // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/api v0.114.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/klog/v2 v2.8.0 // indirect - k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect - k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect + k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) + +replace github.com/flyteorg/flyte/flyteidl => github.com/flyteorg/flyte/flyteidl v1.9.12 + +replace github.com/flyteorg/flyte/flytepropeller => github.com/flyteorg/flyte/flytepropeller v1.9.12 + +replace github.com/flyteorg/flyte/flytestdlib => github.com/flyteorg/flyte/flytestdlib v1.9.12 + +replace github.com/flyteorg/flyte/flyteplugins => github.com/flyteorg/flyte/flyteplugins v1.9.12 diff --git a/go.sum b/go.sum index 95855b56..41cf19c3 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,6 @@ cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxK cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -16,41 +15,29 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.101.0 h1:g+LL+JvpvdyGtcaD2xw2mSByE/6F9s471eJSoaysM84= -cloud.google.com/go v0.101.0/go.mod h1:hEiddgDb77jDQ+I80tURYNJEnuwPzFU8awCFFRLKjW0= +cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1 h1:2sMmt8prCn7DPaG4Pmh0N3Inmc8cT8ae5k1M6VJ9Wqc= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= +cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -60,23 +47,18 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.0 h1:NUV0NNp9nkBuW66BFRLuMgldN60C57ET3dhbwLIYio8= -cloud.google.com/go/storage v1.22.0/go.mod h1:GbaLEoMqbVm6sx3Z0R++gSiBlgMv6yUi2q1DeGFKQgE= +cloud.google.com/go/storage v1.28.1 h1:F5QDG5ChchaAVQhINh24U99OWHURqrW8OmQcGKXcbgI= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v62.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v63.4.0+incompatible h1:fle3M5Q7vr8auaiPffKyUQmLbvYeqpw30bKU6PrWJFo= github.com/Azure/azure-sdk-for-go v63.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.1 h1:3CVsSo4mp8NDWO11tHzN/mdo2zP0CtaSK5IcwBjfqRA= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.1/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2 h1:Px2KVERcYEg2Lv25AqC2hVr0xUWaq94wuEObLIkYzmA= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2/go.mod h1:CdSJQNNzZhCkwDaV27XV1w48ZBPtxe7mlrZAsPNxD5g= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.0 h1:0nJeKDmB7a1a8RDMjTltahlPsaNlWjq/LpkZleSwINk= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.0/go.mod h1:mbwxKc/fW+IkF0GG591MuXw0KuEQBDkeRoZ9vmVJPxg= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= @@ -84,47 +66,30 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest v0.11.17/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest v0.11.27 h1:F3R3q42aWytozkV8ihzcgMO4OA4cuqr3bNlsEuF6//A= github.com/Azure/go-autorest/autorest v0.11.27/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.10/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= -github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20200723154620-6f35a1152625/go.mod h1:6PnrZv6zUDkrNMw0mIoGRmGBR7i9LulhKPmxFq4rUiM= -github.com/Jeffail/gabs/v2 v2.5.1/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= @@ -148,35 +113,18 @@ github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:m github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/adammck/venv v0.0.0-20160819025605-8a9c907a37d3/go.mod h1:3zXR2a/VSQndtpShh783rUTaEA2mpqN2VqZclBARBc0= -github.com/adammck/venv v0.0.0-20200610172036-e77789703e7c/go.mod h1:3zXR2a/VSQndtpShh783rUTaEA2mpqN2VqZclBARBc0= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= @@ -184,27 +132,9 @@ github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHS github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E= github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= -github.com/aws/amazon-sagemaker-operator-for-k8s v1.0.1-0.20210303003444-0fb33b1fd49d/go.mod h1:mZUP7GJmjiWtf8v3FD1X/QdK08BqyeH/1Ejt0qhNzCs= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.23.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.37.1/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.37.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.2 h1:5VBk5r06bgxgRKVaUtm1/4NT/rtrnH2E4cnAYv5zgQc= github.com/aws/aws-sdk-go v1.44.2/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.0.0/go.mod h1:smfAbmpW+tcRVuNUjo3MOArSZmW72t62rkCzc2i0TWM= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.0.0/go.mod h1:WysE/OpUgE37tjtmtJd8GXgT8s1euilE5XtUkRNUQ1w= -github.com/aws/aws-sdk-go-v2/credentials v1.0.0/go.mod h1:/SvsiqBf509hG4Bddigr3NB12MIpfHhZapyBurJe8aY= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.0/go.mod h1:wpMHDCXvOXZxGCRSidyepa8uJHY4vaBGfY2/+oKU/Bc= -github.com/aws/aws-sdk-go-v2/service/athena v1.0.0/go.mod h1:qY8QFbemf2ceqweXcS6hQqiiIe1z42WqTvHsK2Lb0rE= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0/go.mod h1:3jExOmpbjgPnz2FJaMOfbSk1heTkZ66aD3yNtVhnjvI= -github.com/aws/aws-sdk-go-v2/service/sts v1.0.0/go.mod h1:5f+cELGATgill5Pu3/vK3Ebuigstc+qYEHW5MvGWZO4= -github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/benlaurie/objecthash v0.0.0-20180202135721-d1e3d6079fc1/go.mod h1:jvdWlw8vowVGnZqSDC7yhPd7AifQeQbRDkZcQXV2nRg= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -213,9 +143,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= @@ -223,19 +151,17 @@ github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7 github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= -github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -244,19 +170,11 @@ github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLI github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= @@ -345,8 +263,6 @@ github.com/coocood/freecache v1.1.1 h1:uukNF7QKCZEdZ9gAV7WQzvh0SbjwdMF6m3x3rxEka github.com/coocood/freecache v1.1.1/go.mod h1:OKrEjkGVoxZhyWAJoeFi5BMLUJm2Tit0kpGkIr7NGYY= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= @@ -359,9 +275,7 @@ github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+ github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= @@ -394,7 +308,6 @@ github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.0+incompatible h1:l9EaZDICImO1ngI+uTifW+ZYvvz7fKISBAKpg+MbWbY= github.com/docker/distribution v2.8.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -403,7 +316,6 @@ github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6Uezg github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= @@ -412,54 +324,37 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.6+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/enescakir/emoji v1.0.0 h1:W+HsNql8swfCQFtioDGDHCHri8nudlK1n5p2rHCJoog= github.com/enescakir/emoji v1.0.0/go.mod h1:Bt1EKuLnKDTYpLALApstIkAjdDrS/8IAgTkKp+WKFD0= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ernesto-jimenez/gogen v0.0.0-20180125220232-d7d4131e6607/go.mod h1:Cg4fM0vhYWOZdgM7RIOSTRNIc8/VT7CXClC3Ni86lu4= -github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/flyteorg/flyteidl v1.0.0/go.mod h1:JW0z1ZaHS9zWvDAwSMIyGhsf+V4zrzBBgh5IuqzMFCM= -github.com/flyteorg/flyteidl v1.5.12 h1:bCSSie8Yru1e9yLHWPO3ORksHHskK+bmkxln/jV3bXM= -github.com/flyteorg/flyteidl v1.5.12/go.mod h1:EtE/muM2lHHgBabjYcxqe9TWeJSL0kXwbI0RgVwI4Og= -github.com/flyteorg/flyteplugins v1.0.0 h1:77hUJjiIxBmQ9rd3+cXjSGnzOVAFrSzCd59aIaYFB/8= -github.com/flyteorg/flyteplugins v1.0.0/go.mod h1:4Cpn+9RfanIieTTh2XsuL6zPYXtsR5UDe8YaEmXONT4= -github.com/flyteorg/flytepropeller v1.1.1 h1:z9OFS7VAsoFOyIGSfIszaMrERG8MOvS17yzpuiusb64= -github.com/flyteorg/flytepropeller v1.1.1/go.mod h1:x7vIuy9vmOPw9JSd+xAijeiHShmuieFZsTT1yLXhR90= -github.com/flyteorg/flytestdlib v1.0.0/go.mod h1:QSVN5wIM1lM9d60eAEbX7NwweQXW96t5x4jbyftn89c= -github.com/flyteorg/flytestdlib v1.0.13 h1:mmU+k0Bc7HB5kWCgxoNJ9lZeD9tV1c7e5oCgyXKgO8c= -github.com/flyteorg/flytestdlib v1.0.13/go.mod h1:nIBmBHtjTJvhZEn3e/EwVC/iMkR2tUX8hEiXjRBpH/s= -github.com/flyteorg/stow v0.3.3/go.mod h1:HBld7ud0i4khMHwJjkO8v+NSP7ddKa/ruhf4I8fliaA= -github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk= -github.com/flyteorg/stow v0.3.6/go.mod h1:5dfBitPM004dwaZdoVylVjxFT4GWAgI0ghAndhNUzCo= +github.com/flyteorg/flyte/flyteidl v1.9.12 h1:9V3rng4g6wheLf3j4ISuT6YZR5NX2/wSqqbJiOBYt00= +github.com/flyteorg/flyte/flyteidl v1.9.12/go.mod h1:87ELgkbZ26Fz95zkUZZP3rFc5qi2KXBxlqZ/NBqRkWQ= +github.com/flyteorg/flyte/flyteplugins v1.9.12 h1:ceXJSePUchdqlGKx9Y1Yj6BnuXMO+PKMtTT4ongfdAk= +github.com/flyteorg/flyte/flyteplugins v1.9.12/go.mod h1:PCM5jdV3iASLgLcdHOj5bzkY5Bz4eBunll14jrJmJOQ= +github.com/flyteorg/flyte/flytepropeller v1.9.12 h1:8wkLq6nk6HMLCTwZrQzn6lc1f8qRmv7cuQKWoXJJPH8= +github.com/flyteorg/flyte/flytepropeller v1.9.12/go.mod h1:lTYcULg7WZXbz4OyCibNB3z3gv7Et1u1hfruHuD5mb4= +github.com/flyteorg/flyte/flytestdlib v1.9.12 h1:Rm4c6e+/G6yeW4wm/+A1pClasJtZolELJQyikuv5O1A= +github.com/flyteorg/flyte/flytestdlib v1.9.12/go.mod h1:ZnpzKetFifz05KvjX4/Au23m3gdTkYHnN/MvVZvvJYk= +github.com/flyteorg/stow v0.3.7 h1:Cx7j8/Ux6+toD5hp5fy++927V+yAcAttDeQAlUD/864= +github.com/flyteorg/stow v0.3.7/go.mod h1:5dfBitPM004dwaZdoVylVjxFT4GWAgI0ghAndhNUzCo= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -467,85 +362,45 @@ github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWp github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= -github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= -github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= -github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -554,11 +409,9 @@ github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -586,8 +439,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -604,12 +455,14 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -621,10 +474,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5PxwaoLec= github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -637,9 +488,7 @@ github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPg github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -647,45 +496,29 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/readahead v0.0.0-20161222183148-eaceba169032/go.mod h1:qYysrqQXuV4tzsizt4oOQ6mrBZQ0xnQXP3ylXX8Jk5Y= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0 h1:nRJtk3y8Fm770D42QV6T90ZnvFZyk7agSo3Q+Z9p3WI= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6cvPr8A= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -694,76 +527,52 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -797,38 +606,24 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubeflow/common v0.4.0/go.mod h1:X15/dRQQoB77wrqrPwVn4GqG2ubgk8xR24A80i61d/4= -github.com/kubeflow/mpi-operator/v2 v2.0.0-20210920181600-c5c0c3ef99ec/go.mod h1:cTBmZKLlrIXBWQ0A9Ik8h0i4zoGhR7ApHwUfrLDbhQc= -github.com/kubeflow/pytorch-operator v0.6.0/go.mod h1:zHblV+yTwVG4PCgKTU2wPfOmQ6TJdfT87lDfHrP1a1Y= -github.com/kubeflow/tf-operator v0.5.3/go.mod h1:EBtz5LQoKaHUl/5fV5vD1qXVNVNyn3TrFaH6eVoQ8SY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/landoop/tableprinter v0.0.0-20180806200924-8bd8c2576d27 h1:O664tckOIC4smyHDDJPXAh/YBYYc0Y1O8S5wmZDm3d8= github.com/landoop/tableprinter v0.0.0-20180806200924-8bd8c2576d27/go.mod h1:f0X1c0za3TbET/rl5ThtCSel0+G3/yZ8iuU9BxnyVK0= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -839,20 +634,12 @@ github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= @@ -876,49 +663,34 @@ github.com/mouuff/go-rocket-update v1.5.1 h1:qGgUu/MP+aVQ63laEguRNimmNTPKs29xz0l github.com/mouuff/go-rocket-update v1.5.1/go.mod h1:CnOyUYCxAJyC1g1mebSGC7gJysLTlX+RpxKgD1B0zLs= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/ncw/swift v1.0.49/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/ncw/swift v1.0.53 h1:luHjjTNtekIEvHg5KdAFIBaH7bWfNkefwFnpDffSIks= github.com/ncw/swift v1.0.53/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= -github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -945,27 +717,14 @@ github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mo github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -973,83 +732,59 @@ github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.10.0/go.mod h1:NxmoDg/QLVWluQDUYG7XBZTLUpKeFa8e3aMf1BfjyHk= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/pquerna/ffjson v0.0.0-20190813045741-dac163c6c0a9/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= -github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -1062,25 +797,19 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1092,23 +821,18 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1116,24 +840,24 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= @@ -1154,7 +878,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -1163,70 +886,41 @@ github.com/zalando/go-keyring v0.1.1/go.mod h1:OIC+OZ28XbmwFxU/Rp9V7eKzZjamBJwRz go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5/go.mod h1:skWido08r9w6Lq/w70DO5XYIKMu4QFu1+4VsqLQuJy8= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.22.6/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f h1:OeJjE6G4dgCY4PIXvIRQbE8+RX+uXZyGhUy/ksMGJoc= -golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1237,8 +931,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220428152302-39d4317da171 h1:TfdoLivD44QwvssI9Sv1xwa5DcL5XQr4au4sZ2F2NV4= -golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= +golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1252,7 +946,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1264,22 +957,15 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1308,7 +994,6 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1317,22 +1002,14 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1341,19 +1018,13 @@ golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1365,21 +1036,13 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1405,7 +1068,6 @@ golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1431,7 +1093,6 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1443,14 +1104,12 @@ golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1459,34 +1118,19 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1495,23 +1139,21 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1522,18 +1164,12 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1541,7 +1177,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1557,16 +1192,12 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1574,22 +1205,14 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1606,33 +1229,14 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= -google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.38.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.76.0 h1:UkZl25bR1FHNqtK/EKs3vCdpZtUO6gea3YElTwc8pQg= -google.golang.org/api v0.76.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.114.0 h1:1xQPji6cO2E2vLiI+C/XiFAnsn1WV3mjaEwGLhi3grE= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -1647,7 +1251,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1665,6 +1268,7 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1674,66 +1278,27 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46 h1:G1IeWbjrqEq9ChWxEuRPJu6laA67+XgTFHVSAvepr38= -google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= @@ -1746,25 +1311,14 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= +google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1778,8 +1332,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1792,23 +1346,17 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/kothar/go-backblaze.v0 v0.0.0-20190520213052-702d4e7eb465/go.mod h1:zJ2QpyDCYo1KvLXlmdnFlQAyF/Qfth0fB8239Qg7BIE= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1819,19 +1367,17 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1839,127 +1385,64 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.0.0-20210217171935-8e2decd92398/go.mod h1:60tmSUpHxGPFerNHbo/ayI2lKxvtrhbxFyXuEIWJd78= -k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= -k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= -k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= -k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= -k8s.io/api v0.19.6/go.mod h1:Plxx44Nh4zVblkJrIgxVPgPre1mvng6tXf1Sj3bs0fU= -k8s.io/api v0.19.9/go.mod h1:RcFj+riKQ1fAITdmtA6InI3LVEeKi+9LuvU7GVMeXJI= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.21.3 h1:cblWILbLO8ar+Fj6xdDGr603HRsf8Wu9E9rngJeprZQ= -k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= -k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= -k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= -k8s.io/apiextensions-apiserver v0.19.2/go.mod h1:EYNjpqIAvNZe+svXVx9j4uBaVhTB4C94HkY3w058qcg= -k8s.io/apiextensions-apiserver v0.20.1 h1:ZrXQeslal+6zKM/HjDXLzThlz/vPSxrfK3OqL8txgVQ= -k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= -k8s.io/apimachinery v0.0.0-20210217011835-527a61b4dffe/go.mod h1:Z7ps/g0rjlTeMstYrMOUttJfT2Gg34DEaG/f2PYLCWY= -k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= -k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/apimachinery v0.19.6/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= -k8s.io/apimachinery v0.19.9/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= +k8s.io/api v0.24.1 h1:BjCMRDcyEYz03joa3K1+rbshwh1Ay6oB53+iUx2H8UY= +k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= +k8s.io/apiextensions-apiserver v0.24.1 h1:5yBh9+ueTq/kfnHQZa0MAo6uNcPrtxPMpNQgorBaKS0= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.21.3 h1:3Ju4nvjCngxxMYby0BimUk+pQHPOQp3eCGChk5kfVII= -k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= -k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= -k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= -k8s.io/apiserver v0.19.2/go.mod h1:FreAq0bJ2vtZFj9Ago/X0oNGC51GfubKK/ViOKfVAOA= -k8s.io/apiserver v0.19.6/go.mod h1:05XquZxCDzQ27ebk7uV2LrFIK4lm5Yt47XkkUvLAoAM= -k8s.io/apiserver v0.19.9/go.mod h1:g6zpD+kcZFlO73pktPWRvL0tUGqj7/KaOowmRk8EpGg= +k8s.io/apimachinery v0.24.1 h1:ShD4aDxTQKN5zNf8K1RQ2u98ELLdIW7jEnlO9uAMX/I= +k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/client-go v0.0.0-20210217172142-7279fc64d847/go.mod h1:q0EaghmVye2uui19vxSZ2NG6ssgUWgjudO6vrwXneSI= -k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= -k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= -k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU= -k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= -k8s.io/client-go v0.19.6/go.mod h1:gEiS+efRlXYUEQ9Oz4lmNXlxAl5JZ8y2zbTDGhvXXnk= -k8s.io/client-go v0.19.9/go.mod h1:8GArfSmN7MwTidMGcLGM3QTYa7uekI/B6IOrM0s1XPs= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.21.3 h1:J9nxZTOmvkInRDCzcSNQmPJbDYN/PjlxXT9Mos3HcLg= -k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= -k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= -k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= -k8s.io/code-generator v0.19.6/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/code-generator v0.19.9/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= -k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= -k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= -k8s.io/component-base v0.19.2/go.mod h1:g5LrsiTiabMLZ40AR6Hl45f088DevyGY+cCE2agEIVo= -k8s.io/component-base v0.19.6/go.mod h1:8Btsf8J00/fVDa/YFmXjei7gVkcFrlKZXjSeP4SZNJg= -k8s.io/component-base v0.19.9/go.mod h1:x9UmpImvXgVry1s9/hINgLz6iGBYUGvy3Xm7KZh1nnI= +k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= +k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/sample-controller v0.19.9/go.mod h1:pzC7f1rPpf0+o9rg45Ju8GY83nGARzWABmPblej9v/M= -k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= -k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= +k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9/go.mod h1:dzAXnQbTRyDlZPJX2SUPEqvnB+j7AJjtlox7PEwigU0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E= -sigs.k8s.io/controller-runtime v0.7.2/go.mod h1:pJ3YBrJiAqMAZKi6UVGuE98ZrroV1p+pIhoHsMm9wdU= -sigs.k8s.io/controller-runtime v0.8.2/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= -sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -volcano.sh/apis v1.2.0-k8s1.19.6/go.mod h1:UaeJ/s5Hyd+ZhFLc+Kw9YlgM8gRZ/5OzXqHa0yKOoXY= diff --git a/main.go b/main.go index ba6248d1..45a03688 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ import ( "os" "github.com/flyteorg/flytectl/cmd" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func main() { diff --git a/pkg/adminutils/config.go b/pkg/adminutils/config.go index 71f0a3f4..04bb5d81 100644 --- a/pkg/adminutils/config.go +++ b/pkg/adminutils/config.go @@ -1,6 +1,6 @@ package adminutils -import "github.com/flyteorg/flytestdlib/config" +import "github.com/flyteorg/flyte/flytestdlib/config" //go:generate pflags Config --default-var DefaultConfig --bind-default-var diff --git a/pkg/ext/attribute_match_deleter_test.go b/pkg/ext/attribute_match_deleter_test.go index c0105f99..885eff05 100644 --- a/pkg/ext/attribute_match_deleter_test.go +++ b/pkg/ext/attribute_match_deleter_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/ext/attribute_match_fetcher.go b/pkg/ext/attribute_match_fetcher.go index 3e33609b..d9e5c402 100644 --- a/pkg/ext/attribute_match_fetcher.go +++ b/pkg/ext/attribute_match_fetcher.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func (a *AdminFetcherExtClient) FetchWorkflowAttributes(ctx context.Context, project, domain, name string, diff --git a/pkg/ext/attribute_match_fetcher_test.go b/pkg/ext/attribute_match_fetcher_test.go index 81352d6b..52f081f9 100644 --- a/pkg/ext/attribute_match_fetcher_test.go +++ b/pkg/ext/attribute_match_fetcher_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/ext/attribute_match_updater.go b/pkg/ext/attribute_match_updater.go index 44d00c39..9153b8b3 100644 --- a/pkg/ext/attribute_match_updater.go +++ b/pkg/ext/attribute_match_updater.go @@ -3,7 +3,7 @@ package ext import ( "context" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func (a *AdminUpdaterExtClient) UpdateWorkflowAttributes(ctx context.Context, project, domain, name string, matchingAttr *admin.MatchingAttributes) error { diff --git a/pkg/ext/attribute_match_updater_test.go b/pkg/ext/attribute_match_updater_test.go index 0c331c9e..1fab0f67 100644 --- a/pkg/ext/attribute_match_updater_test.go +++ b/pkg/ext/attribute_match_updater_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/ext/attribute_matcher_deleter.go b/pkg/ext/attribute_matcher_deleter.go index ef8a5730..e53490ea 100644 --- a/pkg/ext/attribute_matcher_deleter.go +++ b/pkg/ext/attribute_matcher_deleter.go @@ -3,7 +3,7 @@ package ext import ( "context" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func (a *AdminDeleterExtClient) DeleteWorkflowAttributes(ctx context.Context, project, domain, name string, rsType admin.MatchableResource) error { diff --git a/pkg/ext/deleter.go b/pkg/ext/deleter.go index db5d97a7..6b848cb2 100644 --- a/pkg/ext/deleter.go +++ b/pkg/ext/deleter.go @@ -3,8 +3,8 @@ package ext import ( "context" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) //go:generate mockery -all -case=underscore diff --git a/pkg/ext/deleter_test.go b/pkg/ext/deleter_test.go index 17666b02..7a307577 100644 --- a/pkg/ext/deleter_test.go +++ b/pkg/ext/deleter_test.go @@ -3,7 +3,7 @@ package ext import ( "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ext/execution_fetcher.go b/pkg/ext/execution_fetcher.go index 24251b39..5bd70720 100644 --- a/pkg/ext/execution_fetcher.go +++ b/pkg/ext/execution_fetcher.go @@ -4,8 +4,8 @@ import ( "context" "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func (a *AdminFetcherExtClient) FetchExecution(ctx context.Context, name, project, domain string) (*admin.Execution, error) { diff --git a/pkg/ext/execution_fetcher_test.go b/pkg/ext/execution_fetcher_test.go index a415660f..304f9298 100644 --- a/pkg/ext/execution_fetcher_test.go +++ b/pkg/ext/execution_fetcher_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/ext/fetcher.go b/pkg/ext/fetcher.go index b706bf8a..7d388348 100644 --- a/pkg/ext/fetcher.go +++ b/pkg/ext/fetcher.go @@ -5,8 +5,8 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) //go:generate mockery -all -case=underscore diff --git a/pkg/ext/fetcher_test.go b/pkg/ext/fetcher_test.go index f0ddffeb..2654f5b5 100644 --- a/pkg/ext/fetcher_test.go +++ b/pkg/ext/fetcher_test.go @@ -3,7 +3,7 @@ package ext import ( "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ext/launch_plan_fetcher.go b/pkg/ext/launch_plan_fetcher.go index ad24b3ab..76ee5249 100644 --- a/pkg/ext/launch_plan_fetcher.go +++ b/pkg/ext/launch_plan_fetcher.go @@ -6,8 +6,8 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) // FetchAllVerOfLP fetches all the versions for give launch plan name diff --git a/pkg/ext/launch_plan_fetcher_test.go b/pkg/ext/launch_plan_fetcher_test.go index 39d0121c..c2cf3140 100644 --- a/pkg/ext/launch_plan_fetcher_test.go +++ b/pkg/ext/launch_plan_fetcher_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/ext/mocks/admin_deleter_ext_interface.go b/pkg/ext/mocks/admin_deleter_ext_interface.go index 414cd17f..c165501c 100644 --- a/pkg/ext/mocks/admin_deleter_ext_interface.go +++ b/pkg/ext/mocks/admin_deleter_ext_interface.go @@ -5,11 +5,11 @@ package mocks import ( context "context" - admin "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + admin "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" mock "github.com/stretchr/testify/mock" - service "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + service "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) // AdminDeleterExtInterface is an autogenerated mock type for the AdminDeleterExtInterface type diff --git a/pkg/ext/mocks/admin_fetcher_ext_interface.go b/pkg/ext/mocks/admin_fetcher_ext_interface.go index 3162a6b2..033fe3ca 100644 --- a/pkg/ext/mocks/admin_fetcher_ext_interface.go +++ b/pkg/ext/mocks/admin_fetcher_ext_interface.go @@ -5,13 +5,13 @@ package mocks import ( context "context" - admin "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + admin "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" filters "github.com/flyteorg/flytectl/pkg/filters" mock "github.com/stretchr/testify/mock" - service "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + service "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) // AdminFetcherExtInterface is an autogenerated mock type for the AdminFetcherExtInterface type diff --git a/pkg/ext/mocks/admin_service_fetcher_ext_interface.go b/pkg/ext/mocks/admin_service_fetcher_ext_interface.go index df851c5d..74b08a11 100644 --- a/pkg/ext/mocks/admin_service_fetcher_ext_interface.go +++ b/pkg/ext/mocks/admin_service_fetcher_ext_interface.go @@ -5,11 +5,11 @@ package mocks import ( context "context" - admin "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + admin "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" mock "github.com/stretchr/testify/mock" - service "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + service "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) // AdminServiceFetcherExtInterface is an autogenerated mock type for the AdminServiceFetcherExtInterface type diff --git a/pkg/ext/mocks/admin_updater_ext_interface.go b/pkg/ext/mocks/admin_updater_ext_interface.go index a59d8ca7..c1d9bc7e 100644 --- a/pkg/ext/mocks/admin_updater_ext_interface.go +++ b/pkg/ext/mocks/admin_updater_ext_interface.go @@ -5,11 +5,11 @@ package mocks import ( context "context" - admin "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + admin "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" mock "github.com/stretchr/testify/mock" - service "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + service "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) // AdminUpdaterExtInterface is an autogenerated mock type for the AdminUpdaterExtInterface type diff --git a/pkg/ext/project_fetcher.go b/pkg/ext/project_fetcher.go index 4367bef9..fbeb71d1 100644 --- a/pkg/ext/project_fetcher.go +++ b/pkg/ext/project_fetcher.go @@ -5,7 +5,7 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func (a *AdminFetcherExtClient) ListProjects(ctx context.Context, filter filters.Filters) (*admin.Projects, error) { diff --git a/pkg/ext/project_fetcher_test.go b/pkg/ext/project_fetcher_test.go index 4b9c5054..d89d153a 100644 --- a/pkg/ext/project_fetcher_test.go +++ b/pkg/ext/project_fetcher_test.go @@ -3,8 +3,8 @@ package ext import ( "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/pkg/ext/task_fetcher.go b/pkg/ext/task_fetcher.go index 2c3366a5..3240c462 100644 --- a/pkg/ext/task_fetcher.go +++ b/pkg/ext/task_fetcher.go @@ -6,8 +6,8 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func (a *AdminFetcherExtClient) FetchAllVerOfTask(ctx context.Context, name, project, domain string, filter filters.Filters) ([]*admin.Task, error) { diff --git a/pkg/ext/task_fetcher_test.go b/pkg/ext/task_fetcher_test.go index 0bfc9ef8..a1f60527 100644 --- a/pkg/ext/task_fetcher_test.go +++ b/pkg/ext/task_fetcher_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/ext/updater.go b/pkg/ext/updater.go index a87afd4c..5121057d 100644 --- a/pkg/ext/updater.go +++ b/pkg/ext/updater.go @@ -3,8 +3,8 @@ package ext import ( "context" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" ) //go:generate mockery -all -case=underscore diff --git a/pkg/ext/updater_test.go b/pkg/ext/updater_test.go index 6e692c44..cdb21cf6 100644 --- a/pkg/ext/updater_test.go +++ b/pkg/ext/updater_test.go @@ -3,7 +3,7 @@ package ext import ( "testing" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ext/workflow_fetcher.go b/pkg/ext/workflow_fetcher.go index 98438e06..7b0bf9d8 100644 --- a/pkg/ext/workflow_fetcher.go +++ b/pkg/ext/workflow_fetcher.go @@ -6,8 +6,8 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) // FetchAllVerOfWorkflow fetches all the versions for give workflow name diff --git a/pkg/ext/workflow_fetcher_test.go b/pkg/ext/workflow_fetcher_test.go index da027566..b035e71a 100644 --- a/pkg/ext/workflow_fetcher_test.go +++ b/pkg/ext/workflow_fetcher_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/filters/util.go b/pkg/filters/util.go index b8584a7a..a19481e3 100644 --- a/pkg/filters/util.go +++ b/pkg/filters/util.go @@ -3,8 +3,8 @@ package filters import ( "strconv" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func BuildResourceListRequestWithName(c Filters, project, domain, name string) (*admin.ResourceListRequest, error) { diff --git a/pkg/filters/util_test.go b/pkg/filters/util_test.go index 98cb9898..c20f315f 100644 --- a/pkg/filters/util_test.go +++ b/pkg/filters/util_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/pkg/github/githubutil.go b/pkg/github/githubutil.go index f76d7f75..8e5403db 100644 --- a/pkg/github/githubutil.go +++ b/pkg/github/githubutil.go @@ -11,8 +11,8 @@ import ( "github.com/flyteorg/flytectl/pkg/platformutil" "github.com/flyteorg/flytectl/pkg/util" - "github.com/flyteorg/flytestdlib/logger" - stdlibversion "github.com/flyteorg/flytestdlib/version" + "github.com/flyteorg/flyte/flytestdlib/logger" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/google/go-github/v42/github" "github.com/mouuff/go-rocket-update/pkg/provider" diff --git a/pkg/github/githubutil_test.go b/pkg/github/githubutil_test.go index ec303bd0..92c015a6 100644 --- a/pkg/github/githubutil_test.go +++ b/pkg/github/githubutil_test.go @@ -8,7 +8,7 @@ import ( "github.com/flyteorg/flytectl/pkg/github/mocks" "github.com/flyteorg/flytectl/pkg/platformutil" - stdlibversion "github.com/flyteorg/flytestdlib/version" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/google/go-github/v42/github" "github.com/stretchr/testify/assert" diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index f1b23d92..0ac9f563 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -10,9 +10,9 @@ import ( "strings" "github.com/flyteorg/flytectl/pkg/visualize" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/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/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" diff --git a/pkg/printer/printer_test.go b/pkg/printer/printer_test.go index 6d5441b9..06d4c2c3 100644 --- a/pkg/printer/printer_test.go +++ b/pkg/printer/printer_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/golang/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/pkg/sandbox/start.go b/pkg/sandbox/start.go index e79ec016..37f19d61 100644 --- a/pkg/sandbox/start.go +++ b/pkg/sandbox/start.go @@ -20,7 +20,7 @@ import ( "github.com/flyteorg/flytectl/pkg/github" "github.com/flyteorg/flytectl/pkg/k8s" "github.com/flyteorg/flytectl/pkg/util" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/kataras/tablewriter" corev1api "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/visualize/graphviz.go b/pkg/visualize/graphviz.go index 08aa1887..d088a251 100644 --- a/pkg/visualize/graphviz.go +++ b/pkg/visualize/graphviz.go @@ -4,10 +4,10 @@ import ( "fmt" "strings" - "github.com/flyteorg/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" graphviz "github.com/awalterschulze/gographviz" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/pkg/visualize/graphviz_test.go b/pkg/visualize/graphviz_test.go index 56b8621e..5a14c03c 100644 --- a/pkg/visualize/graphviz_test.go +++ b/pkg/visualize/graphviz_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/flyteorg/flytectl/pkg/visualize/mocks" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" graphviz "github.com/awalterschulze/gographviz" "github.com/golang/protobuf/jsonpb" From 9706f88748c96059fb3fe4cf328b20637db02380 Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Fri, 6 Oct 2023 13:02:03 -0700 Subject: [PATCH 2/4] group Signed-off-by: Katrina Rogan --- go.mod | 13 ++++++------- go.sum | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index dde2783c..55bd54c6 100644 --- a/go.mod +++ b/go.mod @@ -155,10 +155,9 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) -replace github.com/flyteorg/flyte/flyteidl => github.com/flyteorg/flyte/flyteidl v1.9.12 - -replace github.com/flyteorg/flyte/flytepropeller => github.com/flyteorg/flyte/flytepropeller v1.9.12 - -replace github.com/flyteorg/flyte/flytestdlib => github.com/flyteorg/flyte/flytestdlib v1.9.12 - -replace github.com/flyteorg/flyte/flyteplugins => github.com/flyteorg/flyte/flyteplugins v1.9.12 +replace ( + github.com/flyteorg/flyte/flyteidl => github.com/flyteorg/flyte/flyteidl v1.9.12 + github.com/flyteorg/flyte/flyteplugins => github.com/flyteorg/flyte/flyteplugins v1.9.12 + github.com/flyteorg/flyte/flytepropeller => github.com/flyteorg/flyte/flytepropeller v1.9.12 + github.com/flyteorg/flyte/flytestdlib => github.com/flyteorg/flyte/flytestdlib v1.9.12 +) diff --git a/go.sum b/go.sum index 41cf19c3..4d8b4729 100644 --- a/go.sum +++ b/go.sum @@ -682,6 +682,7 @@ github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= From 99bc6b9f3748f23f8bec7f50f088a8cb28a5c4a1 Mon Sep 17 00:00:00 2001 From: Kamal Eybov <54046807+kamaleybov@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:58:56 -0700 Subject: [PATCH 3/4] Merge with master. Signed-off-by: Kamal Eybov <54046807+kamaleybov@users.noreply.github.com> --- .github/workflows/checks.yml | 3 - clierrors/errors.go | 4 +- cmd/compile/compile.go | 6 +- .../attrupdateconfig_flags.go | 1 + .../attrupdateconfig_flags_test.go | 14 + .../clusterresourceattribute/update_config.go | 1 + cmd/config/subcommand/config/config_flags.go | 1 + .../subcommand/config/config_flags_test.go | 14 + cmd/config/subcommand/config/init_flags.go | 2 + .../subcommand/execution/update_config.go | 1 + .../execution/updateconfig_flags.go | 1 + .../execution/updateconfig_flags_test.go | 14 + .../attrupdateconfig_flags.go | 1 + .../attrupdateconfig_flags_test.go | 14 + .../executionclusterlabel/update_config.go | 1 + .../attrupdateconfig_flags.go | 1 + .../attrupdateconfig_flags_test.go | 14 + .../executionqueueattribute/update_config.go | 1 + .../subcommand/launchplan/updateconfig.go | 1 + .../launchplan/updateconfig_flags.go | 1 + .../launchplan/updateconfig_flags_test.go | 14 + .../plugin_override/attrupdateconfig_flags.go | 1 + .../attrupdateconfig_flags_test.go | 14 + .../plugin_override/update_config.go | 1 + .../subcommand/project/configproject_flags.go | 1 + .../project/configproject_flags_test.go | 14 + .../subcommand/project/project_config.go | 3 +- .../subcommand/project/project_config_test.go | 2 +- .../attrupdateconfig_flags.go | 1 + .../attrupdateconfig_flags_test.go | 14 + .../taskresourceattribute/update_config.go | 1 + .../attrupdateconfig_flags.go | 1 + .../attrupdateconfig_flags_test.go | 14 + .../workflowexecutionconfig/update_config.go | 1 + cmd/configuration/configuration.go | 6 +- cmd/configuration/configuration_test.go | 17 +- cmd/core/cmd.go | 2 +- cmd/core/cmd_ctx.go | 2 +- cmd/create/project.go | 4 +- cmd/delete/execution.go | 6 +- cmd/delete/execution_test.go | 2 +- cmd/delete/matchable_attribute_util.go | 2 +- .../matchable_cluster_resource_attribute.go | 2 +- ...tchable_cluster_resource_attribute_test.go | 2 +- .../matchable_execution_cluster_label.go | 2 +- .../matchable_execution_cluster_label_test.go | 2 +- .../matchable_execution_queue_attribute.go | 2 +- ...atchable_execution_queue_attribute_test.go | 2 +- cmd/delete/matchable_plugin_override.go | 2 +- cmd/delete/matchable_plugin_override_test.go | 2 +- .../matchable_task_resource_attribute.go | 2 +- .../matchable_task_resource_attribute_test.go | 2 +- .../matchable_workflow_execution_config.go | 2 +- ...atchable_workflow_execution_config_test.go | 2 +- cmd/demo/reload.go | 2 +- cmd/get/execution.go | 4 +- cmd/get/execution_test.go | 4 +- cmd/get/execution_util.go | 2 +- cmd/get/launch_plan.go | 4 +- cmd/get/launch_plan_test.go | 4 +- cmd/get/matchable_attribute_util.go | 2 +- .../matchable_cluster_resource_attribute.go | 2 +- ...tchable_cluster_resource_attribute_test.go | 2 +- cmd/get/matchable_execution_cluster_label.go | 2 +- .../matchable_execution_cluster_label_test.go | 2 +- .../matchable_execution_queue_attribute.go | 2 +- ...atchable_execution_queue_attribute_test.go | 2 +- cmd/get/matchable_plugin_override.go | 2 +- cmd/get/matchable_plugin_override_test.go | 2 +- cmd/get/matchable_task_resource_attribute.go | 2 +- .../matchable_task_resource_attribute_test.go | 2 +- .../matchable_workflow_execution_config.go | 4 +- ...atchable_workflow_execution_config_test.go | 2 +- cmd/get/node_execution.go | 4 +- cmd/get/project_test.go | 2 +- cmd/get/task.go | 4 +- cmd/get/task_test.go | 2 +- cmd/get/workflow.go | 2 +- cmd/get/workflow_test.go | 2 +- cmd/register/examples.go | 2 +- cmd/register/files.go | 2 +- cmd/register/files_test.go | 4 +- cmd/register/register_util.go | 8 +- cmd/register/register_util_test.go | 4 +- cmd/root.go | 27 +- cmd/testutils/test_utils.go | 35 +- cmd/update/diff.go | 68 ++ cmd/update/diff_test.go | 62 ++ cmd/update/execution.go | 79 ++- cmd/update/execution_test.go | 264 +++++-- cmd/update/interfaces/updater.go | 2 +- cmd/update/launch_plan.go | 85 ++- cmd/update/launch_plan_meta.go | 5 +- cmd/update/launch_plan_meta_test.go | 195 +++++- cmd/update/launch_plan_test.go | 271 +++++++- cmd/update/matchable_attribute_util.go | 191 +++++- .../matchable_cluster_resource_attribute.go | 7 +- ...tchable_cluster_resource_attribute_test.go | 629 +++++++++++++++-- .../matchable_execution_cluster_label.go | 7 +- .../matchable_execution_cluster_label_test.go | 617 +++++++++++++++-- .../matchable_execution_queue_attribute.go | 7 +- ...atchable_execution_queue_attribute_test.go | 629 +++++++++++++++-- cmd/update/matchable_plugin_override.go | 7 +- cmd/update/matchable_plugin_override_test.go | 647 ++++++++++++++++-- .../matchable_task_resource_attribute.go | 7 +- .../matchable_task_resource_attribute_test.go | 626 +++++++++++++++-- .../matchable_workflow_execution_config.go | 7 +- ...atchable_workflow_execution_config_test.go | 642 +++++++++++++++-- cmd/update/named_entity.go | 99 ++- cmd/update/named_entity_test.go | 106 ++- cmd/update/namedentityconfig_flags.go | 1 + cmd/update/namedentityconfig_flags_test.go | 14 + cmd/update/project.go | 74 +- cmd/update/project_test.go | 331 ++++++--- cmd/update/task_meta.go | 2 +- cmd/update/task_meta_test.go | 191 +++++- .../valid_project_cluster_attribute.yaml | 4 + ...valid_project_execution_cluster_label.yaml | 2 + ...lid_project_execution_queue_attribute.yaml | 6 + .../valid_project_plugin_override.yaml | 7 + .../valid_project_task_attribute.yaml | 7 + ...lid_project_workflow_execution_config.yaml | 2 + cmd/update/update.go | 7 +- cmd/update/update_test.go | 4 - cmd/update/workflow_meta.go | 2 +- cmd/update/workflow_meta_test.go | 191 +++++- cmd/version/version.go | 2 +- cmd/version/version_test.go | 2 +- docs/source/gen/flytectl_config.rst | 2 +- go.mod | 3 +- go.sum | 2 + main.go | 2 +- pkg/ext/attribute_match_fetcher.go | 40 +- pkg/ext/attribute_match_fetcher_test.go | 9 +- pkg/ext/errors.go | 24 + pkg/ext/execution_fetcher.go | 2 +- pkg/ext/fetcher.go | 3 + pkg/ext/mocks/admin_fetcher_ext_interface.go | 41 ++ pkg/ext/project_fetcher.go | 25 + pkg/filters/filters.go | 10 + pkg/filters/filters_test.go | 11 + pkg/filters/util_test.go | 2 +- pkg/github/githubutil.go | 4 +- pkg/github/githubutil_test.go | 2 +- pkg/k8s/k8s_test.go | 2 +- pkg/printer/printer.go | 2 +- pkg/sandbox/start.go | 2 +- pkg/visualize/graphviz_test.go | 2 +- 148 files changed, 5735 insertions(+), 952 deletions(-) create mode 100644 cmd/update/diff.go create mode 100644 cmd/update/diff_test.go create mode 100644 cmd/update/testdata/valid_project_cluster_attribute.yaml create mode 100644 cmd/update/testdata/valid_project_execution_cluster_label.yaml create mode 100644 cmd/update/testdata/valid_project_execution_queue_attribute.yaml create mode 100644 cmd/update/testdata/valid_project_plugin_override.yaml create mode 100644 cmd/update/testdata/valid_project_task_attribute.yaml create mode 100644 cmd/update/testdata/valid_project_workflow_execution_config.yaml create mode 100644 pkg/ext/errors.go diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2a66200d..d7d36c4b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -143,9 +143,6 @@ jobs: - Auto-generated by [flyte-bot] labels: | documentation - team-reviewers: | - owners - maintainers draft: false goreleaser: diff --git a/clierrors/errors.go b/clierrors/errors.go index 3ced52fe..05ab96cb 100644 --- a/clierrors/errors.go +++ b/clierrors/errors.go @@ -6,11 +6,11 @@ var ( ErrProjectNotPassed = "project id wasn't passed\n" // #nosec ErrProjectIDBothPassed = "both project and id are passed\n" ErrProjectNameNotPassed = "project name is a required flag" - ErrFailedProjectUpdate = "Project %v failed to update due to %v\n" + ErrFailedProjectUpdate = "Project %v failed to update due to %w\n" ErrLPNotPassed = "launch plan name wasn't passed\n" ErrLPVersionNotPassed = "launch plan version wasn't passed\n" //nolint - ErrFailedLPUpdate = "launch plan %v failed to update due to %v\n" + ErrFailedLPUpdate = "launch plan %v failed to update due to %w\n" ErrExecutionNotPassed = "execution name wasn't passed\n" ErrFailedExecutionUpdate = "execution %v failed to update due to %v\n" diff --git a/cmd/compile/compile.go b/cmd/compile/compile.go index f3f6753c..035ea786 100644 --- a/cmd/compile/compile.go +++ b/cmd/compile/compile.go @@ -6,13 +6,13 @@ import ( "io/ioutil" "os" - config "github.com/flyteorg/flytectl/cmd/config/subcommand/compile" - cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flytectl/cmd/register" "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" + config "github.com/flyteorg/flytectl/cmd/config/subcommand/compile" + cmdCore "github.com/flyteorg/flytectl/cmd/core" + "github.com/flyteorg/flytectl/cmd/register" ) // Utility function for compiling a list of Tasks diff --git a/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags.go b/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags.go index 4f05b3a8..f0f8103f 100755 --- a/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags.go +++ b/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags.go @@ -52,5 +52,6 @@ func (cfg AttrUpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("AttrUpdateConfig", pflag.ExitOnError) cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") cmdFlags.BoolVar(&DefaultUpdateConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&DefaultUpdateConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultUpdateConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags_test.go b/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags_test.go index 29c93288..9396a2e9 100755 --- a/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags_test.go +++ b/cmd/config/subcommand/clusterresourceattribute/attrupdateconfig_flags_test.go @@ -127,4 +127,18 @@ func TestAttrUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_AttrUpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/clusterresourceattribute/update_config.go b/cmd/config/subcommand/clusterresourceattribute/update_config.go index 3727fbdb..9b4534ee 100644 --- a/cmd/config/subcommand/clusterresourceattribute/update_config.go +++ b/cmd/config/subcommand/clusterresourceattribute/update_config.go @@ -6,6 +6,7 @@ package clusterresourceattribute type AttrUpdateConfig struct { AttrFile string `json:"attrFile" pflag:",attribute file name to be used for updating attribute for the resource type."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } var DefaultUpdateConfig = &AttrUpdateConfig{} diff --git a/cmd/config/subcommand/config/config_flags.go b/cmd/config/subcommand/config/config_flags.go index 35b08563..c3d727a3 100755 --- a/cmd/config/subcommand/config/config_flags.go +++ b/cmd/config/subcommand/config/config_flags.go @@ -53,5 +53,6 @@ func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.StringVar(&DefaultConfig.Console, fmt.Sprintf("%v%v", prefix, "console"), DefaultConfig.Console, "Endpoint of console, if different than flyte admin") cmdFlags.StringVar(&DefaultConfig.Host, fmt.Sprintf("%v%v", prefix, "host"), DefaultConfig.Host, "Endpoint of flyte admin") cmdFlags.BoolVar(&DefaultConfig.Insecure, fmt.Sprintf("%v%v", prefix, "insecure"), DefaultConfig.Insecure, "Enable insecure mode") + cmdFlags.BoolVar(&DefaultConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultConfig.Force, "Force to overwrite the default config file without confirmation") return cmdFlags } diff --git a/cmd/config/subcommand/config/config_flags_test.go b/cmd/config/subcommand/config/config_flags_test.go index 142d145b..51f52abb 100755 --- a/cmd/config/subcommand/config/config_flags_test.go +++ b/cmd/config/subcommand/config/config_flags_test.go @@ -141,4 +141,18 @@ func TestConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_Config(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/config/init_flags.go b/cmd/config/subcommand/config/init_flags.go index 9c31fa99..cbb8e60b 100755 --- a/cmd/config/subcommand/config/init_flags.go +++ b/cmd/config/subcommand/config/init_flags.go @@ -4,6 +4,7 @@ package config var ( DefaultConfig = &Config{ Insecure: false, + Force: false, } ) @@ -12,4 +13,5 @@ type Config struct { Console string `json:"console" pflag:",Endpoint of console, if different than flyte admin"` Host string `json:"host" pflag:",Endpoint of flyte admin"` Insecure bool `json:"insecure" pflag:",Enable insecure mode"` + Force bool `json:"force" pflag:",Force to overwrite the default config file without confirmation"` } diff --git a/cmd/config/subcommand/execution/update_config.go b/cmd/config/subcommand/execution/update_config.go index 86234357..7d55a5e9 100644 --- a/cmd/config/subcommand/execution/update_config.go +++ b/cmd/config/subcommand/execution/update_config.go @@ -10,4 +10,5 @@ type UpdateConfig struct { Archive bool `json:"archive" pflag:",archive execution."` Activate bool `json:"activate" pflag:",activate execution."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } diff --git a/cmd/config/subcommand/execution/updateconfig_flags.go b/cmd/config/subcommand/execution/updateconfig_flags.go index 03c9d0f9..a1b251c1 100755 --- a/cmd/config/subcommand/execution/updateconfig_flags.go +++ b/cmd/config/subcommand/execution/updateconfig_flags.go @@ -53,5 +53,6 @@ func (cfg UpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.BoolVar(&UConfig.Archive, fmt.Sprintf("%v%v", prefix, "archive"), UConfig.Archive, "archive execution.") cmdFlags.BoolVar(&UConfig.Activate, fmt.Sprintf("%v%v", prefix, "activate"), UConfig.Activate, "activate execution.") cmdFlags.BoolVar(&UConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), UConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&UConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), UConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/config/subcommand/execution/updateconfig_flags_test.go b/cmd/config/subcommand/execution/updateconfig_flags_test.go index 6c65c2d1..2e6c693e 100755 --- a/cmd/config/subcommand/execution/updateconfig_flags_test.go +++ b/cmd/config/subcommand/execution/updateconfig_flags_test.go @@ -141,4 +141,18 @@ func TestUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_UpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags.go b/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags.go index 8b1beee0..979e08ea 100755 --- a/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags.go +++ b/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags.go @@ -52,5 +52,6 @@ func (cfg AttrUpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("AttrUpdateConfig", pflag.ExitOnError) cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") cmdFlags.BoolVar(&DefaultUpdateConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&DefaultUpdateConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultUpdateConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags_test.go b/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags_test.go index 4712ba31..e2a8fe2a 100755 --- a/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags_test.go +++ b/cmd/config/subcommand/executionclusterlabel/attrupdateconfig_flags_test.go @@ -127,4 +127,18 @@ func TestAttrUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_AttrUpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/executionclusterlabel/update_config.go b/cmd/config/subcommand/executionclusterlabel/update_config.go index 62d853a7..be0de45c 100644 --- a/cmd/config/subcommand/executionclusterlabel/update_config.go +++ b/cmd/config/subcommand/executionclusterlabel/update_config.go @@ -6,6 +6,7 @@ package executionclusterlabel type AttrUpdateConfig struct { AttrFile string `json:"attrFile" pflag:",attribute file name to be used for updating attribute for the resource type."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } var DefaultUpdateConfig = &AttrUpdateConfig{} diff --git a/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags.go b/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags.go index cff8301f..7643a980 100755 --- a/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags.go +++ b/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags.go @@ -52,5 +52,6 @@ func (cfg AttrUpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("AttrUpdateConfig", pflag.ExitOnError) cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") cmdFlags.BoolVar(&DefaultUpdateConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&DefaultUpdateConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultUpdateConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags_test.go b/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags_test.go index ff19cfa4..82c697d1 100755 --- a/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags_test.go +++ b/cmd/config/subcommand/executionqueueattribute/attrupdateconfig_flags_test.go @@ -127,4 +127,18 @@ func TestAttrUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_AttrUpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/executionqueueattribute/update_config.go b/cmd/config/subcommand/executionqueueattribute/update_config.go index 7826602a..65dd680d 100644 --- a/cmd/config/subcommand/executionqueueattribute/update_config.go +++ b/cmd/config/subcommand/executionqueueattribute/update_config.go @@ -6,6 +6,7 @@ package executionqueueattribute type AttrUpdateConfig struct { AttrFile string `json:"attrFile" pflag:",attribute file name to be used for updating attribute for the resource type."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } var DefaultUpdateConfig = &AttrUpdateConfig{} diff --git a/cmd/config/subcommand/launchplan/updateconfig.go b/cmd/config/subcommand/launchplan/updateconfig.go index b7bd87bb..36e353c2 100644 --- a/cmd/config/subcommand/launchplan/updateconfig.go +++ b/cmd/config/subcommand/launchplan/updateconfig.go @@ -10,5 +10,6 @@ type UpdateConfig struct { Archive bool `json:"archive" pflag:",disable the launch plan schedule (if it has an active schedule associated with it)."` Activate bool `json:"activate" pflag:",activate launchplan."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` Version string `json:"version" pflag:",version of the launchplan to be fetched."` } diff --git a/cmd/config/subcommand/launchplan/updateconfig_flags.go b/cmd/config/subcommand/launchplan/updateconfig_flags.go index 14570a00..4a9cad23 100755 --- a/cmd/config/subcommand/launchplan/updateconfig_flags.go +++ b/cmd/config/subcommand/launchplan/updateconfig_flags.go @@ -53,6 +53,7 @@ func (cfg UpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.BoolVar(&UConfig.Archive, fmt.Sprintf("%v%v", prefix, "archive"), UConfig.Archive, "disable the launch plan schedule (if it has an active schedule associated with it).") cmdFlags.BoolVar(&UConfig.Activate, fmt.Sprintf("%v%v", prefix, "activate"), UConfig.Activate, "activate launchplan.") cmdFlags.BoolVar(&UConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), UConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&UConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), UConfig.Force, "do not ask for an acknowledgement during updates.") cmdFlags.StringVar(&UConfig.Version, fmt.Sprintf("%v%v", prefix, "version"), UConfig.Version, "version of the launchplan to be fetched.") return cmdFlags } diff --git a/cmd/config/subcommand/launchplan/updateconfig_flags_test.go b/cmd/config/subcommand/launchplan/updateconfig_flags_test.go index a0d1c1ad..e9acca7b 100755 --- a/cmd/config/subcommand/launchplan/updateconfig_flags_test.go +++ b/cmd/config/subcommand/launchplan/updateconfig_flags_test.go @@ -141,6 +141,20 @@ func TestUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_UpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) t.Run("Test_version", func(t *testing.T) { t.Run("Override", func(t *testing.T) { diff --git a/cmd/config/subcommand/plugin_override/attrupdateconfig_flags.go b/cmd/config/subcommand/plugin_override/attrupdateconfig_flags.go index 8642031b..82e5cb66 100755 --- a/cmd/config/subcommand/plugin_override/attrupdateconfig_flags.go +++ b/cmd/config/subcommand/plugin_override/attrupdateconfig_flags.go @@ -52,5 +52,6 @@ func (cfg AttrUpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("AttrUpdateConfig", pflag.ExitOnError) cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") cmdFlags.BoolVar(&DefaultUpdateConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&DefaultUpdateConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultUpdateConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/config/subcommand/plugin_override/attrupdateconfig_flags_test.go b/cmd/config/subcommand/plugin_override/attrupdateconfig_flags_test.go index 84628be5..309c3174 100755 --- a/cmd/config/subcommand/plugin_override/attrupdateconfig_flags_test.go +++ b/cmd/config/subcommand/plugin_override/attrupdateconfig_flags_test.go @@ -127,4 +127,18 @@ func TestAttrUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_AttrUpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/plugin_override/update_config.go b/cmd/config/subcommand/plugin_override/update_config.go index 8e99970d..dc3c2600 100644 --- a/cmd/config/subcommand/plugin_override/update_config.go +++ b/cmd/config/subcommand/plugin_override/update_config.go @@ -6,6 +6,7 @@ package pluginoverride type AttrUpdateConfig struct { AttrFile string `json:"attrFile" pflag:",attribute file name to be used for updating attribute for the resource type."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } var DefaultUpdateConfig = &AttrUpdateConfig{} diff --git a/cmd/config/subcommand/project/configproject_flags.go b/cmd/config/subcommand/project/configproject_flags.go index e0e1c75f..6de8107e 100755 --- a/cmd/config/subcommand/project/configproject_flags.go +++ b/cmd/config/subcommand/project/configproject_flags.go @@ -55,6 +55,7 @@ func (cfg ConfigProject) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.BoolVar(&DefaultProjectConfig.ArchiveProject, fmt.Sprintf("%v%v", prefix, "archiveProject"), DefaultProjectConfig.ArchiveProject, "(Deprecated) Archives the project specified as argument. Only used in update") cmdFlags.BoolVar(&DefaultProjectConfig.Activate, fmt.Sprintf("%v%v", prefix, "activate"), DefaultProjectConfig.Activate, "Activates the project specified as argument. Only used in update") cmdFlags.BoolVar(&DefaultProjectConfig.Archive, fmt.Sprintf("%v%v", prefix, "archive"), DefaultProjectConfig.Archive, "Archives the project specified as argument. Only used in update") + cmdFlags.BoolVar(&DefaultProjectConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultProjectConfig.Force, "Skips asking for an acknowledgement during an update operation. Only used in update") cmdFlags.StringVar(&DefaultProjectConfig.Name, fmt.Sprintf("%v%v", prefix, "name"), DefaultProjectConfig.Name, "name for the project specified as argument.") cmdFlags.BoolVar(&DefaultProjectConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultProjectConfig.DryRun, "execute command without making any modifications.") cmdFlags.StringVar(&DefaultProjectConfig.Description, fmt.Sprintf("%v%v", prefix, "description"), DefaultProjectConfig.Description, "description for the project specified as argument.") diff --git a/cmd/config/subcommand/project/configproject_flags_test.go b/cmd/config/subcommand/project/configproject_flags_test.go index abe5e1e6..98847d77 100755 --- a/cmd/config/subcommand/project/configproject_flags_test.go +++ b/cmd/config/subcommand/project/configproject_flags_test.go @@ -169,6 +169,20 @@ func TestConfigProject_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_ConfigProject(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) t.Run("Test_name", func(t *testing.T) { t.Run("Override", func(t *testing.T) { diff --git a/cmd/config/subcommand/project/project_config.go b/cmd/config/subcommand/project/project_config.go index 38f13136..794f661d 100644 --- a/cmd/config/subcommand/project/project_config.go +++ b/cmd/config/subcommand/project/project_config.go @@ -4,10 +4,10 @@ import ( "fmt" "io/ioutil" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/pkg/filters" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "gopkg.in/yaml.v3" ) @@ -33,6 +33,7 @@ type ConfigProject struct { ArchiveProject bool `json:"archiveProject" pflag:",(Deprecated) Archives the project specified as argument. Only used in update"` Activate bool `json:"activate" pflag:",Activates the project specified as argument. Only used in update"` Archive bool `json:"archive" pflag:",Archives the project specified as argument. Only used in update"` + Force bool `json:"force" pflag:",Skips asking for an acknowledgement during an update operation. Only used in update"` Name string `json:"name" pflag:",name for the project specified as argument."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` Description string `json:"description" pflag:",description for the project specified as argument."` diff --git a/cmd/config/subcommand/project/project_config_test.go b/cmd/config/subcommand/project/project_config_test.go index d66aff2c..69a8bf4a 100644 --- a/cmd/config/subcommand/project/project_config_test.go +++ b/cmd/config/subcommand/project/project_config_test.go @@ -4,9 +4,9 @@ import ( "errors" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" ) diff --git a/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags.go b/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags.go index 1a0e3e3a..402add1c 100755 --- a/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags.go +++ b/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags.go @@ -52,5 +52,6 @@ func (cfg AttrUpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("AttrUpdateConfig", pflag.ExitOnError) cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") cmdFlags.BoolVar(&DefaultUpdateConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&DefaultUpdateConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultUpdateConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags_test.go b/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags_test.go index 2a141e04..aaf429a7 100755 --- a/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags_test.go +++ b/cmd/config/subcommand/taskresourceattribute/attrupdateconfig_flags_test.go @@ -127,4 +127,18 @@ func TestAttrUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_AttrUpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/taskresourceattribute/update_config.go b/cmd/config/subcommand/taskresourceattribute/update_config.go index 084c65d6..4ee836e4 100644 --- a/cmd/config/subcommand/taskresourceattribute/update_config.go +++ b/cmd/config/subcommand/taskresourceattribute/update_config.go @@ -6,6 +6,7 @@ package taskresourceattribute type AttrUpdateConfig struct { AttrFile string `json:"attrFile" pflag:",attribute file name to be used for updating attribute for the resource type."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } var DefaultUpdateConfig = &AttrUpdateConfig{} diff --git a/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags.go b/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags.go index 571daa90..a8423cdb 100755 --- a/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags.go +++ b/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags.go @@ -52,5 +52,6 @@ func (cfg AttrUpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("AttrUpdateConfig", pflag.ExitOnError) cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") cmdFlags.BoolVar(&DefaultUpdateConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&DefaultUpdateConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), DefaultUpdateConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags_test.go b/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags_test.go index 5707cccb..5c470ca0 100755 --- a/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags_test.go +++ b/cmd/config/subcommand/workflowexecutionconfig/attrupdateconfig_flags_test.go @@ -127,4 +127,18 @@ func TestAttrUpdateConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_AttrUpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/config/subcommand/workflowexecutionconfig/update_config.go b/cmd/config/subcommand/workflowexecutionconfig/update_config.go index 7fd6a1de..2b244000 100644 --- a/cmd/config/subcommand/workflowexecutionconfig/update_config.go +++ b/cmd/config/subcommand/workflowexecutionconfig/update_config.go @@ -6,6 +6,7 @@ package workflowexecutionconfig type AttrUpdateConfig struct { AttrFile string `json:"attrFile" pflag:",attribute file name to be used for updating attribute for the resource type."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } var DefaultUpdateConfig = &AttrUpdateConfig{} diff --git a/cmd/configuration/configuration.go b/cmd/configuration/configuration.go index a11fab3a..7f06f920 100644 --- a/cmd/configuration/configuration.go +++ b/cmd/configuration/configuration.go @@ -12,10 +12,10 @@ import ( "github.com/flyteorg/flytectl/pkg/configutil" + "github.com/flyteorg/flyte/flytestdlib/config/viper" initConfig "github.com/flyteorg/flytectl/cmd/config/subcommand/config" cmdcore "github.com/flyteorg/flytectl/cmd/core" cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" - "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/go-ozzo/ozzo-validation/v4/is" "github.com/spf13/cobra" ) @@ -70,6 +70,8 @@ func CreateConfigCommand() *cobra.Command { Long: initCmdLong, PFlagProvider: initConfig.DefaultConfig}, } + configCmd.Flags().BoolVar(&initConfig.DefaultConfig.Force, "force", false, "Force to overwrite the default config file without confirmation") + cmdcore.AddCommands(configCmd, getResourcesFuncs) return configCmd } @@ -109,7 +111,7 @@ func initFlytectlConfig(reader io.Reader) error { if _, err := os.Stat(configutil.ConfigFile); os.IsNotExist(err) { _err = configutil.SetupConfig(configutil.ConfigFile, templateStr, templateValues) } else { - if cmdUtil.AskForConfirmation(fmt.Sprintf("This action will overwrite an existing config file at [%s]. Do you want to continue?", configutil.ConfigFile), reader) { + if initConfig.DefaultConfig.Force || cmdUtil.AskForConfirmation(fmt.Sprintf("This action will overwrite an existing config file at [%s]. Do you want to continue?", configutil.ConfigFile), reader) { if err := os.Remove(configutil.ConfigFile); err != nil { return err } diff --git a/cmd/configuration/configuration_test.go b/cmd/configuration/configuration_test.go index 59f8ddc3..f48fe84e 100644 --- a/cmd/configuration/configuration_test.go +++ b/cmd/configuration/configuration_test.go @@ -35,18 +35,18 @@ func TestCreateInitCommand(t *testing.T) { assert.Equal(t, "discover", cmdNouns[0].Use) assert.Equal(t, "Searches for a config in one of the default search paths.", cmdNouns[0].Short) assert.Equal(t, "docs", cmdNouns[1].Use) - assert.Equal(t, "Generate configuration documetation in rst format", cmdNouns[1].Short) + assert.Equal(t, "Generate configuration documentation in rst format", cmdNouns[1].Short) assert.Equal(t, "init", cmdNouns[2].Use) assert.Equal(t, initCmdShort, cmdNouns[2].Short) assert.Equal(t, "validate", cmdNouns[3].Use) assert.Equal(t, "Validates the loaded config.", cmdNouns[3].Short) - } func TestSetupConfigFunc(t *testing.T) { var yes = strings.NewReader("Yes") var no = strings.NewReader("No") + var empty = strings.NewReader("") mockOutStream := new(io.Writer) ctx := context.Background() _ = os.Remove(configutil.FlytectlConfig) @@ -59,8 +59,13 @@ func TestSetupConfigFunc(t *testing.T) { initConfig.DefaultConfig.Host = "" assert.Nil(t, err) + initConfig.DefaultConfig.Force = false assert.Nil(t, initFlytectlConfig(yes)) assert.Nil(t, initFlytectlConfig(no)) + + initConfig.DefaultConfig.Force = true + assert.Nil(t, initFlytectlConfig(empty)) + initConfig.DefaultConfig.Host = "flyte.org" assert.Nil(t, initFlytectlConfig(no)) initConfig.DefaultConfig.Host = "localhost:30081" @@ -86,3 +91,11 @@ func TestValidateEndpointName(t *testing.T) { assert.Equal(t, false, validateEndpointName("112.11.1.1:8080/console")) assert.Equal(t, false, validateEndpointName("flyte")) } + +func TestForceFlagInCreateConfigCommand(t *testing.T) { + cmd := CreateConfigCommand() + assert.False(t, initConfig.DefaultConfig.Force) + err := cmd.Flags().Parse([]string{"--force"}) + assert.Nil(t, err) + assert.True(t, initConfig.DefaultConfig.Force) +} diff --git a/cmd/core/cmd.go b/cmd/core/cmd.go index 2555cb4a..2d00adc0 100644 --- a/cmd/core/cmd.go +++ b/cmd/core/cmd.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/pkg/pkce" - "github.com/flyteorg/flyte/flyteidl/clients/go/admin" "github.com/spf13/cobra" "github.com/spf13/pflag" diff --git a/cmd/core/cmd_ctx.go b/cmd/core/cmd_ctx.go index d42fdee5..d492c53c 100644 --- a/cmd/core/cmd_ctx.go +++ b/cmd/core/cmd_ctx.go @@ -5,8 +5,8 @@ import ( "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - "github.com/flyteorg/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flytectl/pkg/ext" ) type CommandContext struct { diff --git a/cmd/create/project.go b/cmd/create/project.go index 60bfa3f3..bf4e70c0 100644 --- a/cmd/create/project.go +++ b/cmd/create/project.go @@ -4,13 +4,13 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/project" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flyte/flytestdlib/logger" + cmdCore "github.com/flyteorg/flytectl/cmd/core" ) const ( diff --git a/cmd/delete/execution.go b/cmd/delete/execution.go index 1a9003c2..5d2e0ff4 100644 --- a/cmd/delete/execution.go +++ b/cmd/delete/execution.go @@ -3,12 +3,12 @@ package delete import ( "context" - "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" - cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flytectl/cmd/config" + "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" + cmdCore "github.com/flyteorg/flytectl/cmd/core" ) // Long descriptions are whitespace sensitive when generating docs using Sphinx. diff --git a/cmd/delete/execution_test.go b/cmd/delete/execution_test.go index 38469d59..63643a2c 100644 --- a/cmd/delete/execution_test.go +++ b/cmd/delete/execution_test.go @@ -4,9 +4,9 @@ import ( "errors" "testing" - "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/cmd/config" "github.com/stretchr/testify/assert" ) diff --git a/cmd/delete/matchable_attribute_util.go b/cmd/delete/matchable_attribute_util.go index efdd0d74..63c018cb 100644 --- a/cmd/delete/matchable_attribute_util.go +++ b/cmd/delete/matchable_attribute_util.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/flyteorg/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flytectl/pkg/ext" ) func deleteMatchableAttr(ctx context.Context, project, domain, workflowName string, diff --git a/cmd/delete/matchable_cluster_resource_attribute.go b/cmd/delete/matchable_cluster_resource_attribute.go index b1a5251f..5b7a04f8 100644 --- a/cmd/delete/matchable_cluster_resource_attribute.go +++ b/cmd/delete/matchable_cluster_resource_attribute.go @@ -3,11 +3,11 @@ package delete import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_cluster_resource_attribute_test.go b/cmd/delete/matchable_cluster_resource_attribute_test.go index 689cbe31..37dd1394 100644 --- a/cmd/delete/matchable_cluster_resource_attribute_test.go +++ b/cmd/delete/matchable_cluster_resource_attribute_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_execution_cluster_label.go b/cmd/delete/matchable_execution_cluster_label.go index 787c6475..544b8ae6 100644 --- a/cmd/delete/matchable_execution_cluster_label.go +++ b/cmd/delete/matchable_execution_cluster_label.go @@ -3,11 +3,11 @@ package delete import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_execution_cluster_label_test.go b/cmd/delete/matchable_execution_cluster_label_test.go index 9b697d5f..f7cc5e7f 100644 --- a/cmd/delete/matchable_execution_cluster_label_test.go +++ b/cmd/delete/matchable_execution_cluster_label_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_execution_queue_attribute.go b/cmd/delete/matchable_execution_queue_attribute.go index 004821fc..082cfec4 100644 --- a/cmd/delete/matchable_execution_queue_attribute.go +++ b/cmd/delete/matchable_execution_queue_attribute.go @@ -3,11 +3,11 @@ package delete import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_execution_queue_attribute_test.go b/cmd/delete/matchable_execution_queue_attribute_test.go index e911a0c6..734323d9 100644 --- a/cmd/delete/matchable_execution_queue_attribute_test.go +++ b/cmd/delete/matchable_execution_queue_attribute_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_plugin_override.go b/cmd/delete/matchable_plugin_override.go index 1fda9459..76b90b02 100644 --- a/cmd/delete/matchable_plugin_override.go +++ b/cmd/delete/matchable_plugin_override.go @@ -3,11 +3,11 @@ package delete import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_plugin_override_test.go b/cmd/delete/matchable_plugin_override_test.go index 7c1f6667..1dcd10ca 100644 --- a/cmd/delete/matchable_plugin_override_test.go +++ b/cmd/delete/matchable_plugin_override_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_task_resource_attribute.go b/cmd/delete/matchable_task_resource_attribute.go index 4f355f1f..3bd3f4d3 100644 --- a/cmd/delete/matchable_task_resource_attribute.go +++ b/cmd/delete/matchable_task_resource_attribute.go @@ -3,11 +3,11 @@ package delete import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_task_resource_attribute_test.go b/cmd/delete/matchable_task_resource_attribute_test.go index be3a18c6..33744489 100644 --- a/cmd/delete/matchable_task_resource_attribute_test.go +++ b/cmd/delete/matchable_task_resource_attribute_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/delete/matchable_workflow_execution_config.go b/cmd/delete/matchable_workflow_execution_config.go index 00d591b6..a284ca6d 100644 --- a/cmd/delete/matchable_workflow_execution_config.go +++ b/cmd/delete/matchable_workflow_execution_config.go @@ -5,10 +5,10 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/delete/matchable_workflow_execution_config_test.go b/cmd/delete/matchable_workflow_execution_config_test.go index 07206538..b3c41b09 100644 --- a/cmd/delete/matchable_workflow_execution_config_test.go +++ b/cmd/delete/matchable_workflow_execution_config_test.go @@ -6,8 +6,8 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flytectl/cmd/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/demo/reload.go b/cmd/demo/reload.go index faf6663d..05c1ccfd 100644 --- a/cmd/demo/reload.go +++ b/cmd/demo/reload.go @@ -4,10 +4,10 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flytestdlib/logger" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/docker" "github.com/flyteorg/flytectl/pkg/k8s" - "github.com/flyteorg/flyte/flytestdlib/logger" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/cmd/get/execution.go b/cmd/get/execution.go index 21b8d03d..55f9d26b 100644 --- a/cmd/get/execution.go +++ b/cmd/get/execution.go @@ -4,12 +4,12 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" ) diff --git a/cmd/get/execution_test.go b/cmd/get/execution_test.go index ca88b90c..635ccce8 100644 --- a/cmd/get/execution_test.go +++ b/cmd/get/execution_test.go @@ -8,10 +8,10 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/cmd/config" + "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/execution_util.go b/cmd/get/execution_util.go index 2a2d3482..fc5e6500 100644 --- a/cmd/get/execution_util.go +++ b/cmd/get/execution_util.go @@ -8,10 +8,10 @@ import ( "gopkg.in/yaml.v3" - cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" ) // ExecutionConfig is duplicated struct from create with the same structure. This is to avoid the circular dependency. Only works with go-yaml. diff --git a/cmd/get/launch_plan.go b/cmd/get/launch_plan.go index 5f17729e..1e230416 100644 --- a/cmd/get/launch_plan.go +++ b/cmd/get/launch_plan.go @@ -4,13 +4,13 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/ext" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" ) diff --git a/cmd/get/launch_plan_test.go b/cmd/get/launch_plan_test.go index 9dda91c5..87085716 100644 --- a/cmd/get/launch_plan_test.go +++ b/cmd/get/launch_plan_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" "github.com/flyteorg/flytectl/pkg/ext/mocks" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/cmd/get/matchable_attribute_util.go b/cmd/get/matchable_attribute_util.go index 85cca29f..df4468c6 100644 --- a/cmd/get/matchable_attribute_util.go +++ b/cmd/get/matchable_attribute_util.go @@ -3,9 +3,9 @@ package get import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func FetchAndUnDecorateMatchableAttr(ctx context.Context, project, domain, workflowName string, diff --git a/cmd/get/matchable_cluster_resource_attribute.go b/cmd/get/matchable_cluster_resource_attribute.go index 5074a7c9..a9fd0b40 100644 --- a/cmd/get/matchable_cluster_resource_attribute.go +++ b/cmd/get/matchable_cluster_resource_attribute.go @@ -3,11 +3,11 @@ package get import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_cluster_resource_attribute_test.go b/cmd/get/matchable_cluster_resource_attribute_test.go index 6cc0a60e..6e601f3c 100644 --- a/cmd/get/matchable_cluster_resource_attribute_test.go +++ b/cmd/get/matchable_cluster_resource_attribute_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_execution_cluster_label.go b/cmd/get/matchable_execution_cluster_label.go index be3f46fb..e47e17ff 100644 --- a/cmd/get/matchable_execution_cluster_label.go +++ b/cmd/get/matchable_execution_cluster_label.go @@ -3,11 +3,11 @@ package get import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_execution_cluster_label_test.go b/cmd/get/matchable_execution_cluster_label_test.go index 5db7f9d0..e418a5fc 100644 --- a/cmd/get/matchable_execution_cluster_label_test.go +++ b/cmd/get/matchable_execution_cluster_label_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_execution_queue_attribute.go b/cmd/get/matchable_execution_queue_attribute.go index 5af523fe..f5ac300a 100644 --- a/cmd/get/matchable_execution_queue_attribute.go +++ b/cmd/get/matchable_execution_queue_attribute.go @@ -3,11 +3,11 @@ package get import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_execution_queue_attribute_test.go b/cmd/get/matchable_execution_queue_attribute_test.go index ecb1080b..a47b9c78 100644 --- a/cmd/get/matchable_execution_queue_attribute_test.go +++ b/cmd/get/matchable_execution_queue_attribute_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_plugin_override.go b/cmd/get/matchable_plugin_override.go index cdf4748a..be6a1004 100644 --- a/cmd/get/matchable_plugin_override.go +++ b/cmd/get/matchable_plugin_override.go @@ -3,11 +3,11 @@ package get import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_plugin_override_test.go b/cmd/get/matchable_plugin_override_test.go index 91f1f1e9..a4f6c125 100644 --- a/cmd/get/matchable_plugin_override_test.go +++ b/cmd/get/matchable_plugin_override_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_task_resource_attribute.go b/cmd/get/matchable_task_resource_attribute.go index 98f9babb..63ec6906 100644 --- a/cmd/get/matchable_task_resource_attribute.go +++ b/cmd/get/matchable_task_resource_attribute.go @@ -3,11 +3,11 @@ package get import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/get/matchable_task_resource_attribute_test.go b/cmd/get/matchable_task_resource_attribute_test.go index 7e6c9a98..c21ddcd9 100644 --- a/cmd/get/matchable_task_resource_attribute_test.go +++ b/cmd/get/matchable_task_resource_attribute_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/matchable_workflow_execution_config.go b/cmd/get/matchable_workflow_execution_config.go index 457b53b1..ba414f78 100644 --- a/cmd/get/matchable_workflow_execution_config.go +++ b/cmd/get/matchable_workflow_execution_config.go @@ -4,12 +4,12 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/cmd/config" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/cmd/get/matchable_workflow_execution_config_test.go b/cmd/get/matchable_workflow_execution_config_test.go index 046873e6..0f9658c7 100644 --- a/cmd/get/matchable_workflow_execution_config_test.go +++ b/cmd/get/matchable_workflow_execution_config_test.go @@ -7,9 +7,9 @@ import ( "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/cmd/get/node_execution.go b/cmd/get/node_execution.go index e719e070..bec0a5a9 100644 --- a/cmd/get/node_execution.go +++ b/cmd/get/node_execution.go @@ -7,11 +7,11 @@ import ( "sort" "strconv" - cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flytectl/pkg/printer" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + cmdCore "github.com/flyteorg/flytectl/cmd/core" + "github.com/flyteorg/flytectl/pkg/printer" "github.com/disiqueira/gotree" "github.com/golang/protobuf/jsonpb" diff --git a/cmd/get/project_test.go b/cmd/get/project_test.go index 3380e492..7efed267 100644 --- a/cmd/get/project_test.go +++ b/cmd/get/project_test.go @@ -8,8 +8,8 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/project" - "github.com/flyteorg/flytectl/pkg/filters" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flytectl/pkg/filters" "github.com/stretchr/testify/assert" ) diff --git a/cmd/get/task.go b/cmd/get/task.go index 7e346b23..b5e1b13d 100644 --- a/cmd/get/task.go +++ b/cmd/get/task.go @@ -3,13 +3,13 @@ package get import ( "context" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flytectl/cmd/config" taskConfig "github.com/flyteorg/flytectl/cmd/config/subcommand/task" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/ext" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" ) diff --git a/cmd/get/task_test.go b/cmd/get/task_test.go index 5c6b279b..2429f381 100644 --- a/cmd/get/task_test.go +++ b/cmd/get/task_test.go @@ -15,9 +15,9 @@ import ( "github.com/stretchr/testify/mock" - "github.com/flyteorg/flytectl/pkg/ext/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/pkg/ext/mocks" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/cmd/get/workflow.go b/cmd/get/workflow.go index 4d95e615..d59437a3 100644 --- a/cmd/get/workflow.go +++ b/cmd/get/workflow.go @@ -3,9 +3,9 @@ package get import ( "context" + "github.com/flyteorg/flyte/flytestdlib/logger" workflowconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/workflow" "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/golang/protobuf/proto" "github.com/flyteorg/flytectl/cmd/config" diff --git a/cmd/get/workflow_test.go b/cmd/get/workflow_test.go index 17f62219..e534e373 100644 --- a/cmd/get/workflow_test.go +++ b/cmd/get/workflow_test.go @@ -15,9 +15,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/flyteorg/flytectl/pkg/ext/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/pkg/ext/mocks" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflow" ) diff --git a/cmd/register/examples.go b/cmd/register/examples.go index a6e9f1e2..fdccad08 100644 --- a/cmd/register/examples.go +++ b/cmd/register/examples.go @@ -4,11 +4,11 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flytectl/cmd/config" rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" cmdCore "github.com/flyteorg/flytectl/cmd/core" g "github.com/flyteorg/flytectl/pkg/github" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/google/go-github/v42/github" ) diff --git a/cmd/register/files.go b/cmd/register/files.go index 5582305b..f9b70696 100644 --- a/cmd/register/files.go +++ b/cmd/register/files.go @@ -10,10 +10,10 @@ import ( "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/flyteorg/flyte/flytestdlib/logger" rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" - "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/cmd/register/files_test.go b/cmd/register/files_test.go index ee5aad7f..0eec7701 100644 --- a/cmd/register/files_test.go +++ b/cmd/register/files_test.go @@ -7,13 +7,13 @@ import ( "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" - "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/flyteorg/flytectl/cmd/config" - rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" "github.com/flyteorg/flyte/flytestdlib/promutils" + rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/cmd/register/register_util.go b/cmd/register/register_util.go index 87ef7ac7..9c9a2e70 100644 --- a/cmd/register/register_util.go +++ b/cmd/register/register_util.go @@ -29,14 +29,14 @@ import ( "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/flyteorg/flytectl/cmd/config" - rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" - cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flytectl/pkg/printer" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/flyteorg/flytectl/cmd/config" + rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" + cmdCore "github.com/flyteorg/flytectl/cmd/core" + "github.com/flyteorg/flytectl/pkg/printer" "github.com/google/go-github/v42/github" "github.com/golang/protobuf/jsonpb" diff --git a/cmd/register/register_util_test.go b/cmd/register/register_util_test.go index 705b491c..94dc1912 100644 --- a/cmd/register/register_util_test.go +++ b/cmd/register/register_util_test.go @@ -12,9 +12,9 @@ import ( "strings" "testing" - ghMocks "github.com/flyteorg/flytectl/pkg/github/mocks" "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + ghMocks "github.com/flyteorg/flytectl/pkg/github/mocks" "github.com/flyteorg/flyte/flytestdlib/utils" @@ -27,8 +27,8 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + rconfig "github.com/flyteorg/flytectl/cmd/config/subcommand/register" "github.com/google/go-github/v42/github" "github.com/stretchr/testify/assert" diff --git a/cmd/root.go b/cmd/root.go index 4f651e8c..418406c0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -5,6 +5,8 @@ import ( "fmt" "os" + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/flyteorg/flytectl/cmd/compile" "github.com/flyteorg/flytectl/cmd/config" configuration "github.com/flyteorg/flytectl/cmd/configuration" @@ -20,8 +22,6 @@ import ( "github.com/flyteorg/flytectl/cmd/version" f "github.com/flyteorg/flytectl/pkg/filesystemutils" "github.com/flyteorg/flytectl/pkg/printer" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -78,6 +78,29 @@ func newRootCmd() *cobra.Command { config.GetConfig() + // hide global flags + rootCmd.SetUsageTemplate(`Usage:{{if .Runnable}} + {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} + {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} + +Aliases: + {{.NameAndAliases}}{{end}}{{if .HasExample}} + +Examples: +{{.Example}}{{end}}{{if .HasAvailableSubCommands}} + +Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} + +Flags: +{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} + +Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} + {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} + +Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} +`) + return rootCmd } diff --git a/cmd/testutils/test_utils.go b/cmd/testutils/test_utils.go index 6a16fa45..28b78566 100644 --- a/cmd/testutils/test_utils.go +++ b/cmd/testutils/test_utils.go @@ -6,17 +6,16 @@ import ( "fmt" "io" "log" + "math/rand" "os" "regexp" "strings" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" - - "github.com/flyteorg/flyte/flyteidl/clients/go/admin" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin" + "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" extMocks "github.com/flyteorg/flytectl/pkg/ext/mocks" @@ -112,6 +111,34 @@ func (s *TestStruct) TearDownAndVerify(t *testing.T, expectedLog string) { assert.Equal(t, sanitizeString(expectedLog), sanitizeString(buf.String())) } +func (s *TestStruct) TearDownAndVerifyContains(t *testing.T, expectedLog string) { + if err := s.Writer.Close(); err != nil { + panic(fmt.Errorf("could not close test context writer: %w", err)) + } + + var buf bytes.Buffer + if _, err := io.Copy(&buf, s.Reader); err != nil { + panic(fmt.Errorf("could not read from test context reader: %w", err)) + } + + assert.Contains(t, sanitizeString(buf.String()), sanitizeString(expectedLog)) +} + +// RandomName returns a string composed of random lowercase English letters of specified length. +func RandomName(length int) string { + if length < 0 { + panic("length should be a non-negative number") + } + + var b strings.Builder + for i := 0; i < length; i++ { + c := rune('a' + rand.Intn('z'-'a')) // #nosec G404 - we use this function for testing only, do not need a cryptographically secure random number generator + b.WriteRune(c) + } + + return b.String() +} + func sanitizeString(str string) string { // Not the most comprehensive ANSI pattern, but this should capture common color operations // such as \x1b[107;0m and \x1b[0m. Expand if needed (insert regex 2 problems joke here). diff --git a/cmd/update/diff.go b/cmd/update/diff.go new file mode 100644 index 00000000..b0f9190f --- /dev/null +++ b/cmd/update/diff.go @@ -0,0 +1,68 @@ +package update + +import ( + "encoding/json" + "fmt" + + "github.com/hexops/gotextdiff" + "github.com/hexops/gotextdiff/myers" + "gopkg.in/yaml.v3" +) + +const ( + diffPathBefore = "before" + diffPathAfter = "after" +) + +// DiffAsYaml marshals both objects as YAML and returns differences +// between marshalled values in unified format. Marshalling respects +// JSON field annotations. +func DiffAsYaml(path1, path2 string, object1, object2 any) (string, error) { + yaml1, err := marshalToYamlString(object1) + if err != nil { + return "", fmt.Errorf("diff as yaml: %w", err) + } + + yaml2, err := marshalToYamlString(object2) + if err != nil { + return "", fmt.Errorf("diff as yaml: %w", err) + } + + patch := diffStrings(path1, path2, yaml1, yaml2) + return patch, nil +} + +// marshalToYamlString marshals value to a YAML string, while respecting +// JSON field annotations. +func marshalToYamlString(value any) (string, error) { + jsonText, err := json.Marshal(value) + if err != nil { + return "", fmt.Errorf("marshalling object to json: %w", err) + } + + var jsonObject interface{} + if err := yaml.Unmarshal(jsonText, &jsonObject); err != nil { + return "", fmt.Errorf("unmarshalling yaml to object: %w", err) + } + + data, err := yaml.Marshal(jsonObject) + if err != nil { + return "", fmt.Errorf("marshalling object to yaml: %w", err) + } + + return string(data), nil +} + +// diffStrings returns differences between two strings in unified format. +// An empty string will be returned if both strings are equal. +func diffStrings(path1, path2, s1, s2 string) string { + // We add new lines at the end of each string to avoid + // "\ No newline at end of file" appended to each diff. + s1 += "\n" + s2 += "\n" + + edits := myers.ComputeEdits("", s1, s2) + diff := fmt.Sprint(gotextdiff.ToUnified(path1, path2, s1, edits)) + + return diff +} diff --git a/cmd/update/diff_test.go b/cmd/update/diff_test.go new file mode 100644 index 00000000..0bb3df74 --- /dev/null +++ b/cmd/update/diff_test.go @@ -0,0 +1,62 @@ +package update + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestMarshalToYamlStringRespectsJsonFieldAnnotations(t *testing.T) { + type T struct { + FieldIncluded1 int `json:"fieldIncluded1"` + FieldIncluded2 string `json:"fieldIncluded2"` + FieldOmitted string `json:"fieldOmitted,omitempty"` + } + value := T{} + + result, err := marshalToYamlString(value) + + assert.Nil(t, err) + assert.Equal(t, `fieldIncluded1: 0 +fieldIncluded2: "" +`, result) +} + +func TestDiffStringsReturnsAUnifiedDiff(t *testing.T) { + s1 := "abc\ndef\nghi" + s2 := "aaa\ndef\nghi" + + patch := diffStrings("before", "after", s1, s2) + + assert.Equal(t, `--- before ++++ after +@@ -1,3 +1,3 @@ +-abc ++aaa + def + ghi +`, patch) +} + +func TestDiffAsYamlReturnsAUnifiedDiffOfObjectsMarshalledAsYAML(t *testing.T) { + type T struct { + F1 int `json:"f1"` + F2 string `json:"f2"` + F3 string `json:"f3,omitempty"` + } + object1 := T{F1: 5, F2: "apple"} + object2 := T{F1: 10, F2: "apple", F3: "banana"} + + patch, err := DiffAsYaml("before", "after", object1, object2) + + assert.Nil(t, err) + assert.Equal(t, `--- before ++++ after +@@ -1,3 +1,4 @@ +-f1: 5 ++f1: 10 + f2: apple ++f3: banana + +`, patch) +} diff --git a/cmd/update/execution.go b/cmd/update/execution.go index 049f5976..d70b36ed 100644 --- a/cmd/update/execution.go +++ b/cmd/update/execution.go @@ -3,14 +3,15 @@ package update import ( "context" "fmt" + "os" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" + cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" ) const ( @@ -38,36 +39,62 @@ func updateExecutionFunc(ctx context.Context, args []string, cmdCtx cmdCore.Comm return fmt.Errorf(clierrors.ErrExecutionNotPassed) } executionName := args[0] - activateExec := execution.UConfig.Activate - archiveExec := execution.UConfig.Archive - if activateExec && archiveExec { + activate := execution.UConfig.Activate + archive := execution.UConfig.Archive + if activate && archive { return fmt.Errorf(clierrors.ErrInvalidStateUpdate) } - var executionState admin.ExecutionState - if activateExec { - executionState = admin.ExecutionState_EXECUTION_ACTIVE - } else if archiveExec { - executionState = admin.ExecutionState_EXECUTION_ARCHIVED + var newState admin.ExecutionState + if activate { + newState = admin.ExecutionState_EXECUTION_ACTIVE + } else if archive { + newState = admin.ExecutionState_EXECUTION_ARCHIVED + } + + exec, err := cmdCtx.AdminFetcherExt().FetchExecution(ctx, executionName, project, domain) + if err != nil { + return fmt.Errorf("update execution: could not fetch execution %s: %w", executionName, err) + } + oldState := exec.GetClosure().GetStateChangeDetails().GetState() + + type Execution struct { + State admin.ExecutionState `json:"state"` } + patch, err := DiffAsYaml(diffPathBefore, diffPathAfter, Execution{oldState}, Execution{newState}) + if err != nil { + panic(err) + } + + if patch == "" { + fmt.Printf("No changes detected. Skipping the update.\n") + return nil + } + + fmt.Printf("The following changes are to be applied.\n%s\n", patch) if execution.UConfig.DryRun { - logger.Debugf(ctx, "skipping UpdateExecution request (DryRun)") - } else { - _, err := cmdCtx.AdminClient().UpdateExecution(ctx, &admin.ExecutionUpdateRequest{ - Id: &core.WorkflowExecutionIdentifier{ - Project: project, - Domain: domain, - Name: executionName, - }, - State: executionState, - }) - if err != nil { - fmt.Printf(clierrors.ErrFailedExecutionUpdate, executionName, err) - return err - } + fmt.Printf("skipping UpdateExecution request (DryRun)\n") + return nil + } + + if !execution.UConfig.Force && !cmdUtil.AskForConfirmation("Continue?", os.Stdin) { + return fmt.Errorf("update aborted by user") + } + + _, err = cmdCtx.AdminClient().UpdateExecution(ctx, &admin.ExecutionUpdateRequest{ + Id: &core.WorkflowExecutionIdentifier{ + Project: project, + Domain: domain, + Name: executionName, + }, + State: newState, + }) + if err != nil { + fmt.Printf(clierrors.ErrFailedExecutionUpdate, executionName, err) + return err } - fmt.Printf("updated execution %s successfully to state %s\n", executionName, executionState.String()) + fmt.Printf("updated execution %s successfully to state %s\n", executionName, newState) return nil } diff --git a/cmd/update/execution_test.go b/cmd/update/execution_test.go index 444f6647..e1695319 100644 --- a/cmd/update/execution_test.go +++ b/cmd/update/execution_test.go @@ -4,58 +4,240 @@ import ( "fmt" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/execution" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flytectl/pkg/ext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) -func TestExecutionUpdate(t *testing.T) { - s := testutils.Setup() - args := []string{"execution1"} - // Activate - execution.UConfig.Activate = true - s.MockAdminClient.OnUpdateExecutionMatch(mock.Anything, mock.Anything).Return(&admin.ExecutionUpdateResponse{}, nil) - assert.Nil(t, updateExecutionFunc(s.Ctx, args, s.CmdCtx)) - // Archive - execution.UConfig.Activate = false - execution.UConfig.Archive = true - assert.Nil(t, updateExecutionFunc(s.Ctx, args, s.CmdCtx)) - // Reset - execution.UConfig.Activate = false - execution.UConfig.Archive = false - - // Dry run - execution.UConfig.DryRun = true - assert.Nil(t, updateExecutionFunc(s.Ctx, args, s.CmdCtx)) - s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything) - - // Reset - execution.UConfig.DryRun = false -} - -func TestExecutionUpdateValidationFailure(t *testing.T) { - s := testutils.Setup() - args := []string{"execution1"} - execution.UConfig.Activate = true - execution.UConfig.Archive = true - assert.NotNil(t, updateExecutionFunc(s.Ctx, args, s.CmdCtx)) - // Reset - execution.UConfig.Activate = false - execution.UConfig.Archive = false +func TestExecutionCanBeActivated(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateExecution", s.Ctx, + mock.MatchedBy( + func(r *admin.ExecutionUpdateRequest) bool { + return r.State == admin.ExecutionState_EXECUTION_ACTIVE + })) + }) } -func TestExecutionUpdateFail(t *testing.T) { +func TestExecutionCanBeArchived(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ACTIVE + config.Archive = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateExecution", s.Ctx, + mock.MatchedBy( + func(r *admin.ExecutionUpdateRequest) bool { + return r.State == admin.ExecutionState_EXECUTION_ARCHIVED + })) + }) +} + +func TestExecutionCannotBeActivatedAndArchivedAtTheSameTime(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + config.Activate = true + config.Archive = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "Specify either activate or archive") + s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }) +} + +func TestExecutionUpdateDoesNothingWhenThereAreNoChanges(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }) +} + +func TestExecutionUpdateWithoutForceFlagFails(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ARCHIVED + config.Activate = true + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }) +} + +func TestExecutionUpdateDoesNothingWithDryRunFlag(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ARCHIVED + config.Activate = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }) +} + +func TestForceFlagIsIgnoredWithDryRunDuringExecutionUpdate(t *testing.T) { + t.Run("without --force", func(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ARCHIVED + config.Activate = true + + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }) + }) + + t.Run("with --force", func(t *testing.T) { + testExecutionUpdate( + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ARCHIVED + config.Activate = true + + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }) + }) +} + +func TestExecutionUpdateFailsWhenExecutionDoesNotExist(t *testing.T) { + testExecutionUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, execution *admin.Execution) { + s.FetcherExt. + OnFetchExecution(s.Ctx, execution.Id.Name, execution.Id.Project, execution.Id.Domain). + Return(nil, ext.NewNotFoundError("execution not found")) + s.MockAdminClient. + OnUpdateExecutionMatch(s.Ctx, mock.Anything). + Return(&admin.ExecutionUpdateResponse{}, nil) + }, + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }, + ) +} + +func TestExecutionUpdateFailsWhenAdminClientFails(t *testing.T) { + testExecutionUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, execution *admin.Execution) { + s.FetcherExt. + OnFetchExecution(s.Ctx, execution.Id.Name, execution.Id.Project, execution.Id.Domain). + Return(execution, nil) + s.MockAdminClient. + OnUpdateExecutionMatch(s.Ctx, mock.Anything). + Return(nil, fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution) { + execution.Closure.StateChangeDetails.State = admin.ExecutionState_EXECUTION_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertCalled(t, "UpdateExecution", mock.Anything, mock.Anything) + }, + ) +} + +func TestExecutionUpdateRequiresExecutionName(t *testing.T) { s := testutils.Setup() - args := []string{"execution1"} - s.MockAdminClient.OnUpdateExecutionMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) - assert.NotNil(t, updateExecutionFunc(s.Ctx, args, s.CmdCtx)) + err := updateExecutionFunc(s.Ctx, nil, s.CmdCtx) + + assert.ErrorContains(t, err, "execution name wasn't passed") +} + +func testExecutionUpdate( + setup func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution), + asserter func(s *testutils.TestStruct, err error), +) { + testExecutionUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, execution *admin.Execution) { + s.FetcherExt. + OnFetchExecution(s.Ctx, execution.Id.Name, execution.Id.Project, execution.Id.Domain). + Return(execution, nil) + s.MockAdminClient. + OnUpdateExecutionMatch(s.Ctx, mock.Anything). + Return(&admin.ExecutionUpdateResponse{}, nil) + }, + setup, + asserter, + ) } -func TestExecutionUpdateInvalidArgs(t *testing.T) { +func testExecutionUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, execution *admin.Execution), + setup func(s *testutils.TestStruct, config *execution.UpdateConfig, execution *admin.Execution), + asserter func(s *testutils.TestStruct, err error), +) { s := testutils.Setup() - args := []string{} - assert.NotNil(t, updateExecutionFunc(s.Ctx, args, s.CmdCtx)) + target := newTestExecution() + + if mockSetup != nil { + mockSetup(&s, target) + } + + execution.UConfig = &execution.UpdateConfig{} + if setup != nil { + setup(&s, execution.UConfig, target) + } + + args := []string{target.Id.Name} + err := updateExecutionFunc(s.Ctx, args, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + execution.UConfig = &execution.UpdateConfig{} +} + +func newTestExecution() *admin.Execution { + return &admin.Execution{ + Id: &core.WorkflowExecutionIdentifier{ + Name: testutils.RandomName(12), + Project: config.GetConfig().Project, + Domain: config.GetConfig().Domain, + }, + Closure: &admin.ExecutionClosure{ + StateChangeDetails: &admin.ExecutionStateChangeDetails{ + State: admin.ExecutionState_EXECUTION_ACTIVE, + }, + }, + } } diff --git a/cmd/update/interfaces/updater.go b/cmd/update/interfaces/updater.go index acafe958..3aea6aec 100644 --- a/cmd/update/interfaces/updater.go +++ b/cmd/update/interfaces/updater.go @@ -3,8 +3,8 @@ package interfaces import ( "context" - cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + cmdCore "github.com/flyteorg/flytectl/cmd/core" ) //go:generate mockery -name=Updater -case=underscore diff --git a/cmd/update/launch_plan.go b/cmd/update/launch_plan.go index c335a4e2..28b7c627 100644 --- a/cmd/update/launch_plan.go +++ b/cmd/update/launch_plan.go @@ -3,14 +3,15 @@ package update import ( "context" "fmt" + "os" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" + cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" ) const ( @@ -41,37 +42,67 @@ func updateLPFunc(ctx context.Context, args []string, cmdCtx cmdCore.CommandCont if len(version) == 0 { return fmt.Errorf(clierrors.ErrLPVersionNotPassed) } - activateLP := launchplan.UConfig.Activate - archiveLP := launchplan.UConfig.Archive - if activateLP == archiveLP && archiveLP { + + activate := launchplan.UConfig.Activate + archive := launchplan.UConfig.Archive + if activate == archive && archive { return fmt.Errorf(clierrors.ErrInvalidStateUpdate) } - var lpState admin.LaunchPlanState - if activateLP { - lpState = admin.LaunchPlanState_ACTIVE - } else if archiveLP { - lpState = admin.LaunchPlanState_INACTIVE + var newState admin.LaunchPlanState + if activate { + newState = admin.LaunchPlanState_ACTIVE + } else if archive { + newState = admin.LaunchPlanState_INACTIVE + } + + id := &core.Identifier{ + Project: project, + Domain: domain, + Name: name, + Version: version, + ResourceType: core.ResourceType_LAUNCH_PLAN, + } + + launchPlan, err := cmdCtx.AdminClient().GetLaunchPlan(ctx, &admin.ObjectGetRequest{Id: id}) + if err != nil { + return fmt.Errorf("update launch plan %s: could not fetch launch plan: %w", name, err) + } + oldState := launchPlan.GetClosure().GetState() + + type LaunchPlan struct { + State admin.LaunchPlanState `json:"state"` + } + patch, err := DiffAsYaml(diffPathBefore, diffPathAfter, LaunchPlan{oldState}, LaunchPlan{newState}) + if err != nil { + panic(err) } + if patch == "" { + fmt.Printf("No changes detected. Skipping the update.\n") + return nil + } + + fmt.Printf("The following changes are to be applied.\n%s\n", patch) + if launchplan.UConfig.DryRun { - logger.Debugf(ctx, "skipping CreateExecution request (DryRun)") - } else { - _, err := cmdCtx.AdminClient().UpdateLaunchPlan(ctx, &admin.LaunchPlanUpdateRequest{ - Id: &core.Identifier{ - Project: project, - Domain: domain, - Name: name, - Version: version, - }, - State: lpState, - }) - if err != nil { - fmt.Printf(clierrors.ErrFailedLPUpdate, name, err) - return err - } + fmt.Printf("skipping LaunchPlanUpdate request (DryRun)") + return nil } - fmt.Printf("updated launchplan successfully on %v", name) + + if !launchplan.UConfig.Force && !cmdUtil.AskForConfirmation("Continue?", os.Stdin) { + return fmt.Errorf("update aborted by user") + } + + _, err = cmdCtx.AdminClient().UpdateLaunchPlan(ctx, &admin.LaunchPlanUpdateRequest{ + Id: id, + State: newState, + }) + if err != nil { + return fmt.Errorf(clierrors.ErrFailedLPUpdate, name, err) + } + + fmt.Printf("updated launch plan successfully on %s", name) return nil } diff --git a/cmd/update/launch_plan_meta.go b/cmd/update/launch_plan_meta.go index f0bdaee6..2170ba22 100644 --- a/cmd/update/launch_plan_meta.go +++ b/cmd/update/launch_plan_meta.go @@ -4,10 +4,10 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( @@ -42,8 +42,7 @@ func getUpdateLPMetaFunc(namedEntityConfig *NamedEntityConfig) func(ctx context. name := args[0] err := namedEntityConfig.UpdateNamedEntity(ctx, name, project, domain, core.ResourceType_LAUNCH_PLAN, cmdCtx) if err != nil { - fmt.Printf(clierrors.ErrFailedLPUpdate, name, err) - return err + return fmt.Errorf(clierrors.ErrFailedLPUpdate, name, err) } fmt.Printf("updated metadata successfully on %v", name) return nil diff --git a/cmd/update/launch_plan_meta_test.go b/cmd/update/launch_plan_meta_test.go index 2df31f80..c2a8d637 100644 --- a/cmd/update/launch_plan_meta_test.go +++ b/cmd/update/launch_plan_meta_test.go @@ -4,32 +4,193 @@ import ( "fmt" "testing" - "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/google/go-cmp/cmp" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) -func TestLPMetaUpdate(t *testing.T) { - s := testutils.Setup() - namedEntityConfig := &NamedEntityConfig{} - args := []string{"task1"} - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(&admin.NamedEntityUpdateResponse{}, nil) - assert.Nil(t, getUpdateLPMetaFunc(namedEntityConfig)(s.Ctx, args, s.CmdCtx)) +func TestLaunchPlanMetadataCanBeActivated(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateNamedEntity", s.Ctx, + mock.MatchedBy( + func(r *admin.NamedEntityUpdateRequest) bool { + return r.GetMetadata().GetState() == admin.NamedEntityState_NAMED_ENTITY_ACTIVE + })) + }) } -func TestLPMetaUpdateFail(t *testing.T) { - s := testutils.Setup() - namedEntityConfig := &NamedEntityConfig{} - args := []string{"task1"} - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) - assert.NotNil(t, getUpdateTaskFunc(namedEntityConfig)(s.Ctx, args, s.CmdCtx)) +func TestLaunchPlanMetadataCanBeArchived(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ACTIVE + config.Archive = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateNamedEntity", s.Ctx, + mock.MatchedBy( + func(r *admin.NamedEntityUpdateRequest) bool { + return r.GetMetadata().GetState() == admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + })) + }) +} + +func TestLaunchPlanMetadataCannotBeActivatedAndArchivedAtTheSameTime(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + config.Activate = true + config.Archive = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "Specify either activate or archive") + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestLaunchPlanMetadataUpdateDoesNothingWhenThereAreNoChanges(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestLaunchPlanMetadataUpdateWithoutForceFlagFails(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestLaunchPlanMetadataUpdateDoesNothingWithDryRunFlag(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestForceFlagIsIgnoredWithDryRunDuringLaunchPlanMetadataUpdate(t *testing.T) { + t.Run("without --force", func(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) + }) + + t.Run("with --force", func(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_LAUNCH_PLAN, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) + }) } -func TestLPMetaUpdateInvalidArgs(t *testing.T) { +func TestLaunchPlanMetadataUpdateFailsWhenLaunchPlanDoesNotExist(t *testing.T) { + testNamedEntityUpdateWithMockSetup( + core.ResourceType_LAUNCH_PLAN, + /* mockSetup */ func(s *testutils.TestStruct, namedEntity *admin.NamedEntity) { + s.MockAdminClient. + OnGetNamedEntityMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.NamedEntityGetRequest) bool { + return r.ResourceType == namedEntity.ResourceType && + cmp.Equal(r.Id, namedEntity.Id) + })). + Return(nil, ext.NewNotFoundError("named entity not found")) + s.MockAdminClient. + OnUpdateNamedEntityMatch(s.Ctx, mock.Anything). + Return(&admin.NamedEntityUpdateResponse{}, nil) + }, + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }, + ) +} + +func TestLaunchPlanMetadataUpdateFailsWhenAdminClientFails(t *testing.T) { + testNamedEntityUpdateWithMockSetup( + core.ResourceType_LAUNCH_PLAN, + /* mockSetup */ func(s *testutils.TestStruct, namedEntity *admin.NamedEntity) { + s.MockAdminClient. + OnGetNamedEntityMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.NamedEntityGetRequest) bool { + return r.ResourceType == namedEntity.ResourceType && + cmp.Equal(r.Id, namedEntity.Id) + })). + Return(namedEntity, nil) + s.MockAdminClient. + OnUpdateNamedEntityMatch(s.Ctx, mock.Anything). + Return(nil, fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }, + ) +} + +func TestLaunchPlanMetadataUpdateRequiresLaunchPlanName(t *testing.T) { s := testutils.Setup() - namedEntityConfig := &NamedEntityConfig{} - args := []string{} - assert.NotNil(t, getUpdateTaskFunc(namedEntityConfig)(s.Ctx, args, s.CmdCtx)) + config := &NamedEntityConfig{} + + err := getUpdateLPMetaFunc(config)(s.Ctx, nil, s.CmdCtx) + + assert.ErrorContains(t, err, "launch plan name wasn't passed") } diff --git a/cmd/update/launch_plan_test.go b/cmd/update/launch_plan_test.go index ce19336d..f9c3d7dc 100644 --- a/cmd/update/launch_plan_test.go +++ b/cmd/update/launch_plan_test.go @@ -4,33 +4,274 @@ import ( "fmt" "testing" + "github.com/google/go-cmp/cmp" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flytectl/pkg/ext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) -func TestLPUpdate(t *testing.T) { +func TestLaunchPlanCanBeActivated(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_INACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateLaunchPlan", s.Ctx, + mock.MatchedBy( + func(r *admin.LaunchPlanUpdateRequest) bool { + return r.State == admin.LaunchPlanState_ACTIVE + })) + }) +} + +func TestLaunchPlanCanBeArchived(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_ACTIVE + config.Archive = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateLaunchPlan", s.Ctx, + mock.MatchedBy( + func(r *admin.LaunchPlanUpdateRequest) bool { + return r.State == admin.LaunchPlanState_INACTIVE + })) + }) +} + +func TestLaunchPlanCannotBeActivatedAndArchivedAtTheSameTime(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + config.Activate = true + config.Archive = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "Specify either activate or archive") + s.MockAdminClient.AssertNotCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }) +} + +func TestLaunchPlanUpdateDoesNothingWhenThereAreNoChanges(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_ACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }) +} + +func TestLaunchPlanUpdateWithoutForceFlagFails(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_INACTIVE + config.Activate = true + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.MockAdminClient.AssertNotCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }) +} + +func TestLaunchPlanUpdateDoesNothingWithDryRunFlag(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_INACTIVE + config.Activate = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }) +} + +func TestForceFlagIsIgnoredWithDryRunDuringLaunchPlanUpdate(t *testing.T) { + t.Run("without --force", func(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_INACTIVE + config.Activate = true + + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }) + }) + + t.Run("with --force", func(t *testing.T) { + testLaunchPlanUpdate( + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_INACTIVE + config.Activate = true + + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }) + }) +} + +func TestLaunchPlanUpdateFailsWhenLaunchPlanDoesNotExist(t *testing.T) { + testLaunchPlanUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, launchplan *admin.LaunchPlan) { + s.MockAdminClient. + OnGetLaunchPlanMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.ObjectGetRequest) bool { + return cmp.Equal(r.Id, launchplan.Id) + })). + Return(nil, ext.NewNotFoundError("launch plan not found")) + s.MockAdminClient. + OnUpdateLaunchPlanMatch(s.Ctx, mock.Anything). + Return(&admin.LaunchPlanUpdateResponse{}, nil) + }, + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }, + ) +} + +func TestLaunchPlanUpdateFailsWhenAdminClientFails(t *testing.T) { + testLaunchPlanUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, launchplan *admin.LaunchPlan) { + s.MockAdminClient. + OnGetLaunchPlanMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.ObjectGetRequest) bool { + return cmp.Equal(r.Id, launchplan.Id) + })). + Return(launchplan, nil) + s.MockAdminClient. + OnUpdateLaunchPlanMatch(s.Ctx, mock.Anything). + Return(nil, fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan) { + launchplan.Closure.State = admin.LaunchPlanState_INACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertCalled(t, "UpdateLaunchPlan", mock.Anything, mock.Anything) + }, + ) +} + +func TestLaunchPlanUpdateRequiresLaunchPlanName(t *testing.T) { s := testutils.Setup() - launchplan.UConfig = &launchplan.UpdateConfig{Version: "v1", Archive: true} - args := []string{"lp1"} - s.MockAdminClient.OnUpdateLaunchPlanMatch(mock.Anything, mock.Anything).Return(&admin.LaunchPlanUpdateResponse{}, nil) - assert.Nil(t, updateLPFunc(s.Ctx, args, s.CmdCtx)) + launchplan.UConfig = &launchplan.UpdateConfig{} + + launchplan.UConfig.Version = testutils.RandomName(2) + err := updateLPFunc(s.Ctx, nil, s.CmdCtx) + + assert.ErrorContains(t, err, "launch plan name wasn't passed") + + // cleanup + launchplan.UConfig = &launchplan.UpdateConfig{} } -func TestLPUpdateFail(t *testing.T) { +func TestLaunchPlanUpdateRequiresLaunchPlanVersion(t *testing.T) { s := testutils.Setup() - launchplan.UConfig = &launchplan.UpdateConfig{Version: "v1", Archive: true} - args := []string{"task1"} - s.MockAdminClient.OnUpdateLaunchPlanMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) - assert.NotNil(t, updateLPFunc(s.Ctx, args, s.CmdCtx)) + launchplan.UConfig = &launchplan.UpdateConfig{} + + name := testutils.RandomName(12) + err := updateLPFunc(s.Ctx, []string{name}, s.CmdCtx) + + assert.ErrorContains(t, err, "launch plan version wasn't passed") + + // cleanup + launchplan.UConfig = &launchplan.UpdateConfig{} } -func TestLPUpdateInvalidArgs(t *testing.T) { +func testLaunchPlanUpdate( + setup func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan), + asserter func(s *testutils.TestStruct, err error), +) { + testLaunchPlanUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, launchplan *admin.LaunchPlan) { + s.MockAdminClient. + OnGetLaunchPlanMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.ObjectGetRequest) bool { + return cmp.Equal(r.Id, launchplan.Id) + })). + Return(launchplan, nil) + s.MockAdminClient. + OnUpdateLaunchPlanMatch(s.Ctx, mock.Anything). + Return(&admin.LaunchPlanUpdateResponse{}, nil) + }, + setup, + asserter, + ) +} + +func testLaunchPlanUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, launchplan *admin.LaunchPlan), + setup func(s *testutils.TestStruct, config *launchplan.UpdateConfig, launchplan *admin.LaunchPlan), + asserter func(s *testutils.TestStruct, err error), +) { s := testutils.Setup() - launchplan.UConfig = &launchplan.UpdateConfig{Version: "v1", Archive: true, Activate: true} - args := []string{} - assert.NotNil(t, updateLPFunc(s.Ctx, args, s.CmdCtx)) + target := newTestLaunchPlan() + + if mockSetup != nil { + mockSetup(&s, target) + } + + launchplan.UConfig = &launchplan.UpdateConfig{} + if setup != nil { + setup(&s, launchplan.UConfig, target) + } + + args := []string{target.Id.Name} + launchplan.UConfig.Version = target.Id.Version + err := updateLPFunc(s.Ctx, args, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + launchplan.UConfig = &launchplan.UpdateConfig{} +} + +func newTestLaunchPlan() *admin.LaunchPlan { + return &admin.LaunchPlan{ + Id: &core.Identifier{ + Name: testutils.RandomName(12), + Project: config.GetConfig().Project, + Domain: config.GetConfig().Domain, + ResourceType: core.ResourceType_LAUNCH_PLAN, + Version: testutils.RandomName(2), + }, + Closure: &admin.LaunchPlanClosure{ + State: admin.LaunchPlanState_ACTIVE, + }, + } } diff --git a/cmd/update/matchable_attribute_util.go b/cmd/update/matchable_attribute_util.go index 23efa169..ddb2c110 100644 --- a/cmd/update/matchable_attribute_util.go +++ b/cmd/update/matchable_attribute_util.go @@ -3,45 +3,170 @@ package update import ( "context" "fmt" + "os" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" + cmdCore "github.com/flyteorg/flytectl/cmd/core" + cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" "github.com/flyteorg/flytectl/pkg/ext" ) -func DecorateAndUpdateMatchableAttr(ctx context.Context, project, domain, workflowName string, - updater ext.AdminUpdaterExtInterface, mcDecorator sconfig.MatchableAttributeDecorator, dryRun bool) error { - matchingAttr := mcDecorator.Decorate() - if len(workflowName) > 0 { - // Update the workflow attribute using the admin. - if dryRun { - fmt.Printf("skipping UpdateWorkflowAttributes request (dryRun)\n") - } else { - err := updater.UpdateWorkflowAttributes(ctx, project, domain, workflowName, matchingAttr) - if err != nil { - return err - } - } - fmt.Printf("Updated attributes from %v project and domain %v and workflow %v\n", project, domain, workflowName) - } else { - // Update the project domain attribute using the admin. - if dryRun { - fmt.Printf("skipping UpdateProjectDomainAttributes request (dryRun)\n") - } else { - if len(domain) == 0 { - err := updater.UpdateProjectAttributes(ctx, project, matchingAttr) - if err != nil { - return err - } - fmt.Printf("Updated attributes from %v project\n", project) - } else { - err := updater.UpdateProjectDomainAttributes(ctx, project, domain, matchingAttr) - if err != nil { - return err - } - fmt.Printf("Updated attributes from %v project and domain %v\n", project, domain) - } - } +func DecorateAndUpdateMatchableAttr( + ctx context.Context, + cmdCtx cmdCore.CommandContext, + project, domain, workflow string, + resourceType admin.MatchableResource, + attributeDecorator sconfig.MatchableAttributeDecorator, + dryRun bool, + force bool, +) error { + if project == "" { + return fmt.Errorf("project is required") + } + if domain == "" && workflow != "" { + return fmt.Errorf("domain is required") + } + + switch { + case workflow != "": + return updateWorkflowMatchableAttributes(ctx, cmdCtx, project, domain, workflow, resourceType, attributeDecorator, dryRun, force) + case domain != "": + return updateProjectDomainMatchableAttributes(ctx, cmdCtx, project, domain, resourceType, attributeDecorator, dryRun, force) + default: + return updateProjectMatchableAttributes(ctx, cmdCtx, project, resourceType, attributeDecorator, dryRun, force) + } +} + +func updateProjectMatchableAttributes( + ctx context.Context, + cmdCtx cmdCore.CommandContext, + project string, + resourceType admin.MatchableResource, + attributeDecorator sconfig.MatchableAttributeDecorator, + dryRun bool, + force bool, +) error { + if project == "" { + panic("project is empty") + } + + response, err := cmdCtx.AdminFetcherExt().FetchProjectAttributes(ctx, project, resourceType) + if err != nil && !ext.IsNotFoundError(err) { + return fmt.Errorf("update project %s matchable attributes: could not fetch attributes: %w", project, err) + } + + oldMatchingAttributes := response.GetAttributes().GetMatchingAttributes() + newMatchingAttributes := attributeDecorator.Decorate() + + if confirmed, err := confirmMatchableAttributeUpdate(oldMatchingAttributes, newMatchingAttributes, dryRun, force); err != nil || !confirmed { + return err + } + + if err := cmdCtx.AdminUpdaterExt().UpdateProjectAttributes(ctx, project, newMatchingAttributes); err != nil { + return fmt.Errorf("update project %s matchable attributes: update failed: %w", project, err) + } + + fmt.Printf("Updated attributes from %s project\n", project) + return nil +} + +func updateProjectDomainMatchableAttributes( + ctx context.Context, + cmdCtx cmdCore.CommandContext, + project, domain string, + resourceType admin.MatchableResource, + attributeDecorator sconfig.MatchableAttributeDecorator, + dryRun bool, + force bool, +) error { + if project == "" { + panic("project is empty") + } + if domain == "" { + panic("domain is empty") + } + response, err := cmdCtx.AdminFetcherExt().FetchProjectDomainAttributes(ctx, project, domain, resourceType) + if err != nil && !ext.IsNotFoundError(err) { + return fmt.Errorf("update project %s domain %s matchable attributes: could not fetch attributes: %w", project, domain, err) } + + oldMatchingAttributes := response.GetAttributes().GetMatchingAttributes() + newMatchingAttributes := attributeDecorator.Decorate() + + if confirmed, err := confirmMatchableAttributeUpdate(oldMatchingAttributes, newMatchingAttributes, dryRun, force); err != nil || !confirmed { + return err + } + + if err := cmdCtx.AdminUpdaterExt().UpdateProjectDomainAttributes(ctx, project, domain, newMatchingAttributes); err != nil { + return fmt.Errorf("update project %s domain %s matchable attributes: update failed: %w", project, domain, err) + } + + fmt.Printf("Updated attributes from %s project and domain %s\n", project, domain) return nil } + +func updateWorkflowMatchableAttributes( + ctx context.Context, + cmdCtx cmdCore.CommandContext, + project, domain, workflow string, + resourceType admin.MatchableResource, + attributeDecorator sconfig.MatchableAttributeDecorator, + dryRun bool, + force bool, +) error { + if project == "" { + panic("project is empty") + } + if domain == "" { + panic("domain is empty") + } + if workflow == "" { + panic("workflow is empty") + } + + response, err := cmdCtx.AdminFetcherExt().FetchWorkflowAttributes(ctx, project, domain, workflow, resourceType) + if err != nil && !ext.IsNotFoundError(err) { + return fmt.Errorf("update project %s domain %s workflow %s matchable attributes: could not fetch attributes: %w", project, domain, workflow, err) + } + + oldMatchingAttributes := response.GetAttributes().GetMatchingAttributes() + newMatchingAttributes := attributeDecorator.Decorate() + + if confirmed, err := confirmMatchableAttributeUpdate(oldMatchingAttributes, newMatchingAttributes, dryRun, force); err != nil || !confirmed { + return err + } + + if err := cmdCtx.AdminUpdaterExt().UpdateWorkflowAttributes(ctx, project, domain, workflow, newMatchingAttributes); err != nil { + return fmt.Errorf("update project %s domain %s workflow %s matchable attributes: update failed: %w", project, domain, workflow, err) + } + + fmt.Printf("Updated attributes from %s project and domain %s and workflow %s\n", project, domain, workflow) + return nil +} + +func confirmMatchableAttributeUpdate(old, new *admin.MatchingAttributes, dryRun, force bool) (bool, error) { + patch, err := DiffAsYaml(diffPathBefore, diffPathAfter, old.GetTarget(), new.GetTarget()) + if err != nil { + return false, fmt.Errorf("update matchable attributes: %w", err) + } + + if patch == "" { + fmt.Printf("No changes detected. Skipping the update.\n") + return false, nil + } + + fmt.Printf("The following changes are to be applied.\n%s\n", patch) + + if dryRun { + fmt.Printf("Skipping update request (dryRun)\n") + return false, nil + } + + if !force && !cmdUtil.AskForConfirmation("Continue?", os.Stdin) { + return false, fmt.Errorf("update aborted by user") + } + + return true, nil +} diff --git a/cmd/update/matchable_cluster_resource_attribute.go b/cmd/update/matchable_cluster_resource_attribute.go index 79c03480..51f5b649 100644 --- a/cmd/update/matchable_cluster_resource_attribute.go +++ b/cmd/update/matchable_cluster_resource_attribute.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" @@ -71,9 +72,9 @@ func updateClusterResourceAttributesFunc(ctx context.Context, args []string, cmd domain := clustrResourceAttrFileConfig.Domain workflowName := clustrResourceAttrFileConfig.Workflow - // Updates the admin matchable attribute from taskResourceAttrFileConfig - if err := DecorateAndUpdateMatchableAttr(ctx, project, domain, workflowName, cmdCtx.AdminUpdaterExt(), - clustrResourceAttrFileConfig, updateConfig.DryRun); err != nil { + if err := DecorateAndUpdateMatchableAttr(ctx, cmdCtx, project, domain, workflowName, + admin.MatchableResource_CLUSTER_RESOURCE, clustrResourceAttrFileConfig, + updateConfig.DryRun, updateConfig.Force); err != nil { return err } return nil diff --git a/cmd/update/matchable_cluster_resource_attribute_test.go b/cmd/update/matchable_cluster_resource_attribute_test.go index 8b6f8b2f..f5d1c6c4 100644 --- a/cmd/update/matchable_cluster_resource_attribute_test.go +++ b/cmd/update/matchable_cluster_resource_attribute_test.go @@ -7,84 +7,565 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" ) -func updateClusterResourceAttributeSetup() { - clusterresourceattribute.DefaultUpdateConfig = &clusterresourceattribute.AttrUpdateConfig{} +const ( + validWorkflowClusterResourceAttributesFilePath = "testdata/valid_workflow_cluster_attribute.yaml" + validProjectDomainClusterResourceAttributesFilePath = "testdata/valid_project_domain_cluster_attribute.yaml" + validProjectClusterResourceAttributesFilePath = "testdata/valid_project_cluster_attribute.yaml" +) + +func TestClusterResourceAttributeUpdateRequiresAttributeFile(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "attrFile is mandatory") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestClusterResourceAttributeUpdateFailsWhenAttributeFileDoesNotExist(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataNonExistentFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "unable to read from testdata/non-existent-file yaml file") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestClusterResourceAttributeUpdateFailsWhenAttributeFileIsMalformed(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataInvalidAttrFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\"") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestClusterResourceAttributeUpdateHappyPath(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestClusterResourceAttributeUpdateFailsWithoutForceFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowClusterResourceAttributesFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainClusterResourceAttributesFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectClusterResourceAttributesFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestClusterResourceAttributeUpdateDoesNothingWithDryRunFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowClusterResourceAttributesFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainClusterResourceAttributesFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectClusterResourceAttributesFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) } -func TestUpdateClusterResourceAttributes(t *testing.T) { - t.Run("no input file for update", func(t *testing.T) { - s := setup() - updateClusterResourceAttributeSetup() - err := updateClusterResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attrFile is mandatory while calling update for cluster resource attribute"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successfully updated project domain attribute", func(t *testing.T) { - s := setup() - updateClusterResourceAttributeSetup() - clusterresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_cluster_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(nil) - err := updateClusterResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development`) - }) - t.Run("failed to update project domain attribute", func(t *testing.T) { - s := setup() - updateClusterResourceAttributeSetup() - clusterresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_cluster_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateClusterResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successfully updated workflow attribute", func(t *testing.T) { - s := setup() - updateClusterResourceAttributeSetup() - clusterresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_cluster_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(nil) - err := updateClusterResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development and workflow core.control_flow.merge_sort.merge_sort`) - }) - t.Run("failed to update workflow attribute", func(t *testing.T) { - s := setup() - updateClusterResourceAttributeSetup() - clusterresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_cluster_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateClusterResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("non existent file", func(t *testing.T) { - s := setup() - updateClusterResourceAttributeSetup() - clusterresourceattribute.DefaultUpdateConfig.AttrFile = testDataNonExistentFile - err := updateClusterResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("unable to read from testdata/non-existent-file yaml file"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("invalid update file", func(t *testing.T) { - s := setup() - updateClusterResourceAttributeSetup() - clusterresourceattribute.DefaultUpdateConfig.AttrFile = testDataInvalidAttrFile - err := updateClusterResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\""), err) - s.TearDownAndVerify(t, ``) +func TestClusterResourceAttributeUpdateIgnoresForceFlagWithDryRun(t *testing.T) { + t.Run("workflow without --force", func(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowClusterResourceAttributesFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("workflow with --force", func(t *testing.T) { + testWorkflowClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowClusterResourceAttributesFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain without --force", func(t *testing.T) { + testProjectDomainClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainClusterResourceAttributesFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) }) + + t.Run("domain with --force", func(t *testing.T) { + testProjectDomainClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainClusterResourceAttributesFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project without --force", func(t *testing.T) { + testProjectClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectClusterResourceAttributesFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project with --force", func(t *testing.T) { + testProjectClusterResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectClusterResourceAttributesFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestClusterResourceAttributeUpdateSucceedsWhenAttributesDoNotExist(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_CLUSTER_RESOURCE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_CLUSTER_RESOURCE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_CLUSTER_RESOURCE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestClusterResourceAttributeUpdateFailsWhenAdminClientFails(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_CLUSTER_RESOURCE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_CLUSTER_RESOURCE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_CLUSTER_RESOURCE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectClusterResourceAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func testWorkflowClusterResourceAttributeUpdate( + setup func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testWorkflowClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_CLUSTER_RESOURCE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testWorkflowClusterResourceAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.WorkflowAttributes), + setup func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + clusterresourceattribute.DefaultUpdateConfig = &clusterresourceattribute.AttrUpdateConfig{} + target := newTestWorkflowClusterResourceAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, clusterresourceattribute.DefaultUpdateConfig, target) + } + + err := updateClusterResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + clusterresourceattribute.DefaultUpdateConfig = &clusterresourceattribute.AttrUpdateConfig{} +} + +func newTestWorkflowClusterResourceAttribute() *admin.WorkflowAttributes { + return &admin.WorkflowAttributes{ + // project, domain, and workflow names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + Workflow: "core.control_flow.merge_sort.merge_sort", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ClusterResourceAttributes{ + ClusterResourceAttributes: &admin.ClusterResourceAttributes{ + Attributes: map[string]string{ + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + }, + }, + }, + }, + } +} + +func testProjectClusterResourceAttributeUpdate( + setup func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_CLUSTER_RESOURCE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectClusterResourceAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectAttributes), + setup func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + clusterresourceattribute.DefaultUpdateConfig = &clusterresourceattribute.AttrUpdateConfig{} + target := newTestProjectClusterResourceAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, clusterresourceattribute.DefaultUpdateConfig, target) + } + + err := updateClusterResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + clusterresourceattribute.DefaultUpdateConfig = &clusterresourceattribute.AttrUpdateConfig{} +} + +func newTestProjectClusterResourceAttribute() *admin.ProjectAttributes { + return &admin.ProjectAttributes{ + // project name needs to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ClusterResourceAttributes{ + ClusterResourceAttributes: &admin.ClusterResourceAttributes{ + Attributes: map[string]string{ + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + }, + }, + }, + }, + } +} + +func testProjectDomainClusterResourceAttributeUpdate( + setup func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectDomainClusterResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_CLUSTER_RESOURCE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectDomainClusterResourceAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes), + setup func(s *testutils.TestStruct, config *clusterresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + clusterresourceattribute.DefaultUpdateConfig = &clusterresourceattribute.AttrUpdateConfig{} + target := newTestProjectDomainClusterResourceAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, clusterresourceattribute.DefaultUpdateConfig, target) + } + + err := updateClusterResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + clusterresourceattribute.DefaultUpdateConfig = &clusterresourceattribute.AttrUpdateConfig{} +} + +func newTestProjectDomainClusterResourceAttribute() *admin.ProjectDomainAttributes { + return &admin.ProjectDomainAttributes{ + // project and domain names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ClusterResourceAttributes{ + ClusterResourceAttributes: &admin.ClusterResourceAttributes{ + Attributes: map[string]string{ + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + }, + }, + }, + }, + } } diff --git a/cmd/update/matchable_execution_cluster_label.go b/cmd/update/matchable_execution_cluster_label.go index e3c41e10..08b0d742 100644 --- a/cmd/update/matchable_execution_cluster_label.go +++ b/cmd/update/matchable_execution_cluster_label.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" cmdCore "github.com/flyteorg/flytectl/cmd/core" @@ -64,9 +65,9 @@ func updateExecutionClusterLabelFunc(ctx context.Context, args []string, cmdCtx domain := executionClusterLabelFileConfig.Domain workflowName := executionClusterLabelFileConfig.Workflow - // Updates the admin matchable attribute from executionClusterLabelFileConfig - if err := DecorateAndUpdateMatchableAttr(ctx, project, domain, workflowName, cmdCtx.AdminUpdaterExt(), - executionClusterLabelFileConfig, updateConfig.DryRun); err != nil { + if err := DecorateAndUpdateMatchableAttr(ctx, cmdCtx, project, domain, workflowName, + admin.MatchableResource_EXECUTION_CLUSTER_LABEL, executionClusterLabelFileConfig, + updateConfig.DryRun, updateConfig.Force); err != nil { return err } return nil diff --git a/cmd/update/matchable_execution_cluster_label_test.go b/cmd/update/matchable_execution_cluster_label_test.go index fffbd0f2..9aed3ebc 100644 --- a/cmd/update/matchable_execution_cluster_label_test.go +++ b/cmd/update/matchable_execution_cluster_label_test.go @@ -7,84 +7,553 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" ) -func updateExecutionClusterLabelSetup() { - executionclusterlabel.DefaultUpdateConfig = &executionclusterlabel.AttrUpdateConfig{} +const ( + validProjectExecutionClusterLabelFilePath = "testdata/valid_project_execution_cluster_label.yaml" + validProjectDomainExecutionClusterLabelFilePath = "testdata/valid_project_domain_execution_cluster_label.yaml" + validWorkflowExecutionClusterLabelFilePath = "testdata/valid_workflow_execution_cluster_label.yaml" +) + +func TestExecutionClusterLabelUpdateRequiresAttributeFile(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "attrFile is mandatory") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestExecutionClusterLabelUpdateFailsWhenAttributeFileDoesNotExist(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataNonExistentFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "unable to read from testdata/non-existent-file yaml file") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestExecutionClusterLabelUpdateFailsWhenAttributeFileIsMalformed(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataInvalidAttrFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\"") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestExecutionClusterLabelUpdateHappyPath(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestExecutionClusterLabelUpdateFailsWithoutForceFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionClusterLabelFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionClusterLabelFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionClusterLabelFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestExecutionClusterLabelUpdateDoesNothingWithDryRunFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionClusterLabelFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionClusterLabelFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionClusterLabelFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) } -func TestExecutionClusterLabel(t *testing.T) { - t.Run("no input file for update", func(t *testing.T) { - s := setup() - updateExecutionClusterLabelSetup() - err := updateExecutionClusterLabelFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attrFile is mandatory while calling update for execution cluster label"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update project domain attribute", func(t *testing.T) { - s := setup() - updateExecutionClusterLabelSetup() - executionclusterlabel.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_execution_cluster_label.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(nil) - err := updateExecutionClusterLabelFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development`) - }) - t.Run("failed update project domain attribute", func(t *testing.T) { - s := setup() - updateExecutionClusterLabelSetup() - executionclusterlabel.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_execution_cluster_label.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateExecutionClusterLabelFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update workflow attribute", func(t *testing.T) { - s := setup() - updateExecutionClusterLabelSetup() - executionclusterlabel.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_execution_cluster_label.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(nil) - err := updateExecutionClusterLabelFunc(s.Ctx, nil, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development and workflow core.control_flow.merge_sort.merge_sort`) - }) - t.Run("failed update workflow attribute", func(t *testing.T) { - s := setup() - updateExecutionClusterLabelSetup() - executionclusterlabel.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_execution_cluster_label.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateExecutionClusterLabelFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("non existent file", func(t *testing.T) { - s := setup() - updateExecutionClusterLabelSetup() - executionclusterlabel.DefaultUpdateConfig.AttrFile = testDataNonExistentFile - err := updateExecutionClusterLabelFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("unable to read from testdata/non-existent-file yaml file"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("invalid update file", func(t *testing.T) { - s := setup() - updateExecutionClusterLabelSetup() - executionclusterlabel.DefaultUpdateConfig.AttrFile = testDataInvalidAttrFile - err := updateExecutionClusterLabelFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\""), err) - s.TearDownAndVerify(t, ``) +func TestExecutionClusterLabelUpdateIgnoresForceFlagWithDryRun(t *testing.T) { + t.Run("workflow without --force", func(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionClusterLabelFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("workflow with --force", func(t *testing.T) { + testWorkflowExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionClusterLabelFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain without --force", func(t *testing.T) { + testProjectDomainExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionClusterLabelFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) }) + + t.Run("domain with --force", func(t *testing.T) { + testProjectDomainExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionClusterLabelFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project without --force", func(t *testing.T) { + testProjectExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionClusterLabelFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project with --force", func(t *testing.T) { + testProjectExecutionClusterLabelUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionClusterLabelFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestExecutionClusterLabelUpdateSucceedsWhenAttributesDoNotExist(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestExecutionClusterLabelUpdateFailsWhenAdminClientFails(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionClusterLabelFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func testWorkflowExecutionClusterLabelUpdate( + setup func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testWorkflowExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testWorkflowExecutionClusterLabelUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.WorkflowAttributes), + setup func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + executionclusterlabel.DefaultUpdateConfig = &executionclusterlabel.AttrUpdateConfig{} + target := newTestWorkflowExecutionClusterLabel() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, executionclusterlabel.DefaultUpdateConfig, target) + } + + err := updateExecutionClusterLabelFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + executionclusterlabel.DefaultUpdateConfig = &executionclusterlabel.AttrUpdateConfig{} +} + +func newTestWorkflowExecutionClusterLabel() *admin.WorkflowAttributes { + return &admin.WorkflowAttributes{ + // project, domain, and workflow names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + Workflow: "core.control_flow.merge_sort.merge_sort", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ExecutionClusterLabel{ + ExecutionClusterLabel: &admin.ExecutionClusterLabel{ + Value: testutils.RandomName(12), + }, + }, + }, + } +} + +func testProjectExecutionClusterLabelUpdate( + setup func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectExecutionClusterLabelUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectAttributes), + setup func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + executionclusterlabel.DefaultUpdateConfig = &executionclusterlabel.AttrUpdateConfig{} + target := newTestProjectExecutionClusterLabel() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, executionclusterlabel.DefaultUpdateConfig, target) + } + + err := updateExecutionClusterLabelFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + executionclusterlabel.DefaultUpdateConfig = &executionclusterlabel.AttrUpdateConfig{} +} + +func newTestProjectExecutionClusterLabel() *admin.ProjectAttributes { + return &admin.ProjectAttributes{ + // project name needs to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ExecutionClusterLabel{ + ExecutionClusterLabel: &admin.ExecutionClusterLabel{ + Value: testutils.RandomName(12), + }, + }, + }, + } +} + +func testProjectDomainExecutionClusterLabelUpdate( + setup func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectDomainExecutionClusterLabelUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_EXECUTION_CLUSTER_LABEL). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectDomainExecutionClusterLabelUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes), + setup func(s *testutils.TestStruct, config *executionclusterlabel.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + executionclusterlabel.DefaultUpdateConfig = &executionclusterlabel.AttrUpdateConfig{} + target := newTestProjectDomainExecutionClusterLabel() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, executionclusterlabel.DefaultUpdateConfig, target) + } + + err := updateExecutionClusterLabelFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + executionclusterlabel.DefaultUpdateConfig = &executionclusterlabel.AttrUpdateConfig{} +} + +func newTestProjectDomainExecutionClusterLabel() *admin.ProjectDomainAttributes { + return &admin.ProjectDomainAttributes{ + // project and domain names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ExecutionClusterLabel{ + ExecutionClusterLabel: &admin.ExecutionClusterLabel{ + Value: testutils.RandomName(12), + }, + }, + }, + } } diff --git a/cmd/update/matchable_execution_queue_attribute.go b/cmd/update/matchable_execution_queue_attribute.go index feb8d522..8af5bd77 100644 --- a/cmd/update/matchable_execution_queue_attribute.go +++ b/cmd/update/matchable_execution_queue_attribute.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" @@ -75,9 +76,9 @@ func updateExecutionQueueAttributesFunc(ctx context.Context, args []string, cmdC domain := executionQueueAttrFileConfig.Domain workflowName := executionQueueAttrFileConfig.Workflow - // Updates the admin matchable attribute from executionQueueAttrFileConfig - if err := DecorateAndUpdateMatchableAttr(ctx, project, domain, workflowName, cmdCtx.AdminUpdaterExt(), - executionQueueAttrFileConfig, updateConfig.DryRun); err != nil { + if err := DecorateAndUpdateMatchableAttr(ctx, cmdCtx, project, domain, workflowName, + admin.MatchableResource_EXECUTION_QUEUE, executionQueueAttrFileConfig, + updateConfig.DryRun, updateConfig.Force); err != nil { return err } return nil diff --git a/cmd/update/matchable_execution_queue_attribute_test.go b/cmd/update/matchable_execution_queue_attribute_test.go index cffad3da..61638b7d 100644 --- a/cmd/update/matchable_execution_queue_attribute_test.go +++ b/cmd/update/matchable_execution_queue_attribute_test.go @@ -7,84 +7,565 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" ) -func updateExecutionQueueAttributeSetup() { - executionqueueattribute.DefaultUpdateConfig = &executionqueueattribute.AttrUpdateConfig{} +const ( + validWorkflowExecutionQueueMatchableAttributesFilePath = "testdata/valid_workflow_execution_queue_attribute.yaml" + validProjectDomainExecutionQueueMatchableAttributeFilePath = "testdata/valid_project_domain_execution_queue_attribute.yaml" + validProjectExecutionQueueMatchableAttributeFilePath = "testdata/valid_project_execution_queue_attribute.yaml" +) + +func TestExecutionQueueAttributeUpdateRequiresAttributeFile(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "attrFile is mandatory") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestExecutionQueueAttributeUpdateFailsWhenAttributeFileDoesNotExist(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataNonExistentFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "unable to read from testdata/non-existent-file yaml file") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestExecutionQueueAttributeUpdateFailsWhenAttributeFileIsMalformed(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataInvalidAttrFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\"") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestExecutionQueueAttributeUpdateHappyPath(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionQueueMatchableAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionQueueMatchableAttributeFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionQueueMatchableAttributeFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestExecutionQueueAttributeUpdateFailsWithoutForceFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionQueueMatchableAttributesFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionQueueMatchableAttributeFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionQueueMatchableAttributeFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestExecutionQueueAttributeUpdateDoesNothingWithDryRunFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionQueueMatchableAttributesFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionQueueMatchableAttributeFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionQueueMatchableAttributeFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) } -func TestExecutionQueueAttributes(t *testing.T) { - t.Run("no input file for update", func(t *testing.T) { - s := setup() - updateExecutionQueueAttributeSetup() - err := updateExecutionQueueAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attrFile is mandatory while calling update for execution queue attribute"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update project domain attribute", func(t *testing.T) { - s := setup() - updateExecutionQueueAttributeSetup() - executionqueueattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_execution_queue_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(nil) - err := updateExecutionQueueAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development`) - }) - t.Run("failed update project domain attribute", func(t *testing.T) { - s := setup() - updateExecutionQueueAttributeSetup() - executionqueueattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_execution_queue_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateExecutionQueueAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update workflow attribute", func(t *testing.T) { - s := setup() - updateExecutionQueueAttributeSetup() - executionqueueattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_execution_queue_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(nil) - err := updateExecutionQueueAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development and workflow core.control_flow.merge_sort.merge_sort`) - }) - t.Run("failed update workflow attribute", func(t *testing.T) { - s := setup() - updateExecutionQueueAttributeSetup() - executionqueueattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_execution_queue_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateExecutionQueueAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("non existent file", func(t *testing.T) { - s := setup() - updateExecutionQueueAttributeSetup() - executionqueueattribute.DefaultUpdateConfig.AttrFile = testDataNonExistentFile - err := updateExecutionQueueAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("unable to read from testdata/non-existent-file yaml file"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("invalid update file", func(t *testing.T) { - s := setup() - updateExecutionQueueAttributeSetup() - executionqueueattribute.DefaultUpdateConfig.AttrFile = testDataInvalidAttrFile - err := updateExecutionQueueAttributesFunc(s.Ctx, nil, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\""), err) - s.TearDownAndVerify(t, ``) +func TestExecutionQueueAttributeUpdateIgnoresForceFlagWithDryRun(t *testing.T) { + t.Run("workflow without --force", func(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionQueueMatchableAttributesFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("workflow with --force", func(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionQueueMatchableAttributesFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain without --force", func(t *testing.T) { + testProjectDomainExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionQueueMatchableAttributeFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) }) + + t.Run("domain with --force", func(t *testing.T) { + testProjectDomainExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionQueueMatchableAttributeFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project without --force", func(t *testing.T) { + testProjectExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionQueueMatchableAttributeFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project with --force", func(t *testing.T) { + testProjectExecutionQueueAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionQueueMatchableAttributeFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestExecutionQueueAttributeUpdateSucceedsWhenAttributesDoNotExist(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_EXECUTION_QUEUE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionQueueMatchableAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_EXECUTION_QUEUE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionQueueMatchableAttributeFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_EXECUTION_QUEUE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionQueueMatchableAttributeFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestExecutionQueueAttributeUpdateFailsWhenAdminClientFails(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_EXECUTION_QUEUE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionQueueMatchableAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_EXECUTION_QUEUE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainExecutionQueueMatchableAttributeFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_EXECUTION_QUEUE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectExecutionQueueMatchableAttributeFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func testWorkflowExecutionQueueAttributeUpdate( + setup func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testWorkflowExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_EXECUTION_QUEUE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testWorkflowExecutionQueueAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.WorkflowAttributes), + setup func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + executionqueueattribute.DefaultUpdateConfig = &executionqueueattribute.AttrUpdateConfig{} + target := newTestWorkflowExecutionQueueAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, executionqueueattribute.DefaultUpdateConfig, target) + } + + err := updateExecutionQueueAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + executionqueueattribute.DefaultUpdateConfig = &executionqueueattribute.AttrUpdateConfig{} +} + +func newTestWorkflowExecutionQueueAttribute() *admin.WorkflowAttributes { + return &admin.WorkflowAttributes{ + // project, domain, and workflow names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + Workflow: "core.control_flow.merge_sort.merge_sort", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ExecutionQueueAttributes{ + ExecutionQueueAttributes: &admin.ExecutionQueueAttributes{ + Tags: []string{ + testutils.RandomName(5), + testutils.RandomName(5), + testutils.RandomName(5), + }, + }, + }, + }, + } +} + +func testProjectExecutionQueueAttributeUpdate( + setup func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_EXECUTION_QUEUE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectExecutionQueueAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectAttributes), + setup func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + executionqueueattribute.DefaultUpdateConfig = &executionqueueattribute.AttrUpdateConfig{} + target := newTestProjectExecutionQueueAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, executionqueueattribute.DefaultUpdateConfig, target) + } + + err := updateExecutionQueueAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + executionqueueattribute.DefaultUpdateConfig = &executionqueueattribute.AttrUpdateConfig{} +} + +func newTestProjectExecutionQueueAttribute() *admin.ProjectAttributes { + return &admin.ProjectAttributes{ + // project name needs to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ExecutionQueueAttributes{ + ExecutionQueueAttributes: &admin.ExecutionQueueAttributes{ + Tags: []string{ + testutils.RandomName(5), + testutils.RandomName(5), + testutils.RandomName(5), + }, + }, + }, + }, + } +} + +func testProjectDomainExecutionQueueAttributeUpdate( + setup func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectDomainExecutionQueueAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_EXECUTION_QUEUE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectDomainExecutionQueueAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes), + setup func(s *testutils.TestStruct, config *executionqueueattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + executionqueueattribute.DefaultUpdateConfig = &executionqueueattribute.AttrUpdateConfig{} + target := newTestProjectDomainExecutionQueueAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, executionqueueattribute.DefaultUpdateConfig, target) + } + + err := updateExecutionQueueAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + executionqueueattribute.DefaultUpdateConfig = &executionqueueattribute.AttrUpdateConfig{} +} + +func newTestProjectDomainExecutionQueueAttribute() *admin.ProjectDomainAttributes { + return &admin.ProjectDomainAttributes{ + // project and domain names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_ExecutionQueueAttributes{ + ExecutionQueueAttributes: &admin.ExecutionQueueAttributes{ + Tags: []string{ + testutils.RandomName(5), + testutils.RandomName(5), + testutils.RandomName(5), + }, + }, + }, + }, + } } diff --git a/cmd/update/matchable_plugin_override.go b/cmd/update/matchable_plugin_override.go index 981a124b..c9f6ebe9 100644 --- a/cmd/update/matchable_plugin_override.go +++ b/cmd/update/matchable_plugin_override.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" cmdCore "github.com/flyteorg/flytectl/cmd/core" @@ -77,9 +78,9 @@ func updatePluginOverridesFunc(ctx context.Context, args []string, cmdCtx cmdCor domain := pluginOverrideFileConfig.Domain workflowName := pluginOverrideFileConfig.Workflow - // Updates the admin matchable attribute from pluginOverrideFileConfig - if err := DecorateAndUpdateMatchableAttr(ctx, project, domain, workflowName, cmdCtx.AdminUpdaterExt(), - pluginOverrideFileConfig, updateConfig.DryRun); err != nil { + if err := DecorateAndUpdateMatchableAttr(ctx, cmdCtx, project, domain, workflowName, + admin.MatchableResource_PLUGIN_OVERRIDE, pluginOverrideFileConfig, + updateConfig.DryRun, updateConfig.Force); err != nil { return err } return nil diff --git a/cmd/update/matchable_plugin_override_test.go b/cmd/update/matchable_plugin_override_test.go index 5165b009..2b6e2e7f 100644 --- a/cmd/update/matchable_plugin_override_test.go +++ b/cmd/update/matchable_plugin_override_test.go @@ -7,84 +7,583 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" ) -func updatePluginOverrideSetup() { - pluginoverride.DefaultUpdateConfig = &pluginoverride.AttrUpdateConfig{} +const ( + validProjectPluginOverrideFilePath = "testdata/valid_project_plugin_override.yaml" + validProjectDomainPluginOverrideFilePath = "testdata/valid_project_domain_plugin_override.yaml" + validWorkflowPluginOverrideFilePath = "testdata/valid_workflow_plugin_override.yaml" +) + +func TestPluginOverrideUpdateRequiresAttributeFile(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "attrFile is mandatory") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestPluginOverrideUpdateFailsWhenAttributeFileDoesNotExist(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataNonExistentFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "unable to read from testdata/non-existent-file yaml file") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestPluginOverrideUpdateFailsWhenAttributeFileIsMalformed(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataInvalidAttrFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\"") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestPluginOverrideUpdateHappyPath(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestPluginOverrideUpdateFailsWithoutForceFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowPluginOverrideFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainPluginOverrideFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectPluginOverrideFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestPluginOverrideUpdateDoesNothingWithDryRunFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowPluginOverrideFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainPluginOverrideFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectPluginOverrideFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) } -func TestPluginOverride(t *testing.T) { - t.Run("no input file for update", func(t *testing.T) { - s := setup() - updatePluginOverrideSetup() - err := updatePluginOverridesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attrFile is mandatory while calling update for plugin override"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update project domain attribute", func(t *testing.T) { - s := setup() - updatePluginOverrideSetup() - pluginoverride.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_plugin_override.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(nil) - err := updatePluginOverridesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development`) - }) - t.Run("failed update project domain attribute", func(t *testing.T) { - s := setup() - updatePluginOverrideSetup() - pluginoverride.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_plugin_override.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updatePluginOverridesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update workflow attribute", func(t *testing.T) { - s := setup() - updatePluginOverrideSetup() - pluginoverride.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_plugin_override.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(nil) - err := updatePluginOverridesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development and workflow core.control_flow.merge_sort.merge_sort`) - }) - t.Run("failed update workflow attribute", func(t *testing.T) { - s := setup() - updatePluginOverrideSetup() - pluginoverride.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_plugin_override.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updatePluginOverridesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("non existent file", func(t *testing.T) { - s := setup() - updatePluginOverrideSetup() - pluginoverride.DefaultUpdateConfig.AttrFile = testDataNonExistentFile - err := updatePluginOverridesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("unable to read from testdata/non-existent-file yaml file"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("invalid update file", func(t *testing.T) { - s := setup() - updatePluginOverrideSetup() - pluginoverride.DefaultUpdateConfig.AttrFile = testDataInvalidAttrFile - err := updatePluginOverridesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\""), err) - s.TearDownAndVerify(t, ``) +func TestPluginOverrideUpdateIgnoresForceFlagWithDryRun(t *testing.T) { + t.Run("workflow without --force", func(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowPluginOverrideFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("workflow with --force", func(t *testing.T) { + testWorkflowPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowPluginOverrideFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain without --force", func(t *testing.T) { + testProjectDomainPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainPluginOverrideFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) }) + + t.Run("domain with --force", func(t *testing.T) { + testProjectDomainPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainPluginOverrideFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project without --force", func(t *testing.T) { + testProjectPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectPluginOverrideFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project with --force", func(t *testing.T) { + testProjectPluginOverrideUpdate( + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectPluginOverrideFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestPluginOverrideUpdateSucceedsWhenAttributesDoNotExist(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestPluginOverrideUpdateFailsWhenAdminClientFails(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectPluginOverrideFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func testWorkflowPluginOverrideUpdate( + setup func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testWorkflowPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testWorkflowPluginOverrideUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.WorkflowAttributes), + setup func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + pluginoverride.DefaultUpdateConfig = &pluginoverride.AttrUpdateConfig{} + target := newTestWorkflowPluginOverride() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, pluginoverride.DefaultUpdateConfig, target) + } + + err := updatePluginOverridesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + pluginoverride.DefaultUpdateConfig = &pluginoverride.AttrUpdateConfig{} +} + +func newTestWorkflowPluginOverride() *admin.WorkflowAttributes { + return &admin.WorkflowAttributes{ + // project, domain, and workflow names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + Workflow: "core.control_flow.merge_sort.merge_sort", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_PluginOverrides{ + PluginOverrides: &admin.PluginOverrides{ + Overrides: []*admin.PluginOverride{ + { + TaskType: testutils.RandomName(15), + PluginId: []string{ + testutils.RandomName(12), + testutils.RandomName(12), + testutils.RandomName(12), + }, + MissingPluginBehavior: admin.PluginOverride_FAIL, + }, + }, + }, + }, + }, + } +} + +func testProjectPluginOverrideUpdate( + setup func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectPluginOverrideUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectAttributes), + setup func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + pluginoverride.DefaultUpdateConfig = &pluginoverride.AttrUpdateConfig{} + target := newTestProjectPluginOverride() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, pluginoverride.DefaultUpdateConfig, target) + } + + err := updatePluginOverridesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + pluginoverride.DefaultUpdateConfig = &pluginoverride.AttrUpdateConfig{} +} + +func newTestProjectPluginOverride() *admin.ProjectAttributes { + return &admin.ProjectAttributes{ + // project name needs to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_PluginOverrides{ + PluginOverrides: &admin.PluginOverrides{ + Overrides: []*admin.PluginOverride{ + { + TaskType: testutils.RandomName(15), + PluginId: []string{ + testutils.RandomName(12), + testutils.RandomName(12), + testutils.RandomName(12), + }, + MissingPluginBehavior: admin.PluginOverride_FAIL, + }, + }, + }, + }, + }, + } +} + +func testProjectDomainPluginOverrideUpdate( + setup func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectDomainPluginOverrideUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_PLUGIN_OVERRIDE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectDomainPluginOverrideUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes), + setup func(s *testutils.TestStruct, config *pluginoverride.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + pluginoverride.DefaultUpdateConfig = &pluginoverride.AttrUpdateConfig{} + target := newTestProjectDomainPluginOverride() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, pluginoverride.DefaultUpdateConfig, target) + } + + err := updatePluginOverridesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + pluginoverride.DefaultUpdateConfig = &pluginoverride.AttrUpdateConfig{} +} + +func newTestProjectDomainPluginOverride() *admin.ProjectDomainAttributes { + return &admin.ProjectDomainAttributes{ + // project and domain names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_PluginOverrides{ + PluginOverrides: &admin.PluginOverrides{ + Overrides: []*admin.PluginOverride{ + { + TaskType: testutils.RandomName(15), + PluginId: []string{ + testutils.RandomName(12), + testutils.RandomName(12), + testutils.RandomName(12), + }, + MissingPluginBehavior: admin.PluginOverride_FAIL, + }, + }, + }, + }, + }, + } } diff --git a/cmd/update/matchable_task_resource_attribute.go b/cmd/update/matchable_task_resource_attribute.go index e18825c0..3e4282de 100644 --- a/cmd/update/matchable_task_resource_attribute.go +++ b/cmd/update/matchable_task_resource_attribute.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" @@ -77,9 +78,9 @@ func updateTaskResourceAttributesFunc(ctx context.Context, args []string, cmdCtx domain := taskResourceAttrFileConfig.Domain workflowName := taskResourceAttrFileConfig.Workflow - // Updates the admin matchable attribute from taskResourceAttrFileConfig - if err := DecorateAndUpdateMatchableAttr(ctx, project, domain, workflowName, cmdCtx.AdminUpdaterExt(), - taskResourceAttrFileConfig, updateConfig.DryRun); err != nil { + if err := DecorateAndUpdateMatchableAttr(ctx, cmdCtx, project, domain, workflowName, + admin.MatchableResource_TASK_RESOURCE, taskResourceAttrFileConfig, + updateConfig.DryRun, updateConfig.Force); err != nil { return err } return nil diff --git a/cmd/update/matchable_task_resource_attribute_test.go b/cmd/update/matchable_task_resource_attribute_test.go index e9135f13..cad06fa7 100644 --- a/cmd/update/matchable_task_resource_attribute_test.go +++ b/cmd/update/matchable_task_resource_attribute_test.go @@ -7,84 +7,562 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" ) -func updateTaskResourceAttributeSetup() { - taskresourceattribute.DefaultUpdateConfig = &taskresourceattribute.AttrUpdateConfig{} +const ( + validProjectTaskAttributesFilePath = "testdata/valid_project_task_attribute.yaml" + validProjectDomainTaskAttributesFilePath = "testdata/valid_project_domain_task_attribute.yaml" + validWorkflowTaskAttributesFilePath = "testdata/valid_workflow_task_attribute.yaml" +) + +func TestTaskResourceAttributeUpdateRequiresAttributeFile(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "attrFile is mandatory") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestTaskResourceAttributeUpdateFailsWhenAttributeFileDoesNotExist(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataNonExistentFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "unable to read from testdata/non-existent-file yaml file") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestTaskResourceAttributeUpdateFailsWhenAttributeFileIsMalformed(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataInvalidAttrFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\"") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestTaskResourceAttributeUpdateHappyPath(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestTaskResourceAttributeUpdateFailsWithoutForceFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowTaskAttributesFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainTaskAttributesFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectTaskAttributesFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestTaskResourceAttributeUpdateDoesNothingWithDryRunFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowTaskAttributesFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainTaskAttributesFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectTaskAttributesFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) } -func TestUpdateTaskResourceAttributes(t *testing.T) { - t.Run("no input file for update", func(t *testing.T) { - s := setup() - updateTaskResourceAttributeSetup() - err := updateTaskResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attrFile is mandatory while calling update for task resource attribute"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update project domain attribute", func(t *testing.T) { - s := setup() - updateTaskResourceAttributeSetup() - taskresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_task_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(nil) - err := updateTaskResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development`) - }) - t.Run("failed update project domain attribute", func(t *testing.T) { - s := setup() - updateTaskResourceAttributeSetup() - taskresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_task_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateTaskResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update workflow attribute", func(t *testing.T) { - s := setup() - updateTaskResourceAttributeSetup() - taskresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_task_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(nil) - err := updateTaskResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development and workflow core.control_flow.merge_sort.merge_sort`) - }) - t.Run("failed update workflow attribute", func(t *testing.T) { - s := setup() - updateTaskResourceAttributeSetup() - taskresourceattribute.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_task_attribute.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateTaskResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("non existent file", func(t *testing.T) { - s := setup() - updateTaskResourceAttributeSetup() - taskresourceattribute.DefaultUpdateConfig.AttrFile = testDataNonExistentFile - err := updateTaskResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("unable to read from testdata/non-existent-file yaml file"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("invalid update file", func(t *testing.T) { - s := setup() - updateTaskResourceAttributeSetup() - taskresourceattribute.DefaultUpdateConfig.AttrFile = testDataInvalidAttrFile - err := updateTaskResourceAttributesFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\""), err) - s.TearDownAndVerify(t, ``) +func TestTaskResourceAttributeUpdateIgnoresForceFlagWithDryRun(t *testing.T) { + t.Run("workflow without --force", func(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowTaskAttributesFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("workflow with --force", func(t *testing.T) { + testWorkflowTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowTaskAttributesFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain without --force", func(t *testing.T) { + testProjectDomainTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainTaskAttributesFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) }) + + t.Run("domain with --force", func(t *testing.T) { + testProjectDomainTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainTaskAttributesFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project without --force", func(t *testing.T) { + testProjectTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectTaskAttributesFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project with --force", func(t *testing.T) { + testProjectTaskResourceAttributeUpdate( + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectTaskAttributesFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestTaskResourceAttributeUpdateSucceedsWhenAttributesDoNotExist(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_TASK_RESOURCE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_TASK_RESOURCE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_TASK_RESOURCE). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestTaskResourceAttributeUpdateFailsWhenAdminClientFails(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_TASK_RESOURCE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_TASK_RESOURCE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_TASK_RESOURCE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectTaskAttributesFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func testWorkflowTaskResourceAttributeUpdate( + setup func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testWorkflowTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_TASK_RESOURCE). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testWorkflowTaskResourceAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.WorkflowAttributes), + setup func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + taskresourceattribute.DefaultUpdateConfig = &taskresourceattribute.AttrUpdateConfig{} + target := newTestWorkflowTaskResourceAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, taskresourceattribute.DefaultUpdateConfig, target) + } + + err := updateTaskResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + taskresourceattribute.DefaultUpdateConfig = &taskresourceattribute.AttrUpdateConfig{} +} + +func newTestWorkflowTaskResourceAttribute() *admin.WorkflowAttributes { + return &admin.WorkflowAttributes{ + // project, domain, and workflow names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + Workflow: "core.control_flow.merge_sort.merge_sort", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_TaskResourceAttributes{ + TaskResourceAttributes: &admin.TaskResourceAttributes{ + Defaults: &admin.TaskResourceSpec{ + Cpu: testutils.RandomName(2), + Memory: testutils.RandomName(5), + }, + }, + }, + }, + } +} + +func testProjectTaskResourceAttributeUpdate( + setup func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_TASK_RESOURCE). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectTaskResourceAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectAttributes), + setup func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + taskresourceattribute.DefaultUpdateConfig = &taskresourceattribute.AttrUpdateConfig{} + target := newTestProjectTaskResourceAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, taskresourceattribute.DefaultUpdateConfig, target) + } + + err := updateTaskResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + taskresourceattribute.DefaultUpdateConfig = &taskresourceattribute.AttrUpdateConfig{} +} + +func newTestProjectTaskResourceAttribute() *admin.ProjectAttributes { + return &admin.ProjectAttributes{ + // project name needs to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_TaskResourceAttributes{ + TaskResourceAttributes: &admin.TaskResourceAttributes{ + Defaults: &admin.TaskResourceSpec{ + Cpu: testutils.RandomName(2), + Memory: testutils.RandomName(5), + }, + }, + }, + }, + } +} + +func testProjectDomainTaskResourceAttributeUpdate( + setup func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectDomainTaskResourceAttributeUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_TASK_RESOURCE). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectDomainTaskResourceAttributeUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes), + setup func(s *testutils.TestStruct, config *taskresourceattribute.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + taskresourceattribute.DefaultUpdateConfig = &taskresourceattribute.AttrUpdateConfig{} + target := newTestProjectDomainTaskResourceAttribute() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, taskresourceattribute.DefaultUpdateConfig, target) + } + + err := updateTaskResourceAttributesFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + taskresourceattribute.DefaultUpdateConfig = &taskresourceattribute.AttrUpdateConfig{} +} + +func newTestProjectDomainTaskResourceAttribute() *admin.ProjectDomainAttributes { + return &admin.ProjectDomainAttributes{ + // project and domain names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_TaskResourceAttributes{ + TaskResourceAttributes: &admin.TaskResourceAttributes{ + Defaults: &admin.TaskResourceSpec{ + Cpu: testutils.RandomName(2), + Memory: testutils.RandomName(5), + }, + }, + }, + }, + } } diff --git a/cmd/update/matchable_workflow_execution_config.go b/cmd/update/matchable_workflow_execution_config.go index b9489d67..2921dbcf 100644 --- a/cmd/update/matchable_workflow_execution_config.go +++ b/cmd/update/matchable_workflow_execution_config.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" @@ -74,9 +75,9 @@ func updateWorkflowExecutionConfigFunc(ctx context.Context, args []string, cmdCt domain := workflowExecutionConfigFileConfig.Domain workflowName := workflowExecutionConfigFileConfig.Workflow - // Updates the admin matchable attribute from workflowExecutionConfigFileConfig - if err := DecorateAndUpdateMatchableAttr(ctx, project, domain, workflowName, cmdCtx.AdminUpdaterExt(), - workflowExecutionConfigFileConfig, updateConfig.DryRun); err != nil { + if err := DecorateAndUpdateMatchableAttr(ctx, cmdCtx, project, domain, workflowName, + admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG, workflowExecutionConfigFileConfig, + updateConfig.DryRun, updateConfig.Force); err != nil { return err } return nil diff --git a/cmd/update/matchable_workflow_execution_config_test.go b/cmd/update/matchable_workflow_execution_config_test.go index 9f5ef81b..3fd198e5 100644 --- a/cmd/update/matchable_workflow_execution_config_test.go +++ b/cmd/update/matchable_workflow_execution_config_test.go @@ -4,87 +4,577 @@ import ( "fmt" "testing" - "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" ) -func updateWorkflowExecutionConfigSetup() { - workflowexecutionconfig.DefaultUpdateConfig = &workflowexecutionconfig.AttrUpdateConfig{} +const ( + validProjectWorkflowExecutionConfigFilePath = "testdata/valid_project_workflow_execution_config.yaml" + validProjectDomainWorkflowExecutionConfigFilePath = "testdata/valid_project_domain_workflow_execution_config.yaml" + validWorkflowExecutionConfigFilePath = "testdata/valid_workflow_workflow_execution_config.yaml" +) + +func TestWorkflowExecutionConfigUpdateRequiresAttributeFile(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "attrFile is mandatory") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestWorkflowExecutionConfigUpdateFailsWhenAttributeFileDoesNotExist(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataNonExistentFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "unable to read from testdata/non-existent-file yaml file") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestWorkflowExecutionConfigUpdateFailsWhenAttributeFileIsMalformed(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = testDataInvalidAttrFile + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\"") + s.UpdaterExt.AssertNotCalled(t, "FetchWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) +} + +func TestWorkflowExecutionConfigUpdateHappyPath(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestWorkflowExecutionConfigUpdateFailsWithoutForceFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionConfigFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainWorkflowExecutionConfigFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectWorkflowExecutionConfigFilePath + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestWorkflowExecutionConfigUpdateDoesNothingWithDryRunFlag(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionConfigFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainWorkflowExecutionConfigFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectWorkflowExecutionConfigFilePath + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func TestWorkflowExecutionConfigUpdateIgnoresForceFlagWithDryRun(t *testing.T) { + t.Run("workflow without --force", func(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionConfigFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("workflow with --force", func(t *testing.T) { + testWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionConfigFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain without --force", func(t *testing.T) { + testProjectDomainWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainWorkflowExecutionConfigFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain with --force", func(t *testing.T) { + testProjectDomainWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainWorkflowExecutionConfigFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project without --force", func(t *testing.T) { + testProjectWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectWorkflowExecutionConfigFilePath + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project with --force", func(t *testing.T) { + testProjectWorkflowExecutionConfigUpdate( + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectWorkflowExecutionConfigFilePath + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertNotCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) } -func TestWorkflowExecutionConfigs(t *testing.T) { - t.Run("no input file for update", func(t *testing.T) { - s := setup() - updateWorkflowExecutionConfigSetup() - err := updateWorkflowExecutionConfigFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attrFile is mandatory while calling update for workflow execution config"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update project domain attribute", func(t *testing.T) { - s := setup() - updateWorkflowExecutionConfigSetup() - workflowexecutionconfig.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_workflow_execution_config.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(nil) - err := updateWorkflowExecutionConfigFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development`) - }) - t.Run("failed update project domain attribute", func(t *testing.T) { - s := setup() - updateWorkflowExecutionConfigSetup() - workflowexecutionconfig.DefaultUpdateConfig.AttrFile = "testdata/valid_project_domain_workflow_execution_config.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateWorkflowExecutionConfigFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("successful update workflow attribute", func(t *testing.T) { - s := setup() - updateWorkflowExecutionConfigSetup() - workflowexecutionconfig.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_workflow_execution_config.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(nil) - err := updateWorkflowExecutionConfigFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.TearDownAndVerify(t, `Updated attributes from flytesnacks project and domain development and workflow core.control_flow.merge_sort.merge_sort`) - }) - t.Run("failed update workflow attribute", func(t *testing.T) { - s := setup() - updateWorkflowExecutionConfigSetup() - workflowexecutionconfig.DefaultUpdateConfig.AttrFile = "testdata/valid_workflow_workflow_execution_config.yaml" - // No args implying project domain attribute deletion - s.UpdaterExt.OnUpdateWorkflowAttributesMatch(mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything).Return(fmt.Errorf("failed to update attributes")) - err := updateWorkflowExecutionConfigFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("failed to update attributes"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("non existent file", func(t *testing.T) { - s := setup() - updateWorkflowExecutionConfigSetup() - workflowexecutionconfig.DefaultUpdateConfig.AttrFile = testDataNonExistentFile - err := updateWorkflowExecutionConfigFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("unable to read from testdata/non-existent-file yaml file"), err) - s.TearDownAndVerify(t, ``) - }) - t.Run("invalid update file", func(t *testing.T) { - s := setup() - updateWorkflowExecutionConfigSetup() - workflowexecutionconfig.DefaultUpdateConfig.AttrFile = testDataInvalidAttrFile - err := updateWorkflowExecutionConfigFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("error unmarshaling JSON: while decoding JSON: json: unknown field \"InvalidDomain\""), err) - s.TearDownAndVerify(t, ``) +func TestWorkflowExecutionConfigUpdateSucceedsWhenAttributesDoNotExist(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project and domain development`) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(nil, ext.NewNotFoundError("attribute")) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + s.TearDownAndVerifyContains(t, `Updated attributes from flytesnacks project`) + }) + }) +} + +func TestWorkflowExecutionConfigUpdateFailsWhenAdminClientFails(t *testing.T) { + t.Run("workflow", func(t *testing.T) { + testWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes) { + config.AttrFile = validWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateWorkflowAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("domain", func(t *testing.T) { + testProjectDomainWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes) { + config.AttrFile = validProjectDomainWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectDomainAttributes", mock.Anything, mock.Anything, mock.Anything, mock.Anything) + }) + }) + + t.Run("project", func(t *testing.T) { + testProjectWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes) { + config.AttrFile = validProjectWorkflowExecutionConfigFilePath + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.UpdaterExt.AssertCalled(t, "UpdateProjectAttributes", mock.Anything, mock.Anything, mock.Anything) + }) + }) +} + +func testWorkflowExecutionConfigUpdate( + setup func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.WorkflowAttributes) { + s.FetcherExt. + OnFetchWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(&admin.WorkflowAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateWorkflowAttributesMatch(s.Ctx, target.Project, target.Domain, target.Workflow, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testWorkflowExecutionConfigUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.WorkflowAttributes), + setup func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.WorkflowAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + workflowexecutionconfig.DefaultUpdateConfig = &workflowexecutionconfig.AttrUpdateConfig{} + target := newTestWorkflowExecutionConfig() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, workflowexecutionconfig.DefaultUpdateConfig, target) + } + + err := updateWorkflowExecutionConfigFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + workflowexecutionconfig.DefaultUpdateConfig = &workflowexecutionconfig.AttrUpdateConfig{} +} + +func newTestWorkflowExecutionConfig() *admin.WorkflowAttributes { + return &admin.WorkflowAttributes{ + // project, domain, and workflow names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + Workflow: "core.control_flow.merge_sort.merge_sort", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_WorkflowExecutionConfig{ + WorkflowExecutionConfig: &admin.WorkflowExecutionConfig{ + MaxParallelism: 1337, + Annotations: &admin.Annotations{ + Values: map[string]string{ + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + }, + }, + }, + }, + }, + } +} + +func testProjectWorkflowExecutionConfigUpdate( + setup func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectAttributes) { + s.FetcherExt. + OnFetchProjectAttributesMatch(s.Ctx, target.Project, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(&admin.ProjectAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectAttributesMatch(s.Ctx, target.Project, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectWorkflowExecutionConfigUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectAttributes), + setup func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + workflowexecutionconfig.DefaultUpdateConfig = &workflowexecutionconfig.AttrUpdateConfig{} + target := newTestProjectWorkflowExecutionConfig() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, workflowexecutionconfig.DefaultUpdateConfig, target) + } + + err := updateWorkflowExecutionConfigFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + workflowexecutionconfig.DefaultUpdateConfig = &workflowexecutionconfig.AttrUpdateConfig{} +} + +func newTestProjectWorkflowExecutionConfig() *admin.ProjectAttributes { + return &admin.ProjectAttributes{ + // project name needs to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_WorkflowExecutionConfig{ + WorkflowExecutionConfig: &admin.WorkflowExecutionConfig{ + MaxParallelism: 1337, + Annotations: &admin.Annotations{ + Values: map[string]string{ + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + }, + }, + }, + }, + }, + } +} + +func testProjectDomainWorkflowExecutionConfigUpdate( + setup func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectDomainWorkflowExecutionConfigUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes) { + s.FetcherExt. + OnFetchProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG). + Return(&admin.ProjectDomainAttributesGetResponse{Attributes: target}, nil) + s.UpdaterExt. + OnUpdateProjectDomainAttributesMatch(s.Ctx, target.Project, target.Domain, mock.Anything). + Return(nil) + }, + setup, + asserter, + ) +} + +func testProjectDomainWorkflowExecutionConfigUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, target *admin.ProjectDomainAttributes), + setup func(s *testutils.TestStruct, config *workflowexecutionconfig.AttrUpdateConfig, target *admin.ProjectDomainAttributes), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + workflowexecutionconfig.DefaultUpdateConfig = &workflowexecutionconfig.AttrUpdateConfig{} + target := newTestProjectDomainWorkflowExecutionConfig() + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, workflowexecutionconfig.DefaultUpdateConfig, target) + } + + err := updateWorkflowExecutionConfigFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + workflowexecutionconfig.DefaultUpdateConfig = &workflowexecutionconfig.AttrUpdateConfig{} +} + +func newTestProjectDomainWorkflowExecutionConfig() *admin.ProjectDomainAttributes { + return &admin.ProjectDomainAttributes{ + // project and domain names need to be same as in the tests spec files in testdata folder + Project: "flytesnacks", + Domain: "development", + MatchingAttributes: &admin.MatchingAttributes{ + Target: &admin.MatchingAttributes_WorkflowExecutionConfig{ + WorkflowExecutionConfig: &admin.WorkflowExecutionConfig{ + MaxParallelism: 1337, + Annotations: &admin.Annotations{ + Values: map[string]string{ + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + testutils.RandomName(5): testutils.RandomName(10), + }, + }, + }, + }, + }, + } } diff --git a/cmd/update/named_entity.go b/cmd/update/named_entity.go index 7ca988b2..449639d7 100644 --- a/cmd/update/named_entity.go +++ b/cmd/update/named_entity.go @@ -3,12 +3,13 @@ package update import ( "context" "fmt" + "os" - "github.com/flyteorg/flytectl/clierrors" - cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flytectl/clierrors" + cmdCore "github.com/flyteorg/flytectl/cmd/core" + cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" ) //go:generate pflags NamedEntityConfig --default-var namedEntityConfig --bind-default-var @@ -22,38 +23,80 @@ type NamedEntityConfig struct { Activate bool `json:"activate" pflag:",activate the named entity."` Description string `json:"description" pflag:",description of the named entity."` DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Force bool `json:"force" pflag:",do not ask for an acknowledgement during updates."` } func (cfg NamedEntityConfig) UpdateNamedEntity(ctx context.Context, name string, project string, domain string, rsType core.ResourceType, cmdCtx cmdCore.CommandContext) error { - archiveProject := cfg.Archive - activateProject := cfg.Activate - if activateProject == archiveProject && activateProject { + if cfg.Activate && cfg.Archive { return fmt.Errorf(clierrors.ErrInvalidStateUpdate) } - var nameEntityState admin.NamedEntityState - if activateProject { - nameEntityState = admin.NamedEntityState_NAMED_ENTITY_ACTIVE - } else if archiveProject { - nameEntityState = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + + id := &admin.NamedEntityIdentifier{ + Project: project, + Domain: domain, + Name: name, + } + + namedEntity, err := cmdCtx.AdminClient().GetNamedEntity(ctx, &admin.NamedEntityGetRequest{ + ResourceType: rsType, + Id: id, + }) + if err != nil { + return fmt.Errorf("update metadata for %s: could not fetch metadata: %w", name, err) + } + + oldMetadata, newMetadata := composeNamedMetadataEdits(cfg, namedEntity.Metadata) + patch, err := DiffAsYaml(diffPathBefore, diffPathAfter, oldMetadata, newMetadata) + if err != nil { + panic(err) } + if patch == "" { + fmt.Printf("No changes detected. Skipping the update.\n") + return nil + } + + fmt.Printf("The following changes are to be applied.\n%s\n", patch) + if cfg.DryRun { - logger.Infof(ctx, "skipping UpdateNamedEntity request (dryRun)") - } else { - _, err := cmdCtx.AdminClient().UpdateNamedEntity(ctx, &admin.NamedEntityUpdateRequest{ - ResourceType: rsType, - Id: &admin.NamedEntityIdentifier{ - Project: project, - Domain: domain, - Name: name, - }, - Metadata: &admin.NamedEntityMetadata{ - Description: cfg.Description, - State: nameEntityState, - }, - }) - if err != nil { - return err - } + fmt.Printf("skipping UpdateNamedEntity request (dryRun)\n") + return nil } + + if !cfg.Force && !cmdUtil.AskForConfirmation("Continue?", os.Stdin) { + return fmt.Errorf("update aborted by user") + } + + _, err = cmdCtx.AdminClient().UpdateNamedEntity(ctx, &admin.NamedEntityUpdateRequest{ + ResourceType: rsType, + Id: id, + Metadata: newMetadata, + }) + if err != nil { + return fmt.Errorf("update metadata for %s: update failed: %w", name, err) + } + return nil } + +func composeNamedMetadataEdits(config NamedEntityConfig, current *admin.NamedEntityMetadata) (old *admin.NamedEntityMetadata, new *admin.NamedEntityMetadata) { + old = &admin.NamedEntityMetadata{} + new = &admin.NamedEntityMetadata{} + + switch { + case config.Activate && config.Archive: + panic("cannot both activate and archive") + case config.Activate: + old.State = current.State + new.State = admin.NamedEntityState_NAMED_ENTITY_ACTIVE + case config.Archive: + old.State = current.State + new.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + } + + if config.Description != "" { + old.Description = current.Description + new.Description = config.Description + } + + return old, new +} diff --git a/cmd/update/named_entity_test.go b/cmd/update/named_entity_test.go index b763d2f8..b02d6a50 100644 --- a/cmd/update/named_entity_test.go +++ b/cmd/update/named_entity_test.go @@ -1,39 +1,97 @@ package update import ( + "context" "fmt" - "testing" - "github.com/flyteorg/flytectl/cmd/testutils" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/mock" - "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/flytectl/cmd/config" + cmdCore "github.com/flyteorg/flytectl/cmd/core" + "github.com/flyteorg/flytectl/cmd/testutils" ) -func TestNamedEntity(t *testing.T) { - s := testutils.Setup() - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(&admin.NamedEntityUpdateResponse{}, nil) - namedEntityConfig = &NamedEntityConfig{Archive: false, Activate: true, Description: "named entity description"} - assert.Nil(t, namedEntityConfig.UpdateNamedEntity(s.Ctx, "namedEntity", "project", "domain", - core.ResourceType_WORKFLOW, s.CmdCtx)) - namedEntityConfig = &NamedEntityConfig{Archive: true, Activate: false, Description: "named entity description"} - assert.Nil(t, namedEntityConfig.UpdateNamedEntity(s.Ctx, "namedEntity", "project", "domain", - core.ResourceType_WORKFLOW, s.CmdCtx)) +func testNamedEntityUpdate( + resourceType core.ResourceType, + setup func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity), + asserter func(s *testutils.TestStruct, err error), +) { + testNamedEntityUpdateWithMockSetup( + resourceType, + /* mockSetup */ func(s *testutils.TestStruct, namedEntity *admin.NamedEntity) { + s.MockAdminClient. + OnGetNamedEntityMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.NamedEntityGetRequest) bool { + return r.ResourceType == namedEntity.ResourceType && + cmp.Equal(r.Id, namedEntity.Id) + })). + Return(namedEntity, nil) + s.MockAdminClient. + OnUpdateNamedEntityMatch(s.Ctx, mock.Anything). + Return(&admin.NamedEntityUpdateResponse{}, nil) + }, + setup, + asserter, + ) } -func TestNamedEntityValidationFailure(t *testing.T) { +func testNamedEntityUpdateWithMockSetup( + resourceType core.ResourceType, + mockSetup func(s *testutils.TestStruct, namedEntity *admin.NamedEntity), + setup func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity), + asserter func(s *testutils.TestStruct, err error), +) { s := testutils.Setup() - namedEntityConfig := &NamedEntityConfig{Archive: true, Activate: true, Description: "named entity description"} - assert.NotNil(t, namedEntityConfig.UpdateNamedEntity(s.Ctx, "namedEntity", "project", "domain", - core.ResourceType_WORKFLOW, s.CmdCtx)) + config := &NamedEntityConfig{} + target := newTestNamedEntity(resourceType) + + if mockSetup != nil { + mockSetup(&s, target) + } + + if setup != nil { + setup(&s, config, target) + } + + updateMetadataFactory := getUpdateMetadataFactory(resourceType) + + args := []string{target.Id.Name} + err := updateMetadataFactory(config)(s.Ctx, args, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } } -func TestNamedEntityFailure(t *testing.T) { - s := testutils.Setup() - namedEntityConfig := &NamedEntityConfig{Archive: true, Activate: true, Description: "named entity description"} - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) - assert.NotNil(t, namedEntityConfig.UpdateNamedEntity(s.Ctx, "namedEntity", "project", "domain", - core.ResourceType_WORKFLOW, s.CmdCtx)) +func newTestNamedEntity(resourceType core.ResourceType) *admin.NamedEntity { + return &admin.NamedEntity{ + Id: &admin.NamedEntityIdentifier{ + Name: testutils.RandomName(12), + Project: config.GetConfig().Project, + Domain: config.GetConfig().Domain, + }, + ResourceType: resourceType, + Metadata: &admin.NamedEntityMetadata{ + State: admin.NamedEntityState_NAMED_ENTITY_ACTIVE, + Description: testutils.RandomName(50), + }, + } +} + +func getUpdateMetadataFactory(resourceType core.ResourceType) func(namedEntityConfig *NamedEntityConfig) func(ctx context.Context, args []string, cmdCtx cmdCore.CommandContext) error { + switch resourceType { + case core.ResourceType_LAUNCH_PLAN: + return getUpdateLPMetaFunc + case core.ResourceType_TASK: + return getUpdateTaskFunc + case core.ResourceType_WORKFLOW: + return getUpdateWorkflowFunc + } + + panic(fmt.Sprintf("no known mapping exists between resource type %s and "+ + "corresponding update metadata factory function", resourceType)) } diff --git a/cmd/update/namedentityconfig_flags.go b/cmd/update/namedentityconfig_flags.go index 8d3b7a96..2f1345bc 100755 --- a/cmd/update/namedentityconfig_flags.go +++ b/cmd/update/namedentityconfig_flags.go @@ -54,5 +54,6 @@ func (cfg NamedEntityConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.BoolVar(&namedEntityConfig.Activate, fmt.Sprintf("%v%v", prefix, "activate"), namedEntityConfig.Activate, "activate the named entity.") cmdFlags.StringVar(&namedEntityConfig.Description, fmt.Sprintf("%v%v", prefix, "description"), namedEntityConfig.Description, "description of the named entity.") cmdFlags.BoolVar(&namedEntityConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), namedEntityConfig.DryRun, "execute command without making any modifications.") + cmdFlags.BoolVar(&namedEntityConfig.Force, fmt.Sprintf("%v%v", prefix, "force"), namedEntityConfig.Force, "do not ask for an acknowledgement during updates.") return cmdFlags } diff --git a/cmd/update/namedentityconfig_flags_test.go b/cmd/update/namedentityconfig_flags_test.go index 9c85b8be..43cf00ec 100755 --- a/cmd/update/namedentityconfig_flags_test.go +++ b/cmd/update/namedentityconfig_flags_test.go @@ -155,4 +155,18 @@ func TestNamedEntityConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_force", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("force", testValue) + if vBool, err := cmdFlags.GetBool("force"); err == nil { + testDecodeJson_NamedEntityConfig(t, fmt.Sprintf("%v", vBool), &actual.Force) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) } diff --git a/cmd/update/project.go b/cmd/update/project.go index d9f4b5f1..b9c2f17e 100644 --- a/cmd/update/project.go +++ b/cmd/update/project.go @@ -3,12 +3,14 @@ package update import ( "context" "fmt" + "os" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/cmd/config/subcommand/project" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flytestdlib/logger" + cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" ) const ( @@ -30,7 +32,7 @@ Incorrect usage when passing both archive and activate: :: - flytectl update project -p flytesnacks --archiveProject --activate + flytectl update project -p flytesnacks --archive --activate Incorrect usage when passing unknown-project: @@ -42,7 +44,7 @@ project ID is required flag :: - flytectl update project unknown-project --archiveProject + flytectl update project unknown-project --archive Update projects.(project/projects can be used interchangeably in these commands) @@ -83,24 +85,70 @@ Usage ) func updateProjectsFunc(ctx context.Context, args []string, cmdCtx cmdCore.CommandContext) error { - projectSpec, err := project.DefaultProjectConfig.GetProjectSpec(config.GetConfig()) + edits, err := project.DefaultProjectConfig.GetProjectSpec(config.GetConfig()) if err != nil { return err } - if projectSpec.Id == "" { + if edits.Id == "" { return fmt.Errorf(clierrors.ErrProjectNotPassed) } + currentProject, err := cmdCtx.AdminFetcherExt().GetProjectByID(ctx, edits.Id) + if err != nil { + return fmt.Errorf("update project %s: could not fetch project: %w", edits.Id, err) + } + + // We do not compare currentProject against edits directly, because edits does not + // have a complete set of project's fields - it will only contain fields that + // the update command allows updating. (For example, it won't have Domains field + // initialized.) + currentProjectWithEdits := copyProjectWithEdits(currentProject, edits) + patch, err := DiffAsYaml(diffPathBefore, diffPathAfter, currentProject, currentProjectWithEdits) + if err != nil { + panic(err) + } + if patch == "" { + fmt.Printf("No changes detected. Skipping the update.\n") + return nil + } + + fmt.Printf("The following changes are to be applied.\n%s\n", patch) + if project.DefaultProjectConfig.DryRun { - logger.Infof(ctx, "skipping UpdateProject request (dryRun)") - } else { - _, err := cmdCtx.AdminClient().UpdateProject(ctx, projectSpec) - if err != nil { - fmt.Printf(clierrors.ErrFailedProjectUpdate, projectSpec.Id, err) - return err - } + fmt.Printf("skipping UpdateProject request (dryRun)\n") + return nil + } + + if !project.DefaultProjectConfig.Force && !cmdUtil.AskForConfirmation("Continue?", os.Stdin) { + return fmt.Errorf("update aborted by user") } - fmt.Printf("Project %v updated\n", projectSpec.Id) + + _, err = cmdCtx.AdminClient().UpdateProject(ctx, edits) + if err != nil { + return fmt.Errorf(clierrors.ErrFailedProjectUpdate, edits.Id, err) + } + + fmt.Printf("project %s updated\n", edits.Id) return nil } + +// Makes a shallow copy of target and applies certain properties from edited to it. +// The properties applied are only the ones supported by update command: state, name, +// description, labels, etc. +func copyProjectWithEdits(target *admin.Project, edited *admin.Project) *admin.Project { + copy := *target + + copy.State = edited.State + if edited.Name != "" { + copy.Name = edited.Name + } + if edited.Description != "" { + copy.Description = edited.Description + } + if len(edited.GetLabels().GetValues()) != 0 { + copy.Labels = edited.Labels + } + + return © +} diff --git a/cmd/update/project_test.go b/cmd/update/project_test.go index 8146cd2b..2f3fd11a 100644 --- a/cmd/update/project_test.go +++ b/cmd/update/project_test.go @@ -1,143 +1,258 @@ package update import ( - "errors" "fmt" "testing" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config/subcommand/project" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) -const projectValue = "dummyProject" +func TestProjectCanBeActivated(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateProject", s.Ctx, + mock.MatchedBy( + func(r *admin.Project) bool { + return r.State == admin.Project_ACTIVE + })) + }) +} -var ( - projectUpdateRequest *admin.Project -) +func TestProjectCanBeArchived(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ACTIVE + config.Archive = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateProject", s.Ctx, + mock.MatchedBy( + func(r *admin.Project) bool { + return r.State == admin.Project_ARCHIVED + })) + }) +} -func updateProjectSetup() { - projectUpdateRequest = &admin.Project{ - Id: projectValue, - State: admin.Project_ACTIVE, - } +func TestProjectCannotBeActivatedAndArchivedAtTheSameTime(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + config.Activate = true + config.Archive = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "Specify either activate or archive") + s.MockAdminClient.AssertNotCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }) } -func modifyProjectFlags(newArchiveVal bool, newActivateVal bool) { - project.DefaultProjectConfig.ArchiveProject = newArchiveVal - project.DefaultProjectConfig.Archive = newArchiveVal - project.DefaultProjectConfig.ActivateProject = newActivateVal - project.DefaultProjectConfig.Activate = newActivateVal +func TestProjectUpdateDoesNothingWhenThereAreNoChanges(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }) } -func TestActivateProjectFunc(t *testing.T) { - s := setup() - updateProjectSetup() - config.GetConfig().Project = projectValue - project.DefaultProjectConfig.Name = projectValue - modifyProjectFlags(false, true) - projectUpdateRequest = &admin.Project{ - Id: projectValue, - Name: projectValue, - Labels: &admin.Labels{ - Values: map[string]string{}, +func TestProjectUpdateWithoutForceFlagFails(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ARCHIVED + config.Activate = true + config.Force = false }, - State: admin.Project_ACTIVE, - } - s.MockAdminClient.OnUpdateProjectMatch(s.Ctx, projectUpdateRequest).Return(nil, nil) - err := updateProjectsFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.MockAdminClient.AssertCalled(t, "UpdateProject", s.Ctx, projectUpdateRequest) - s.TearDownAndVerify(t, "Project dummyProject updated\n") + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.MockAdminClient.AssertNotCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }) } -func TestActivateProjectFuncWithError(t *testing.T) { - s := setup() - updateProjectSetup() - config.GetConfig().Project = projectValue - project.DefaultProjectConfig.Name = projectValue - modifyProjectFlags(false, true) - projectUpdateRequest = &admin.Project{ - Id: projectValue, - Name: projectValue, - Labels: &admin.Labels{ - Values: map[string]string{}, +func TestProjectUpdateDoesNothingWithDryRunFlag(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ARCHIVED + config.Activate = true + config.DryRun = true }, - State: admin.Project_ACTIVE, - } - s.MockAdminClient.OnUpdateProjectMatch(s.Ctx, projectUpdateRequest).Return(nil, errors.New("Error Updating Project")) - err := updateProjectsFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - s.MockAdminClient.AssertCalled(t, "UpdateProject", s.Ctx, projectUpdateRequest) - s.TearDownAndVerify(t, "Project dummyProject failed to update due to Error Updating Project\n") + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }) } -func TestArchiveProjectFunc(t *testing.T) { - s := setup() - updateProjectSetup() - config.GetConfig().Project = projectValue - project.DefaultProjectConfig = &project.ConfigProject{} - project.DefaultProjectConfig.Name = projectValue - modifyProjectFlags(true, false) - projectUpdateRequest = &admin.Project{ - Id: projectValue, - Name: projectValue, - Labels: &admin.Labels{ - Values: nil, +func TestForceFlagIsIgnoredWithDryRunDuringProjectUpdate(t *testing.T) { + t.Run("without --force", func(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ARCHIVED + config.Activate = true + + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }) + }) + + t.Run("with --force", func(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ARCHIVED + config.Activate = true + + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }) + }) +} + +func TestProjectUpdateFailsWhenProjectDoesNotExist(t *testing.T) { + testProjectUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, project *admin.Project) { + s.FetcherExt. + OnGetProjectByID(s.Ctx, project.Id). + Return(nil, ext.NewNotFoundError("project not found")) + s.MockAdminClient. + OnUpdateProjectMatch(s.Ctx, mock.Anything). + Return(&admin.ProjectUpdateResponse{}, nil) }, - State: admin.Project_ARCHIVED, - } - s.MockAdminClient.OnUpdateProjectMatch(s.Ctx, projectUpdateRequest).Return(nil, nil) - err := updateProjectsFunc(s.Ctx, []string{}, s.CmdCtx) - assert.Nil(t, err) - s.MockAdminClient.AssertCalled(t, "UpdateProject", s.Ctx, projectUpdateRequest) - s.TearDownAndVerify(t, "Project dummyProject updated\n") + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }, + ) } -func TestArchiveProjectFuncWithError(t *testing.T) { - s := setup() - updateProjectSetup() - project.DefaultProjectConfig.Name = projectValue - project.DefaultProjectConfig.Labels = map[string]string{} - modifyProjectFlags(true, false) - projectUpdateRequest = &admin.Project{ - Id: projectValue, - Name: projectValue, - Labels: &admin.Labels{ - Values: map[string]string{}, +func TestProjectUpdateFailsWhenAdminClientFails(t *testing.T) { + testProjectUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, project *admin.Project) { + s.FetcherExt. + OnGetProjectByID(s.Ctx, project.Id). + Return(project, nil) + s.MockAdminClient. + OnUpdateProjectMatch(s.Ctx, mock.Anything). + Return(nil, fmt.Errorf("network error")) }, - State: admin.Project_ARCHIVED, - } - s.MockAdminClient.OnUpdateProjectMatch(s.Ctx, projectUpdateRequest).Return(nil, errors.New("Error Updating Project")) - err := updateProjectsFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - s.MockAdminClient.AssertCalled(t, "UpdateProject", s.Ctx, projectUpdateRequest) - s.TearDownAndVerify(t, "Project dummyProject failed to update"+ - " due to Error Updating Project\n") + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + project.State = admin.Project_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertCalled(t, "UpdateProject", mock.Anything, mock.Anything) + }, + ) +} + +func TestProjectUpdateRequiresProjectId(t *testing.T) { + testProjectUpdate( + /* setup */ func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project) { + config.ID = "" + }, + func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "project id wasn't passed") + }) } -func TestEmptyProjectInput(t *testing.T) { - s := setup() - updateProjectSetup() +func testProjectUpdate( + setup func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project), + asserter func(s *testutils.TestStruct, err error), +) { + testProjectUpdateWithMockSetup( + /* mockSetup */ func(s *testutils.TestStruct, project *admin.Project) { + s.FetcherExt. + OnGetProjectByID(s.Ctx, project.Id). + Return(project, nil) + s.MockAdminClient. + OnUpdateProjectMatch(s.Ctx, mock.Anything). + Return(&admin.ProjectUpdateResponse{}, nil) + }, + setup, + asserter, + ) +} + +func testProjectUpdateWithMockSetup( + mockSetup func(s *testutils.TestStruct, project *admin.Project), + setup func(s *testutils.TestStruct, config *project.ConfigProject, project *admin.Project), + asserter func(s *testutils.TestStruct, err error), +) { + s := testutils.Setup() + target := newTestProject() + + if mockSetup != nil { + mockSetup(&s, target) + } + + project.DefaultProjectConfig = &project.ConfigProject{ + ID: target.Id, + } config.GetConfig().Project = "" - modifyProjectFlags(false, true) - err := updateProjectsFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf(clierrors.ErrProjectNotPassed), err) + config.GetConfig().Domain = "" + if setup != nil { + setup(&s, project.DefaultProjectConfig, target) + } + + err := updateProjectsFunc(s.Ctx, nil, s.CmdCtx) + + if asserter != nil { + asserter(&s, err) + } + + // cleanup + project.DefaultProjectConfig = &project.ConfigProject{} + config.GetConfig().Project = "" + config.GetConfig().Domain = "" } -func TestInvalidInput(t *testing.T) { - s := setup() - updateProjectSetup() - config.GetConfig().Project = projectValue - project.DefaultProjectConfig.Name = projectValue - modifyProjectFlags(true, true) - err := updateProjectsFunc(s.Ctx, []string{}, s.CmdCtx) - assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf(clierrors.ErrInvalidStateUpdate), err) - s.TearDownAndVerify(t, "") +func newTestProject() *admin.Project { + return &admin.Project{ + Id: testutils.RandomName(12), + Name: testutils.RandomName(12), + State: admin.Project_ACTIVE, + Domains: []*admin.Domain{ + { + Id: testutils.RandomName(12), + Name: testutils.RandomName(12), + }, + }, + Description: testutils.RandomName(12), + Labels: &admin.Labels{ + Values: map[string]string{ + testutils.RandomName(5): testutils.RandomName(12), + testutils.RandomName(5): testutils.RandomName(12), + testutils.RandomName(5): testutils.RandomName(12), + }, + }, + } } diff --git a/cmd/update/task_meta.go b/cmd/update/task_meta.go index aba87d4b..cb9e3e92 100644 --- a/cmd/update/task_meta.go +++ b/cmd/update/task_meta.go @@ -4,10 +4,10 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/cmd/update/task_meta_test.go b/cmd/update/task_meta_test.go index c0d5b0ca..01d9f3c7 100644 --- a/cmd/update/task_meta_test.go +++ b/cmd/update/task_meta_test.go @@ -4,28 +4,193 @@ import ( "fmt" "testing" - "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/google/go-cmp/cmp" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) -func TestTaskUpdate(t *testing.T) { - s := testutils.Setup() - args := []string{"task1"} - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(&admin.NamedEntityUpdateResponse{}, nil) - assert.Nil(t, getUpdateTaskFunc(&NamedEntityConfig{})(s.Ctx, args, s.CmdCtx)) +func TestTaskMetadataCanBeActivated(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateNamedEntity", s.Ctx, + mock.MatchedBy( + func(r *admin.NamedEntityUpdateRequest) bool { + return r.GetMetadata().GetState() == admin.NamedEntityState_NAMED_ENTITY_ACTIVE + })) + }) } -func TestTaskUpdateFail(t *testing.T) { - s := testutils.Setup() - args := []string{"workflow1"} - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) - assert.NotNil(t, getUpdateTaskFunc(&NamedEntityConfig{})(s.Ctx, args, s.CmdCtx)) +func TestTaskMetadataCanBeArchived(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ACTIVE + config.Archive = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateNamedEntity", s.Ctx, + mock.MatchedBy( + func(r *admin.NamedEntityUpdateRequest) bool { + return r.GetMetadata().GetState() == admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + })) + }) +} + +func TestTaskMetadataCannotBeActivatedAndArchivedAtTheSameTime(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + config.Activate = true + config.Archive = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "Specify either activate or archive") + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestTaskMetadataUpdateDoesNothingWhenThereAreNoChanges(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestTaskMetadataUpdateWithoutForceFlagFails(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestTaskMetadataUpdateDoesNothingWithDryRunFlag(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestForceFlagIsIgnoredWithDryRunDuringTaskMetadataUpdate(t *testing.T) { + t.Run("without --force", func(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) + }) + + t.Run("with --force", func(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_TASK, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) + }) } -func TestTaskUpdateInvalidArgs(t *testing.T) { +func TestTaskMetadataUpdateFailsWhenTaskDoesNotExist(t *testing.T) { + testNamedEntityUpdateWithMockSetup( + core.ResourceType_TASK, + /* mockSetup */ func(s *testutils.TestStruct, namedEntity *admin.NamedEntity) { + s.MockAdminClient. + OnGetNamedEntityMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.NamedEntityGetRequest) bool { + return r.ResourceType == namedEntity.ResourceType && + cmp.Equal(r.Id, namedEntity.Id) + })). + Return(nil, ext.NewNotFoundError("named entity not found")) + s.MockAdminClient. + OnUpdateNamedEntityMatch(s.Ctx, mock.Anything). + Return(&admin.NamedEntityUpdateResponse{}, nil) + }, + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }, + ) +} + +func TestTaskMetadataUpdateFailsWhenAdminClientFails(t *testing.T) { + testNamedEntityUpdateWithMockSetup( + core.ResourceType_TASK, + /* mockSetup */ func(s *testutils.TestStruct, namedEntity *admin.NamedEntity) { + s.MockAdminClient. + OnGetNamedEntityMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.NamedEntityGetRequest) bool { + return r.ResourceType == namedEntity.ResourceType && + cmp.Equal(r.Id, namedEntity.Id) + })). + Return(namedEntity, nil) + s.MockAdminClient. + OnUpdateNamedEntityMatch(s.Ctx, mock.Anything). + Return(nil, fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }, + ) +} + +func TestTaskMetadataUpdateRequiresTaskName(t *testing.T) { s := testutils.Setup() - assert.NotNil(t, getUpdateTaskFunc(&NamedEntityConfig{})(s.Ctx, []string{}, s.CmdCtx)) + config := &NamedEntityConfig{} + + err := getUpdateTaskFunc(config)(s.Ctx, nil, s.CmdCtx) + + assert.ErrorContains(t, err, "task name wasn't passed") } diff --git a/cmd/update/testdata/valid_project_cluster_attribute.yaml b/cmd/update/testdata/valid_project_cluster_attribute.yaml new file mode 100644 index 00000000..27dc7e2f --- /dev/null +++ b/cmd/update/testdata/valid_project_cluster_attribute.yaml @@ -0,0 +1,4 @@ +project: flytesnacks +attributes: + "foo": "bar" + "buzz": "lightyear" \ No newline at end of file diff --git a/cmd/update/testdata/valid_project_execution_cluster_label.yaml b/cmd/update/testdata/valid_project_execution_cluster_label.yaml new file mode 100644 index 00000000..7d9e207b --- /dev/null +++ b/cmd/update/testdata/valid_project_execution_cluster_label.yaml @@ -0,0 +1,2 @@ +project: flytesnacks +value: foo \ No newline at end of file diff --git a/cmd/update/testdata/valid_project_execution_queue_attribute.yaml b/cmd/update/testdata/valid_project_execution_queue_attribute.yaml new file mode 100644 index 00000000..7ddb5f13 --- /dev/null +++ b/cmd/update/testdata/valid_project_execution_queue_attribute.yaml @@ -0,0 +1,6 @@ +project: flytesnacks +tags: + - foo + - bar + - buzz + - lightyear \ No newline at end of file diff --git a/cmd/update/testdata/valid_project_plugin_override.yaml b/cmd/update/testdata/valid_project_plugin_override.yaml new file mode 100644 index 00000000..1ad8e5cd --- /dev/null +++ b/cmd/update/testdata/valid_project_plugin_override.yaml @@ -0,0 +1,7 @@ +project: flytesnacks +overrides: + - task_type: python_task + plugin_id: + - plugin_override1 + - plugin_override2 + missing_plugin_behavior: 1 # 0 : FAIL , 1: DEFAULT diff --git a/cmd/update/testdata/valid_project_task_attribute.yaml b/cmd/update/testdata/valid_project_task_attribute.yaml new file mode 100644 index 00000000..77281d5a --- /dev/null +++ b/cmd/update/testdata/valid_project_task_attribute.yaml @@ -0,0 +1,7 @@ +project: flytesnacks +defaults: + cpu: "1" + memory: 150Mi +limits: + cpu: "2" + memory: 450Mi \ No newline at end of file diff --git a/cmd/update/testdata/valid_project_workflow_execution_config.yaml b/cmd/update/testdata/valid_project_workflow_execution_config.yaml new file mode 100644 index 00000000..414e3ecb --- /dev/null +++ b/cmd/update/testdata/valid_project_workflow_execution_config.yaml @@ -0,0 +1,2 @@ +project: flytesnacks +max_parallelism: 5 \ No newline at end of file diff --git a/cmd/update/update.go b/cmd/update/update.go index 23c69ac6..9677ee89 100644 --- a/cmd/update/update.go +++ b/cmd/update/update.go @@ -20,12 +20,11 @@ const ( updateUse = "update" updateShort = `Update Flyte resources e.g., project.` updatecmdLong = ` -Currently, this command only provides subcommands to update project. -Take input project that needs to be archived or unarchived. Name of the project to be updated is a mandatory field. -Update Flyte resources; if a project: +Provides subcommands to update Flyte resources, such as tasks, workflows, launch plans, executions, and projects. +Update Flyte resource; e.g., to activate a project: :: - flytectl update project -p flytesnacks --activateProject + flytectl update project -p flytesnacks --activate ` ) diff --git a/cmd/update/update_test.go b/cmd/update/update_test.go index d4a256e0..23ec7d34 100644 --- a/cmd/update/update_test.go +++ b/cmd/update/update_test.go @@ -5,8 +5,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flytectl/cmd/testutils" ) const ( @@ -14,8 +12,6 @@ const ( testDataInvalidAttrFile = "testdata/invalid_attribute.yaml" ) -var setup = testutils.Setup - func TestUpdateCommand(t *testing.T) { updateCommand := CreateUpdateCommand() assert.Equal(t, updateCommand.Use, updateUse) diff --git a/cmd/update/workflow_meta.go b/cmd/update/workflow_meta.go index 07857770..d2c94d7e 100644 --- a/cmd/update/workflow_meta.go +++ b/cmd/update/workflow_meta.go @@ -4,10 +4,10 @@ import ( "context" "fmt" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/cmd/update/workflow_meta_test.go b/cmd/update/workflow_meta_test.go index 6f881af7..cfdc6287 100644 --- a/cmd/update/workflow_meta_test.go +++ b/cmd/update/workflow_meta_test.go @@ -4,28 +4,193 @@ import ( "fmt" "testing" - "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/google/go-cmp/cmp" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flytectl/pkg/ext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) -func TestWorkflowUpdate(t *testing.T) { - s := testutils.Setup() - args := []string{"workflow1"} - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(&admin.NamedEntityUpdateResponse{}, nil) - assert.Nil(t, getUpdateWorkflowFunc(&NamedEntityConfig{})(s.Ctx, args, s.CmdCtx)) +func TestWorkflowMetadataCanBeActivated(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateNamedEntity", s.Ctx, + mock.MatchedBy( + func(r *admin.NamedEntityUpdateRequest) bool { + return r.GetMetadata().GetState() == admin.NamedEntityState_NAMED_ENTITY_ACTIVE + })) + }) } -func TestWorkflowUpdateFail(t *testing.T) { - s := testutils.Setup() - args := []string{"workflow1"} - s.MockAdminClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) - assert.NotNil(t, getUpdateWorkflowFunc(&NamedEntityConfig{})(s.Ctx, args, s.CmdCtx)) +func TestWorkflowMetadataCanBeArchived(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ACTIVE + config.Archive = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertCalled( + t, "UpdateNamedEntity", s.Ctx, + mock.MatchedBy( + func(r *admin.NamedEntityUpdateRequest) bool { + return r.GetMetadata().GetState() == admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + })) + }) +} + +func TestWorkflowMetadataCannotBeActivatedAndArchivedAtTheSameTime(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + config.Activate = true + config.Archive = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "Specify either activate or archive") + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestWorkflowMetadataUpdateDoesNothingWhenThereAreNoChanges(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ACTIVE + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestWorkflowMetadataUpdateWithoutForceFlagFails(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = false + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.ErrorContains(t, err, "update aborted by user") + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestWorkflowMetadataUpdateDoesNothingWithDryRunFlag(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) +} + +func TestForceFlagIsIgnoredWithDryRunDuringWorkflowMetadataUpdate(t *testing.T) { + t.Run("without --force", func(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + + config.Force = false + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) + }) + + t.Run("with --force", func(t *testing.T) { + testNamedEntityUpdate(core.ResourceType_WORKFLOW, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + + config.Force = true + config.DryRun = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Nil(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }) + }) } -func TestWorkflowUpdateInvalidArgs(t *testing.T) { +func TestWorkflowMetadataUpdateFailsWhenWorkflowDoesNotExist(t *testing.T) { + testNamedEntityUpdateWithMockSetup( + core.ResourceType_WORKFLOW, + /* mockSetup */ func(s *testutils.TestStruct, namedEntity *admin.NamedEntity) { + s.MockAdminClient. + OnGetNamedEntityMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.NamedEntityGetRequest) bool { + return r.ResourceType == namedEntity.ResourceType && + cmp.Equal(r.Id, namedEntity.Id) + })). + Return(nil, ext.NewNotFoundError("named entity not found")) + s.MockAdminClient. + OnUpdateNamedEntityMatch(s.Ctx, mock.Anything). + Return(&admin.NamedEntityUpdateResponse{}, nil) + }, + /* setup */ nil, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertNotCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }, + ) +} + +func TestWorkflowMetadataUpdateFailsWhenAdminClientFails(t *testing.T) { + testNamedEntityUpdateWithMockSetup( + core.ResourceType_WORKFLOW, + /* mockSetup */ func(s *testutils.TestStruct, namedEntity *admin.NamedEntity) { + s.MockAdminClient. + OnGetNamedEntityMatch( + s.Ctx, + mock.MatchedBy(func(r *admin.NamedEntityGetRequest) bool { + return r.ResourceType == namedEntity.ResourceType && + cmp.Equal(r.Id, namedEntity.Id) + })). + Return(namedEntity, nil) + s.MockAdminClient. + OnUpdateNamedEntityMatch(s.Ctx, mock.Anything). + Return(nil, fmt.Errorf("network error")) + }, + /* setup */ func(s *testutils.TestStruct, config *NamedEntityConfig, namedEntity *admin.NamedEntity) { + namedEntity.Metadata.State = admin.NamedEntityState_NAMED_ENTITY_ARCHIVED + config.Activate = true + config.Force = true + }, + /* assert */ func(s *testutils.TestStruct, err error) { + assert.Error(t, err) + s.MockAdminClient.AssertCalled(t, "UpdateNamedEntity", mock.Anything, mock.Anything) + }, + ) +} + +func TestWorkflowMetadataUpdateRequiresWorkflowName(t *testing.T) { s := testutils.Setup() - assert.NotNil(t, getUpdateWorkflowFunc(&NamedEntityConfig{})(s.Ctx, []string{}, s.CmdCtx)) + config := &NamedEntityConfig{} + + err := getUpdateWorkflowFunc(config)(s.Ctx, nil, s.CmdCtx) + + assert.ErrorContains(t, err, "workflow name wasn't passed") } diff --git a/cmd/version/version.go b/cmd/version/version.go index 03a2a753..dadbde64 100644 --- a/cmd/version/version.go +++ b/cmd/version/version.go @@ -10,10 +10,10 @@ import ( "github.com/flyteorg/flytectl/pkg/platformutil" - cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flytestdlib/logger" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" + cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/spf13/cobra" ) diff --git a/cmd/version/version_test.go b/cmd/version/version_test.go index 649f4302..f694089b 100644 --- a/cmd/version/version_test.go +++ b/cmd/version/version_test.go @@ -14,10 +14,10 @@ import ( "github.com/spf13/cobra" - cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" + cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/stretchr/testify/assert" ) diff --git a/docs/source/gen/flytectl_config.rst b/docs/source/gen/flytectl_config.rst index 98b30282..60e755e6 100644 --- a/docs/source/gen/flytectl_config.rst +++ b/docs/source/gen/flytectl_config.rst @@ -93,7 +93,7 @@ SEE ALSO * :doc:`flytectl` - Flytectl CLI tool * :doc:`flytectl_config_discover` - Searches for a config in one of the default search paths. -* :doc:`flytectl_config_docs` - Generate configuration documetation in rst format +* :doc:`flytectl_config_docs` - Generate configuration documentation in rst format * :doc:`flytectl_config_init` - Generates a Flytectl config file in the user's home directory. * :doc:`flytectl_config_validate` - Validates the loaded config. diff --git a/go.mod b/go.mod index 55bd54c6..0344faec 100644 --- a/go.mod +++ b/go.mod @@ -14,9 +14,11 @@ require ( github.com/flyteorg/flyte/flytestdlib v1.9.12 github.com/go-ozzo/ozzo-validation/v4 v4.3.0 github.com/golang/protobuf v1.5.3 + github.com/google/go-cmp v0.5.9 github.com/google/go-github/v42 v42.0.0 github.com/google/uuid v1.3.0 github.com/hashicorp/go-version v1.3.0 + github.com/hexops/gotextdiff v1.0.3 github.com/kataras/tablewriter v0.0.0-20180708051242-e063d29b7c23 github.com/landoop/tableprinter v0.0.0-20180806200924-8bd8c2576d27 github.com/mitchellh/mapstructure v1.5.0 @@ -90,7 +92,6 @@ require ( github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect diff --git a/go.sum b/go.sum index 4d8b4729..41bdd143 100644 --- a/go.sum +++ b/go.sum @@ -547,6 +547,8 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= diff --git a/main.go b/main.go index 45a03688..b410bcd0 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,8 @@ import ( "context" "os" - "github.com/flyteorg/flytectl/cmd" "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flytectl/cmd" ) func main() { diff --git a/pkg/ext/attribute_match_fetcher.go b/pkg/ext/attribute_match_fetcher.go index d9e5c402..eca2ce8e 100644 --- a/pkg/ext/attribute_match_fetcher.go +++ b/pkg/ext/attribute_match_fetcher.go @@ -2,57 +2,65 @@ package ext import ( "context" - "fmt" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" ) func (a *AdminFetcherExtClient) FetchWorkflowAttributes(ctx context.Context, project, domain, name string, rsType admin.MatchableResource) (*admin.WorkflowAttributesGetResponse, error) { - workflowAttr, err := a.AdminServiceClient().GetWorkflowAttributes(ctx, &admin.WorkflowAttributesGetRequest{ + response, err := a.AdminServiceClient().GetWorkflowAttributes(ctx, &admin.WorkflowAttributesGetRequest{ Project: project, Domain: domain, Workflow: name, ResourceType: rsType, }) - if err != nil { + if err != nil && status.Code(err) != codes.NotFound { return nil, err } - if workflowAttr.GetAttributes() == nil || workflowAttr.GetAttributes().GetMatchingAttributes() == nil { - return nil, fmt.Errorf("attribute doesn't exist") + if status.Code(err) == codes.NotFound || + response.GetAttributes() == nil || + response.GetAttributes().GetMatchingAttributes() == nil { + return nil, NewNotFoundError("attribute") } - return workflowAttr, nil + return response, nil } func (a *AdminFetcherExtClient) FetchProjectDomainAttributes(ctx context.Context, project, domain string, rsType admin.MatchableResource) (*admin.ProjectDomainAttributesGetResponse, error) { - projectDomainAttr, err := a.AdminServiceClient().GetProjectDomainAttributes(ctx, + response, err := a.AdminServiceClient().GetProjectDomainAttributes(ctx, &admin.ProjectDomainAttributesGetRequest{ Project: project, Domain: domain, ResourceType: rsType, }) - if err != nil { + if err != nil && status.Code(err) != codes.NotFound { return nil, err } - if projectDomainAttr.GetAttributes() == nil || projectDomainAttr.GetAttributes().GetMatchingAttributes() == nil { - return nil, fmt.Errorf("attribute doesn't exist") + if status.Code(err) == codes.NotFound || + response.GetAttributes() == nil || + response.GetAttributes().GetMatchingAttributes() == nil { + return nil, NewNotFoundError("attribute") } - return projectDomainAttr, nil + return response, nil } func (a *AdminFetcherExtClient) FetchProjectAttributes(ctx context.Context, project string, rsType admin.MatchableResource) (*admin.ProjectAttributesGetResponse, error) { - projectDomainAttr, err := a.AdminServiceClient().GetProjectAttributes(ctx, + response, err := a.AdminServiceClient().GetProjectAttributes(ctx, &admin.ProjectAttributesGetRequest{ Project: project, ResourceType: rsType, }) - if err != nil { + if err != nil && status.Code(err) != codes.NotFound { return nil, err } - if projectDomainAttr.GetAttributes() == nil || projectDomainAttr.GetAttributes().GetMatchingAttributes() == nil { - return nil, fmt.Errorf("attribute doesn't exist") + if status.Code(err) == codes.NotFound || + response.GetAttributes() == nil || + response.GetAttributes().GetMatchingAttributes() == nil { + return nil, NewNotFoundError("attribute") } - return projectDomainAttr, nil + return response, nil } diff --git a/pkg/ext/attribute_match_fetcher_test.go b/pkg/ext/attribute_match_fetcher_test.go index 52f081f9..b9ecff16 100644 --- a/pkg/ext/attribute_match_fetcher_test.go +++ b/pkg/ext/attribute_match_fetcher_test.go @@ -52,7 +52,8 @@ func TestFetchWorkflowAttributesError(t *testing.T) { adminClient.OnGetWorkflowAttributesMatch(mock.Anything, mock.Anything).Return(wResp, nil) _, err := adminFetcherExt.FetchWorkflowAttributes(ctx, "dummyProject", "domainValue", "workflowName", admin.MatchableResource_TASK_RESOURCE) assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attribute doesn't exist"), err) + assert.True(t, IsNotFoundError(err)) + assert.EqualError(t, err, "attribute not found") }) } @@ -76,7 +77,8 @@ func TestFetchProjectDomainAttributesError(t *testing.T) { adminClient.OnGetProjectDomainAttributesMatch(mock.Anything, mock.Anything).Return(pResp, nil) _, err := adminFetcherExt.FetchProjectDomainAttributes(ctx, "dummyProject", "domainValue", admin.MatchableResource_TASK_RESOURCE) assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attribute doesn't exist"), err) + assert.True(t, IsNotFoundError(err)) + assert.EqualError(t, err, "attribute not found") }) } @@ -93,6 +95,7 @@ func TestFetchProjectAttributesError(t *testing.T) { adminClient.OnGetProjectAttributesMatch(mock.Anything, mock.Anything).Return(pResp, nil) _, err := adminFetcherExt.FetchProjectAttributes(ctx, "dummyProject", admin.MatchableResource_TASK_RESOURCE) assert.NotNil(t, err) - assert.Equal(t, fmt.Errorf("attribute doesn't exist"), err) + assert.True(t, IsNotFoundError(err)) + assert.EqualError(t, err, "attribute not found") }) } diff --git a/pkg/ext/errors.go b/pkg/ext/errors.go new file mode 100644 index 00000000..4f51601a --- /dev/null +++ b/pkg/ext/errors.go @@ -0,0 +1,24 @@ +package ext + +import ( + "errors" + "fmt" +) + +type NotFoundError struct { + Target string +} + +func (err *NotFoundError) Error() string { + return fmt.Sprintf("%s not found", err.Target) +} + +func NewNotFoundError(targetFormat string, formatArgs ...any) *NotFoundError { + target := fmt.Sprintf(targetFormat, formatArgs...) + return &NotFoundError{target} +} + +func IsNotFoundError(err error) bool { + var notFoundErr *NotFoundError + return errors.As(err, ¬FoundErr) +} diff --git a/pkg/ext/execution_fetcher.go b/pkg/ext/execution_fetcher.go index 5bd70720..41ebea9b 100644 --- a/pkg/ext/execution_fetcher.go +++ b/pkg/ext/execution_fetcher.go @@ -3,9 +3,9 @@ package ext import ( "context" - "github.com/flyteorg/flytectl/pkg/filters" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/pkg/filters" ) func (a *AdminFetcherExtClient) FetchExecution(ctx context.Context, name, project, domain string) (*admin.Execution, error) { diff --git a/pkg/ext/fetcher.go b/pkg/ext/fetcher.go index 7d388348..2df2f279 100644 --- a/pkg/ext/fetcher.go +++ b/pkg/ext/fetcher.go @@ -72,6 +72,9 @@ type AdminFetcherExtInterface interface { // ListProjects fetches all projects ListProjects(ctx context.Context, filter filters.Filters) (*admin.Projects, error) + + // GetProjectByID fetches a single project by its identifier. If project does not exist, an error will be returned + GetProjectByID(ctx context.Context, projectID string) (*admin.Project, error) } // AdminFetcherExtClient is used for interacting with extended features used for fetching data from admin service diff --git a/pkg/ext/mocks/admin_fetcher_ext_interface.go b/pkg/ext/mocks/admin_fetcher_ext_interface.go index 033fe3ca..b2e9814f 100644 --- a/pkg/ext/mocks/admin_fetcher_ext_interface.go +++ b/pkg/ext/mocks/admin_fetcher_ext_interface.go @@ -750,6 +750,47 @@ func (_m *AdminFetcherExtInterface) FetchWorkflowVersion(ctx context.Context, na return r0, r1 } +type AdminFetcherExtInterface_GetProjectByID struct { + *mock.Call +} + +func (_m AdminFetcherExtInterface_GetProjectByID) Return(_a0 *admin.Project, _a1 error) *AdminFetcherExtInterface_GetProjectByID { + return &AdminFetcherExtInterface_GetProjectByID{Call: _m.Call.Return(_a0, _a1)} +} + +func (_m *AdminFetcherExtInterface) OnGetProjectByID(ctx context.Context, projectID string) *AdminFetcherExtInterface_GetProjectByID { + c_call := _m.On("GetProjectByID", ctx, projectID) + return &AdminFetcherExtInterface_GetProjectByID{Call: c_call} +} + +func (_m *AdminFetcherExtInterface) OnGetProjectByIDMatch(matchers ...interface{}) *AdminFetcherExtInterface_GetProjectByID { + c_call := _m.On("GetProjectByID", matchers...) + return &AdminFetcherExtInterface_GetProjectByID{Call: c_call} +} + +// GetProjectByID provides a mock function with given fields: ctx, projectID +func (_m *AdminFetcherExtInterface) GetProjectByID(ctx context.Context, projectID string) (*admin.Project, error) { + ret := _m.Called(ctx, projectID) + + var r0 *admin.Project + if rf, ok := ret.Get(0).(func(context.Context, string) *admin.Project); ok { + r0 = rf(ctx, projectID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.Project) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, projectID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + type AdminFetcherExtInterface_ListExecution struct { *mock.Call } diff --git a/pkg/ext/project_fetcher.go b/pkg/ext/project_fetcher.go index fbeb71d1..2bac8829 100644 --- a/pkg/ext/project_fetcher.go +++ b/pkg/ext/project_fetcher.go @@ -2,6 +2,7 @@ package ext import ( "context" + "fmt" "github.com/flyteorg/flytectl/pkg/filters" @@ -19,3 +20,27 @@ func (a *AdminFetcherExtClient) ListProjects(ctx context.Context, filter filters } return e, nil } + +func (a *AdminFetcherExtClient) GetProjectByID(ctx context.Context, projectID string) (*admin.Project, error) { + if projectID == "" { + return nil, fmt.Errorf("GetProjectByID: projectId is empty") + } + + response, err := a.AdminServiceClient().ListProjects(ctx, &admin.ProjectListRequest{ + Limit: 1, + Filters: fmt.Sprintf("eq(identifier,%s)", filters.EscapeValue(projectID)), + }) + if err != nil { + return nil, err + } + + if len(response.Projects) == 0 { + return nil, NewNotFoundError("project %s", projectID) + } + + if len(response.Projects) > 1 { + panic(fmt.Sprintf("unexpected number of projects in ListProjects response: %d - 0 or 1 expected", len(response.Projects))) + } + + return response.Projects[0], nil +} diff --git a/pkg/filters/filters.go b/pkg/filters/filters.go index 629b6a25..836dc50e 100644 --- a/pkg/filters/filters.go +++ b/pkg/filters/filters.go @@ -65,6 +65,16 @@ func (i InvalidEscapeSequence) Error() string { return fmt.Sprintf("invalid field selector: invalid escape sequence: %s", i.sequence) } +// EscapeValue escapes strings to be used as values in filter queries. +func EscapeValue(s string) string { + replacer := strings.NewReplacer( + `\`, `\\`, + `,`, `\,`, + `=`, `\=`, + ) + return replacer.Replace(s) +} + // UnescapeValue unescapes a fieldSelector value and returns the original literal value. // May return the original string if it contains no escaped or special characters. func UnescapeValue(s string) (string, error) { diff --git a/pkg/filters/filters_test.go b/pkg/filters/filters_test.go index cd988f0c..43cfb52d 100644 --- a/pkg/filters/filters_test.go +++ b/pkg/filters/filters_test.go @@ -71,3 +71,14 @@ func TestParseFailed(t *testing.T) { assert.Equal(t, "", op) } } + +func TestEscapeValue(t *testing.T) { + assert.Equal(t, "", EscapeValue("")) + assert.Equal(t, "abc", EscapeValue("abc")) + assert.Equal(t, `\\`, EscapeValue(`\`)) + assert.Equal(t, `\\\\`, EscapeValue(`\\`)) + assert.Equal(t, `\,`, EscapeValue(`,`)) + assert.Equal(t, `\,\,`, EscapeValue(`,,`)) + assert.Equal(t, `\=`, EscapeValue(`=`)) + assert.Equal(t, `\=\=`, EscapeValue(`==`)) +} diff --git a/pkg/filters/util_test.go b/pkg/filters/util_test.go index c20f315f..b1289455 100644 --- a/pkg/filters/util_test.go +++ b/pkg/filters/util_test.go @@ -3,8 +3,8 @@ package filters import ( "testing" - "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + "github.com/flyteorg/flytectl/cmd/config" "github.com/stretchr/testify/assert" ) diff --git a/pkg/github/githubutil.go b/pkg/github/githubutil.go index 8e5403db..2d72b67a 100644 --- a/pkg/github/githubutil.go +++ b/pkg/github/githubutil.go @@ -9,10 +9,10 @@ import ( "runtime" "strings" - "github.com/flyteorg/flytectl/pkg/platformutil" - "github.com/flyteorg/flytectl/pkg/util" "github.com/flyteorg/flyte/flytestdlib/logger" stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" + "github.com/flyteorg/flytectl/pkg/platformutil" + "github.com/flyteorg/flytectl/pkg/util" "github.com/google/go-github/v42/github" "github.com/mouuff/go-rocket-update/pkg/provider" diff --git a/pkg/github/githubutil_test.go b/pkg/github/githubutil_test.go index 92c015a6..41247ac9 100644 --- a/pkg/github/githubutil_test.go +++ b/pkg/github/githubutil_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" + stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/flyteorg/flytectl/pkg/github/mocks" "github.com/flyteorg/flytectl/pkg/platformutil" - stdlibversion "github.com/flyteorg/flyte/flytestdlib/version" "github.com/google/go-github/v42/github" "github.com/stretchr/testify/assert" diff --git a/pkg/k8s/k8s_test.go b/pkg/k8s/k8s_test.go index 0cf3db31..84dc1692 100644 --- a/pkg/k8s/k8s_test.go +++ b/pkg/k8s/k8s_test.go @@ -33,7 +33,7 @@ users: - name: foo-user user: exec: - apiVersion: client.authentication.k8s.io/v1alpha1 + apiVersion: client.authentication.k8s.io/v1beta1 args: - arg-1 - arg-2 diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0ac9f563..e3b406b9 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -9,10 +9,10 @@ import ( "sort" "strings" - "github.com/flyteorg/flytectl/pkg/visualize" "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/flytectl/pkg/visualize" "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" diff --git a/pkg/sandbox/start.go b/pkg/sandbox/start.go index 37f19d61..be79fd3a 100644 --- a/pkg/sandbox/start.go +++ b/pkg/sandbox/start.go @@ -13,6 +13,7 @@ import ( "github.com/docker/docker/api/types/mount" "github.com/docker/go-connections/nat" "github.com/enescakir/emoji" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flytectl/clierrors" sandboxCmdConfig "github.com/flyteorg/flytectl/cmd/config/subcommand/sandbox" "github.com/flyteorg/flytectl/pkg/configutil" @@ -20,7 +21,6 @@ import ( "github.com/flyteorg/flytectl/pkg/github" "github.com/flyteorg/flytectl/pkg/k8s" "github.com/flyteorg/flytectl/pkg/util" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/kataras/tablewriter" corev1api "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/visualize/graphviz_test.go b/pkg/visualize/graphviz_test.go index 5a14c03c..710ce01f 100644 --- a/pkg/visualize/graphviz_test.go +++ b/pkg/visualize/graphviz_test.go @@ -6,8 +6,8 @@ import ( "io/ioutil" "testing" - "github.com/flyteorg/flytectl/pkg/visualize/mocks" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytectl/pkg/visualize/mocks" graphviz "github.com/awalterschulze/gographviz" "github.com/golang/protobuf/jsonpb" From b910dd7e49949782ab9febe2595b3c6dcc340195 Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Mon, 16 Oct 2023 11:31:12 -0700 Subject: [PATCH 4/4] merge conflicts Signed-off-by: Katrina Rogan --- cmd/testutils/test_utils.go | 2 -- cmd/update/matchable_attribute_util.go | 1 - cmd/update/matchable_cluster_resource_attribute.go | 1 - cmd/update/matchable_execution_cluster_label.go | 1 - cmd/update/matchable_execution_queue_attribute.go | 1 - cmd/update/matchable_plugin_override.go | 1 - cmd/update/matchable_task_resource_attribute.go | 1 - cmd/update/matchable_workflow_execution_config.go | 1 - 8 files changed, 9 deletions(-) diff --git a/cmd/testutils/test_utils.go b/cmd/testutils/test_utils.go index 1fcc7fd2..28b78566 100644 --- a/cmd/testutils/test_utils.go +++ b/cmd/testutils/test_utils.go @@ -19,8 +19,6 @@ import ( "github.com/flyteorg/flytectl/cmd/config" cmdCore "github.com/flyteorg/flytectl/cmd/core" extMocks "github.com/flyteorg/flytectl/pkg/ext/mocks" - "github.com/flyteorg/flyteidl/clients/go/admin" - "github.com/flyteorg/flyteidl/clients/go/admin/mocks" ) const projectValue = "dummyProject" diff --git a/cmd/update/matchable_attribute_util.go b/cmd/update/matchable_attribute_util.go index db62d822..ddb2c110 100644 --- a/cmd/update/matchable_attribute_util.go +++ b/cmd/update/matchable_attribute_util.go @@ -10,7 +10,6 @@ import ( cmdCore "github.com/flyteorg/flytectl/cmd/core" cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" "github.com/flyteorg/flytectl/pkg/ext" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" ) func DecorateAndUpdateMatchableAttr( diff --git a/cmd/update/matchable_cluster_resource_attribute.go b/cmd/update/matchable_cluster_resource_attribute.go index bb7508b4..51f5b649 100644 --- a/cmd/update/matchable_cluster_resource_attribute.go +++ b/cmd/update/matchable_cluster_resource_attribute.go @@ -8,7 +8,6 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/update/matchable_execution_cluster_label.go b/cmd/update/matchable_execution_cluster_label.go index ea2e920c..08b0d742 100644 --- a/cmd/update/matchable_execution_cluster_label.go +++ b/cmd/update/matchable_execution_cluster_label.go @@ -8,7 +8,6 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/update/matchable_execution_queue_attribute.go b/cmd/update/matchable_execution_queue_attribute.go index 2cef018c..8af5bd77 100644 --- a/cmd/update/matchable_execution_queue_attribute.go +++ b/cmd/update/matchable_execution_queue_attribute.go @@ -8,7 +8,6 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/update/matchable_plugin_override.go b/cmd/update/matchable_plugin_override.go index 341b791a..c9f6ebe9 100644 --- a/cmd/update/matchable_plugin_override.go +++ b/cmd/update/matchable_plugin_override.go @@ -8,7 +8,6 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/update/matchable_task_resource_attribute.go b/cmd/update/matchable_task_resource_attribute.go index c0cefc97..3e4282de 100644 --- a/cmd/update/matchable_task_resource_attribute.go +++ b/cmd/update/matchable_task_resource_attribute.go @@ -8,7 +8,6 @@ import ( sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" cmdCore "github.com/flyteorg/flytectl/cmd/core" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" ) const ( diff --git a/cmd/update/matchable_workflow_execution_config.go b/cmd/update/matchable_workflow_execution_config.go index e7557a0f..2921dbcf 100644 --- a/cmd/update/matchable_workflow_execution_config.go +++ b/cmd/update/matchable_workflow_execution_config.go @@ -6,7 +6,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" - "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" sconfig "github.com/flyteorg/flytectl/cmd/config/subcommand" cmdCore "github.com/flyteorg/flytectl/cmd/core"