From 25b2f05ad01ff059f1d6dfc25bdf07fc87163f54 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Fri, 3 Jul 2026 13:29:38 +0200 Subject: [PATCH 1/4] Only use protoyaml. --- cmd/admin/v2/tenant.go | 48 ++++++++++++++++++- cmd/printers.go | 8 +--- cmd/root.go | 3 +- docs/metalctlv2.md | 2 +- docs/metalctlv2_api-methods.md | 2 +- docs/metalctlv2_audit.md | 2 +- docs/metalctlv2_audit_describe.md | 2 +- docs/metalctlv2_audit_list.md | 2 +- docs/metalctlv2_completion.md | 2 +- docs/metalctlv2_completion_bash.md | 2 +- docs/metalctlv2_completion_fish.md | 2 +- docs/metalctlv2_completion_powershell.md | 2 +- docs/metalctlv2_completion_zsh.md | 2 +- docs/metalctlv2_context.md | 2 +- docs/metalctlv2_context_add.md | 2 +- docs/metalctlv2_context_list.md | 2 +- docs/metalctlv2_context_remove.md | 2 +- docs/metalctlv2_context_set-project.md | 2 +- docs/metalctlv2_context_show-current.md | 2 +- docs/metalctlv2_context_switch.md | 2 +- docs/metalctlv2_context_update.md | 2 +- docs/metalctlv2_health.md | 2 +- docs/metalctlv2_image.md | 2 +- docs/metalctlv2_image_describe.md | 2 +- docs/metalctlv2_image_latest.md | 2 +- docs/metalctlv2_image_list.md | 2 +- docs/metalctlv2_ip.md | 2 +- docs/metalctlv2_ip_apply.md | 2 +- docs/metalctlv2_ip_create.md | 2 +- docs/metalctlv2_ip_delete.md | 2 +- docs/metalctlv2_ip_describe.md | 2 +- docs/metalctlv2_ip_edit.md | 2 +- docs/metalctlv2_ip_list.md | 2 +- docs/metalctlv2_ip_update.md | 2 +- docs/metalctlv2_login.md | 2 +- docs/metalctlv2_logout.md | 2 +- docs/metalctlv2_markdown.md | 2 +- docs/metalctlv2_project.md | 2 +- docs/metalctlv2_project_apply.md | 2 +- docs/metalctlv2_project_create.md | 2 +- docs/metalctlv2_project_delete.md | 2 +- docs/metalctlv2_project_describe.md | 2 +- docs/metalctlv2_project_edit.md | 2 +- docs/metalctlv2_project_invite.md | 2 +- docs/metalctlv2_project_invite_delete.md | 2 +- ...lv2_project_invite_generate-join-secret.md | 2 +- docs/metalctlv2_project_invite_list.md | 2 +- docs/metalctlv2_project_join.md | 2 +- docs/metalctlv2_project_list.md | 2 +- docs/metalctlv2_project_member.md | 2 +- docs/metalctlv2_project_member_delete.md | 2 +- docs/metalctlv2_project_member_list.md | 2 +- docs/metalctlv2_project_member_update.md | 2 +- docs/metalctlv2_project_update.md | 2 +- docs/metalctlv2_size.md | 2 +- docs/metalctlv2_size_describe.md | 2 +- docs/metalctlv2_size_list.md | 2 +- docs/metalctlv2_tenant.md | 2 +- docs/metalctlv2_tenant_apply.md | 2 +- docs/metalctlv2_tenant_create.md | 2 +- docs/metalctlv2_tenant_delete.md | 2 +- docs/metalctlv2_tenant_describe.md | 2 +- docs/metalctlv2_tenant_edit.md | 2 +- docs/metalctlv2_tenant_invite.md | 2 +- docs/metalctlv2_tenant_invite_delete.md | 2 +- ...tlv2_tenant_invite_generate-join-secret.md | 2 +- docs/metalctlv2_tenant_invite_list.md | 2 +- docs/metalctlv2_tenant_join.md | 2 +- docs/metalctlv2_tenant_list.md | 2 +- docs/metalctlv2_tenant_member.md | 2 +- docs/metalctlv2_tenant_member_list.md | 2 +- docs/metalctlv2_tenant_member_remove.md | 2 +- docs/metalctlv2_tenant_member_update.md | 2 +- docs/metalctlv2_tenant_update.md | 2 +- docs/metalctlv2_token.md | 2 +- docs/metalctlv2_token_apply.md | 2 +- docs/metalctlv2_token_create.md | 2 +- docs/metalctlv2_token_delete.md | 2 +- docs/metalctlv2_token_describe.md | 2 +- docs/metalctlv2_token_edit.md | 2 +- docs/metalctlv2_token_list.md | 2 +- docs/metalctlv2_token_update.md | 2 +- docs/metalctlv2_user.md | 2 +- docs/metalctlv2_user_describe.md | 2 +- docs/metalctlv2_version.md | 2 +- tests/e2e/admin/audit_test.go | 13 +++-- tests/e2e/admin/component_test.go | 3 +- tests/e2e/admin/image_test.go | 9 ++-- tests/e2e/admin/size_test.go | 5 -- tests/e2e/admin/switch_test.go | 15 +++--- tests/e2e/admin/task_test.go | 2 - tests/e2e/admin/tenant_test.go | 1 - tests/e2e/admin/token_test.go | 10 ++-- tests/e2e/api/audit_test.go | 17 ++++--- tests/e2e/api/health_test.go | 1 - tests/e2e/api/image_test.go | 2 - tests/e2e/api/ip_test.go | 7 ++- tests/e2e/api/project_test.go | 32 ++++++------- tests/e2e/api/size_test.go | 6 +-- tests/e2e/api/tenant_test.go | 38 +++++++-------- tests/e2e/api/token_test.go | 35 +++++++------- tests/e2e/api/user_test.go | 5 +- 102 files changed, 220 insertions(+), 204 deletions(-) diff --git a/cmd/admin/v2/tenant.go b/cmd/admin/v2/tenant.go index 42c5c90..1f630b5 100644 --- a/cmd/admin/v2/tenant.go +++ b/cmd/admin/v2/tenant.go @@ -55,7 +55,7 @@ func newTenantCmd(c *config.Config) *cobra.Command { ValidArgsFn: w.c.Completion.AdminTenantListCompletion, } - return genericcli.NewCmds(cmdsConfig) + return genericcli.NewCmds(cmdsConfig, newAddMemberCmd(c)) } func (c *tenant) Get(id string) (*apiv2.Tenant, error) { @@ -104,3 +104,49 @@ func (c *tenant) Convert(r *apiv2.Tenant) (string, *adminv2.TenantServiceCreateR func (c *tenant) Update(rq any) (*apiv2.Tenant, error) { panic("unimplemented") } + +func newAddMemberCmd(c *config.Config) *cobra.Command { + cmd := &cobra.Command{ + Use: "add-member", + Short: "Add a new member to a tenant", + Long: `Add a new member to an existing tenant by specifying the tenant ID, member's ID, and role.`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, cancel := c.NewRequestContext() + defer cancel() + + var ( + tenantId = viper.GetString("tenant-id") + memberId = viper.GetString("member-id") + memberRole = viper.GetString("role") + ) + + if tenantId == "" || memberId == "" || memberRole == "" { + return fmt.Errorf("tenant ID, member ID, and role must all be specified") + } + + _, err := c.Client.Adminv2().Tenant().AddMember(ctx, &adminv2.TenantServiceAddMemberRequest{ + Role: apiv2.TenantRole(apiv2.TenantRole_value[memberRole]), + Tenant: tenantId, + Member: memberId, + }) + if err != nil { + return fmt.Errorf("failed to add member to tenant: %w", err) + } + + return nil + }, + } + + cmd.Flags().String("tenant-id", "", "ID of the tenant where the member is added") + cmd.Flags().String("member-id", "", "ID of the member to be added") + cmd.Flags().String("role", "", "Role of the member within the tenant") + genericcli.Must(cmd.MarkFlagRequired("tenant-id")) + genericcli.Must(cmd.MarkFlagRequired("member-id")) + genericcli.Must(cmd.MarkFlagRequired("role")) + + genericcli.Must(cmd.RegisterFlagCompletionFunc("tenant-id", c.Completion.AdminTenantListCompletion)) + genericcli.Must(cmd.RegisterFlagCompletionFunc("member-id", c.Completion.AdminTenantListCompletion)) + genericcli.Must(cmd.RegisterFlagCompletionFunc("role", c.Completion.TenantRoleCompletion)) + + return cmd +} diff --git a/cmd/printers.go b/cmd/printers.go index 2e27033..1a8365b 100644 --- a/cmd/printers.go +++ b/cmd/printers.go @@ -15,13 +15,9 @@ func newPrinterFromCLI(out io.Writer) (printers.Printer, error) { switch format := viper.GetString("output-format"); format { case "yaml": - printer = printers.NewProtoYAMLPrinter().WithFallback(true).WithOut(out) + printer = printers.NewProtoYAMLPrinter().WithFallback(false).WithOut(out) case "json": - printer = printers.NewProtoJSONPrinter().WithFallback(true).WithOut(out) - case "yamlraw": - printer = printers.NewYAMLPrinter().WithOut(out) - case "jsonraw": - printer = printers.NewJSONPrinter().WithOut(out) + printer = printers.NewProtoJSONPrinter().WithFallback(false).WithOut(out) case "table", "wide", "markdown": tp := tableprinters.New() cfg := &printers.TablePrinterConfig{ diff --git a/cmd/root.go b/cmd/root.go index 7e4cfd5..4df92e9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -57,7 +57,7 @@ func NewRootCmd(c *config.Config) *cobra.Command { }, } rootCmd.PersistentFlags().StringP("config", "c", "", "alternative config file path, (default is ~/.metal-stack/config.yaml)") - rootCmd.PersistentFlags().StringP("output-format", "o", "table", "output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used).") + rootCmd.PersistentFlags().StringP("output-format", "o", "table", "output format (table|wide|markdown|json|yaml|template), wide is a table with more columns.") genericcli.Must(rootCmd.RegisterFlagCompletionFunc("output-format", cobra.FixedCompletions([]string{"table", "wide", "markdown", "json", "yaml", "template"}, cobra.ShellCompDirectiveNoFileComp))) @@ -127,6 +127,7 @@ func newApiClient(apiURL, token string) (client.Client, error) { if viper.GetBool("debug") { logLevel = slog.LevelDebug } + dialConfig := &client.DialConfig{ BaseURL: apiURL, Token: token, diff --git a/docs/metalctlv2.md b/docs/metalctlv2.md index df68a11..48ccfa5 100644 --- a/docs/metalctlv2.md +++ b/docs/metalctlv2.md @@ -11,7 +11,7 @@ cli for managing entities in metal-stack --debug debug output --force-color force colored output even without tty -h, --help help for metalctlv2 - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_api-methods.md b/docs/metalctlv2_api-methods.md index 960ef02..fdc3dcc 100644 --- a/docs/metalctlv2_api-methods.md +++ b/docs/metalctlv2_api-methods.md @@ -21,7 +21,7 @@ metalctlv2 api-methods [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_audit.md b/docs/metalctlv2_audit.md index ed95dd1..2a75017 100644 --- a/docs/metalctlv2_audit.md +++ b/docs/metalctlv2_audit.md @@ -20,7 +20,7 @@ read api audit traces of a tenant -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_audit_describe.md b/docs/metalctlv2_audit_describe.md index cc382a5..e47105e 100644 --- a/docs/metalctlv2_audit_describe.md +++ b/docs/metalctlv2_audit_describe.md @@ -23,7 +23,7 @@ metalctlv2 audit describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_audit_list.md b/docs/metalctlv2_audit_list.md index 79189f7..e4005f8 100644 --- a/docs/metalctlv2_audit_list.md +++ b/docs/metalctlv2_audit_list.md @@ -34,7 +34,7 @@ metalctlv2 audit list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion.md b/docs/metalctlv2_completion.md index 773da84..a9d2654 100644 --- a/docs/metalctlv2_completion.md +++ b/docs/metalctlv2_completion.md @@ -22,7 +22,7 @@ See each sub-command's help for details on how to use the generated script. -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_bash.md b/docs/metalctlv2_completion_bash.md index 38a1ede..13a60d6 100644 --- a/docs/metalctlv2_completion_bash.md +++ b/docs/metalctlv2_completion_bash.md @@ -45,7 +45,7 @@ metalctlv2 completion bash -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_fish.md b/docs/metalctlv2_completion_fish.md index 69657e7..6d1d54b 100644 --- a/docs/metalctlv2_completion_fish.md +++ b/docs/metalctlv2_completion_fish.md @@ -36,7 +36,7 @@ metalctlv2 completion fish [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_powershell.md b/docs/metalctlv2_completion_powershell.md index 6b9c650..86485a7 100644 --- a/docs/metalctlv2_completion_powershell.md +++ b/docs/metalctlv2_completion_powershell.md @@ -33,7 +33,7 @@ metalctlv2 completion powershell [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_zsh.md b/docs/metalctlv2_completion_zsh.md index 9ba9e8e..540c18b 100644 --- a/docs/metalctlv2_completion_zsh.md +++ b/docs/metalctlv2_completion_zsh.md @@ -47,7 +47,7 @@ metalctlv2 completion zsh [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context.md b/docs/metalctlv2_context.md index 0f0e0b1..64d6cc9 100644 --- a/docs/metalctlv2_context.md +++ b/docs/metalctlv2_context.md @@ -24,7 +24,7 @@ metalctlv2 context [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_add.md b/docs/metalctlv2_context_add.md index 68ff412..12f0016 100644 --- a/docs/metalctlv2_context_add.md +++ b/docs/metalctlv2_context_add.md @@ -24,7 +24,7 @@ metalctlv2 context add [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. ``` diff --git a/docs/metalctlv2_context_list.md b/docs/metalctlv2_context_list.md index 6033cd2..c159544 100644 --- a/docs/metalctlv2_context_list.md +++ b/docs/metalctlv2_context_list.md @@ -20,7 +20,7 @@ metalctlv2 context list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_remove.md b/docs/metalctlv2_context_remove.md index 478c662..907ed50 100644 --- a/docs/metalctlv2_context_remove.md +++ b/docs/metalctlv2_context_remove.md @@ -20,7 +20,7 @@ metalctlv2 context remove [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_set-project.md b/docs/metalctlv2_context_set-project.md index b3a18a2..d32148b 100644 --- a/docs/metalctlv2_context_set-project.md +++ b/docs/metalctlv2_context_set-project.md @@ -20,7 +20,7 @@ metalctlv2 context set-project [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_show-current.md b/docs/metalctlv2_context_show-current.md index 6146f5b..0910241 100644 --- a/docs/metalctlv2_context_show-current.md +++ b/docs/metalctlv2_context_show-current.md @@ -20,7 +20,7 @@ metalctlv2 context show-current [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_switch.md b/docs/metalctlv2_context_switch.md index 0eb28a8..b1fb106 100644 --- a/docs/metalctlv2_context_switch.md +++ b/docs/metalctlv2_context_switch.md @@ -24,7 +24,7 @@ metalctlv2 context switch [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_update.md b/docs/metalctlv2_context_update.md index 393da6d..7a00423 100644 --- a/docs/metalctlv2_context_update.md +++ b/docs/metalctlv2_context_update.md @@ -24,7 +24,7 @@ metalctlv2 context update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. ``` diff --git a/docs/metalctlv2_health.md b/docs/metalctlv2_health.md index 4e607ee..3e75089 100644 --- a/docs/metalctlv2_health.md +++ b/docs/metalctlv2_health.md @@ -24,7 +24,7 @@ metalctlv2 health [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image.md b/docs/metalctlv2_image.md index 7f1e495..85ecf4c 100644 --- a/docs/metalctlv2_image.md +++ b/docs/metalctlv2_image.md @@ -20,7 +20,7 @@ manage images which are used to be installed on machines and firewalls -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image_describe.md b/docs/metalctlv2_image_describe.md index aed8321..961bec4 100644 --- a/docs/metalctlv2_image_describe.md +++ b/docs/metalctlv2_image_describe.md @@ -20,7 +20,7 @@ metalctlv2 image describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image_latest.md b/docs/metalctlv2_image_latest.md index 73d363f..4e0af98 100644 --- a/docs/metalctlv2_image_latest.md +++ b/docs/metalctlv2_image_latest.md @@ -21,7 +21,7 @@ metalctlv2 image latest [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image_list.md b/docs/metalctlv2_image_list.md index b1764ab..633e779 100644 --- a/docs/metalctlv2_image_list.md +++ b/docs/metalctlv2_image_list.md @@ -26,7 +26,7 @@ metalctlv2 image list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip.md b/docs/metalctlv2_ip.md index afd5d6f..201c6c1 100644 --- a/docs/metalctlv2_ip.md +++ b/docs/metalctlv2_ip.md @@ -20,7 +20,7 @@ an ip address of metal-stack.io -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_apply.md b/docs/metalctlv2_ip_apply.md index 91652d5..5e45158 100644 --- a/docs/metalctlv2_ip_apply.md +++ b/docs/metalctlv2_ip_apply.md @@ -35,7 +35,7 @@ metalctlv2 ip apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_create.md b/docs/metalctlv2_ip_create.md index 0e493c3..bcb460f 100644 --- a/docs/metalctlv2_ip_create.md +++ b/docs/metalctlv2_ip_create.md @@ -42,7 +42,7 @@ metalctlv2 ip create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_delete.md b/docs/metalctlv2_ip_delete.md index 1e113d3..2690057 100644 --- a/docs/metalctlv2_ip_delete.md +++ b/docs/metalctlv2_ip_delete.md @@ -36,7 +36,7 @@ metalctlv2 ip delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_describe.md b/docs/metalctlv2_ip_describe.md index b206813..4606f4b 100644 --- a/docs/metalctlv2_ip_describe.md +++ b/docs/metalctlv2_ip_describe.md @@ -21,7 +21,7 @@ metalctlv2 ip describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_edit.md b/docs/metalctlv2_ip_edit.md index e362f7e..ca64814 100644 --- a/docs/metalctlv2_ip_edit.md +++ b/docs/metalctlv2_ip_edit.md @@ -20,7 +20,7 @@ metalctlv2 ip edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_list.md b/docs/metalctlv2_ip_list.md index 1ac5a43..01e885b 100644 --- a/docs/metalctlv2_ip_list.md +++ b/docs/metalctlv2_ip_list.md @@ -22,7 +22,7 @@ metalctlv2 ip list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_update.md b/docs/metalctlv2_ip_update.md index e3d0d1f..8f09b5e 100644 --- a/docs/metalctlv2_ip_update.md +++ b/docs/metalctlv2_ip_update.md @@ -41,7 +41,7 @@ metalctlv2 ip update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_login.md b/docs/metalctlv2_login.md index e961c52..06aa768 100644 --- a/docs/metalctlv2_login.md +++ b/docs/metalctlv2_login.md @@ -22,7 +22,7 @@ metalctlv2 login [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_logout.md b/docs/metalctlv2_logout.md index 560a2a4..f7ae69e 100644 --- a/docs/metalctlv2_logout.md +++ b/docs/metalctlv2_logout.md @@ -22,7 +22,7 @@ metalctlv2 logout [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_markdown.md b/docs/metalctlv2_markdown.md index c298007..1b3a23a 100644 --- a/docs/metalctlv2_markdown.md +++ b/docs/metalctlv2_markdown.md @@ -20,7 +20,7 @@ metalctlv2 markdown [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project.md b/docs/metalctlv2_project.md index f356a7e..6908be0 100644 --- a/docs/metalctlv2_project.md +++ b/docs/metalctlv2_project.md @@ -20,7 +20,7 @@ manage api projects -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_apply.md b/docs/metalctlv2_project_apply.md index 1afdee1..f0a49ab 100644 --- a/docs/metalctlv2_project_apply.md +++ b/docs/metalctlv2_project_apply.md @@ -35,7 +35,7 @@ metalctlv2 project apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_create.md b/docs/metalctlv2_project_create.md index f7e7df1..9954bbf 100644 --- a/docs/metalctlv2_project_create.md +++ b/docs/metalctlv2_project_create.md @@ -38,7 +38,7 @@ metalctlv2 project create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_delete.md b/docs/metalctlv2_project_delete.md index bd68477..cb0e8aa 100644 --- a/docs/metalctlv2_project_delete.md +++ b/docs/metalctlv2_project_delete.md @@ -35,7 +35,7 @@ metalctlv2 project delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_describe.md b/docs/metalctlv2_project_describe.md index 14a5ecc..344c103 100644 --- a/docs/metalctlv2_project_describe.md +++ b/docs/metalctlv2_project_describe.md @@ -20,7 +20,7 @@ metalctlv2 project describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_edit.md b/docs/metalctlv2_project_edit.md index eaa80eb..3de193d 100644 --- a/docs/metalctlv2_project_edit.md +++ b/docs/metalctlv2_project_edit.md @@ -20,7 +20,7 @@ metalctlv2 project edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite.md b/docs/metalctlv2_project_invite.md index bfcce95..d314c94 100644 --- a/docs/metalctlv2_project_invite.md +++ b/docs/metalctlv2_project_invite.md @@ -16,7 +16,7 @@ manage project invites -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite_delete.md b/docs/metalctlv2_project_invite_delete.md index 963bcf4..c558c19 100644 --- a/docs/metalctlv2_project_invite_delete.md +++ b/docs/metalctlv2_project_invite_delete.md @@ -21,7 +21,7 @@ metalctlv2 project invite delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite_generate-join-secret.md b/docs/metalctlv2_project_invite_generate-join-secret.md index 4fb7432..384b8e4 100644 --- a/docs/metalctlv2_project_invite_generate-join-secret.md +++ b/docs/metalctlv2_project_invite_generate-join-secret.md @@ -22,7 +22,7 @@ metalctlv2 project invite generate-join-secret [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite_list.md b/docs/metalctlv2_project_invite_list.md index a319ffc..402e58d 100644 --- a/docs/metalctlv2_project_invite_list.md +++ b/docs/metalctlv2_project_invite_list.md @@ -22,7 +22,7 @@ metalctlv2 project invite list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_join.md b/docs/metalctlv2_project_join.md index 945f19f..132b350 100644 --- a/docs/metalctlv2_project_join.md +++ b/docs/metalctlv2_project_join.md @@ -20,7 +20,7 @@ metalctlv2 project join [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_list.md b/docs/metalctlv2_project_list.md index 8c956df..ccceac3 100644 --- a/docs/metalctlv2_project_list.md +++ b/docs/metalctlv2_project_list.md @@ -23,7 +23,7 @@ metalctlv2 project list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member.md b/docs/metalctlv2_project_member.md index 5a3497d..74a2dfe 100644 --- a/docs/metalctlv2_project_member.md +++ b/docs/metalctlv2_project_member.md @@ -16,7 +16,7 @@ manage project members -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member_delete.md b/docs/metalctlv2_project_member_delete.md index b45509b..fbf3f25 100644 --- a/docs/metalctlv2_project_member_delete.md +++ b/docs/metalctlv2_project_member_delete.md @@ -21,7 +21,7 @@ metalctlv2 project member delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member_list.md b/docs/metalctlv2_project_member_list.md index 5527476..5fadaed 100644 --- a/docs/metalctlv2_project_member_list.md +++ b/docs/metalctlv2_project_member_list.md @@ -22,7 +22,7 @@ metalctlv2 project member list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member_update.md b/docs/metalctlv2_project_member_update.md index 388d5ea..b8a49d7 100644 --- a/docs/metalctlv2_project_member_update.md +++ b/docs/metalctlv2_project_member_update.md @@ -22,7 +22,7 @@ metalctlv2 project member update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_update.md b/docs/metalctlv2_project_update.md index 979c4ff..dd8895b 100644 --- a/docs/metalctlv2_project_update.md +++ b/docs/metalctlv2_project_update.md @@ -37,7 +37,7 @@ metalctlv2 project update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_size.md b/docs/metalctlv2_size.md index 02880f6..f8e4405 100644 --- a/docs/metalctlv2_size.md +++ b/docs/metalctlv2_size.md @@ -20,7 +20,7 @@ manage sizes which defines the cpu, gpu, memory and storage properties of machin -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_size_describe.md b/docs/metalctlv2_size_describe.md index fe0978d..786502f 100644 --- a/docs/metalctlv2_size_describe.md +++ b/docs/metalctlv2_size_describe.md @@ -20,7 +20,7 @@ metalctlv2 size describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_size_list.md b/docs/metalctlv2_size_list.md index 184b636..8387844 100644 --- a/docs/metalctlv2_size_list.md +++ b/docs/metalctlv2_size_list.md @@ -24,7 +24,7 @@ metalctlv2 size list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant.md b/docs/metalctlv2_tenant.md index 6f76844..a7b53f4 100644 --- a/docs/metalctlv2_tenant.md +++ b/docs/metalctlv2_tenant.md @@ -20,7 +20,7 @@ manage api tenants -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_apply.md b/docs/metalctlv2_tenant_apply.md index 8a6d93f..575935e 100644 --- a/docs/metalctlv2_tenant_apply.md +++ b/docs/metalctlv2_tenant_apply.md @@ -35,7 +35,7 @@ metalctlv2 tenant apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_create.md b/docs/metalctlv2_tenant_create.md index 42fd2aa..bb6c1ad 100644 --- a/docs/metalctlv2_tenant_create.md +++ b/docs/metalctlv2_tenant_create.md @@ -39,7 +39,7 @@ metalctlv2 tenant create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_delete.md b/docs/metalctlv2_tenant_delete.md index 38ee3c2..7f60c48 100644 --- a/docs/metalctlv2_tenant_delete.md +++ b/docs/metalctlv2_tenant_delete.md @@ -35,7 +35,7 @@ metalctlv2 tenant delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_describe.md b/docs/metalctlv2_tenant_describe.md index 7fb3c1c..909c1ba 100644 --- a/docs/metalctlv2_tenant_describe.md +++ b/docs/metalctlv2_tenant_describe.md @@ -20,7 +20,7 @@ metalctlv2 tenant describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_edit.md b/docs/metalctlv2_tenant_edit.md index 466da36..bb8de28 100644 --- a/docs/metalctlv2_tenant_edit.md +++ b/docs/metalctlv2_tenant_edit.md @@ -20,7 +20,7 @@ metalctlv2 tenant edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite.md b/docs/metalctlv2_tenant_invite.md index 658268b..e7183b1 100644 --- a/docs/metalctlv2_tenant_invite.md +++ b/docs/metalctlv2_tenant_invite.md @@ -16,7 +16,7 @@ manage tenant invites -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite_delete.md b/docs/metalctlv2_tenant_invite_delete.md index e1d1b3c..2e33a1c 100644 --- a/docs/metalctlv2_tenant_invite_delete.md +++ b/docs/metalctlv2_tenant_invite_delete.md @@ -21,7 +21,7 @@ metalctlv2 tenant invite delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite_generate-join-secret.md b/docs/metalctlv2_tenant_invite_generate-join-secret.md index be22cef..c19e0ac 100644 --- a/docs/metalctlv2_tenant_invite_generate-join-secret.md +++ b/docs/metalctlv2_tenant_invite_generate-join-secret.md @@ -22,7 +22,7 @@ metalctlv2 tenant invite generate-join-secret [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite_list.md b/docs/metalctlv2_tenant_invite_list.md index 01b2cfa..d26f2ba 100644 --- a/docs/metalctlv2_tenant_invite_list.md +++ b/docs/metalctlv2_tenant_invite_list.md @@ -22,7 +22,7 @@ metalctlv2 tenant invite list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_join.md b/docs/metalctlv2_tenant_join.md index fb48fe1..b37c8e7 100644 --- a/docs/metalctlv2_tenant_join.md +++ b/docs/metalctlv2_tenant_join.md @@ -20,7 +20,7 @@ metalctlv2 tenant join [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_list.md b/docs/metalctlv2_tenant_list.md index ee7dae1..951f480 100644 --- a/docs/metalctlv2_tenant_list.md +++ b/docs/metalctlv2_tenant_list.md @@ -23,7 +23,7 @@ metalctlv2 tenant list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member.md b/docs/metalctlv2_tenant_member.md index 8d119dc..6e8826b 100644 --- a/docs/metalctlv2_tenant_member.md +++ b/docs/metalctlv2_tenant_member.md @@ -16,7 +16,7 @@ manage tenant members -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member_list.md b/docs/metalctlv2_tenant_member_list.md index b97fa91..6dd2b73 100644 --- a/docs/metalctlv2_tenant_member_list.md +++ b/docs/metalctlv2_tenant_member_list.md @@ -22,7 +22,7 @@ metalctlv2 tenant member list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member_remove.md b/docs/metalctlv2_tenant_member_remove.md index 830f05b..a402e53 100644 --- a/docs/metalctlv2_tenant_member_remove.md +++ b/docs/metalctlv2_tenant_member_remove.md @@ -21,7 +21,7 @@ metalctlv2 tenant member remove [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member_update.md b/docs/metalctlv2_tenant_member_update.md index cf93cb7..a8ce0a1 100644 --- a/docs/metalctlv2_tenant_member_update.md +++ b/docs/metalctlv2_tenant_member_update.md @@ -22,7 +22,7 @@ metalctlv2 tenant member update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_update.md b/docs/metalctlv2_tenant_update.md index 433fb06..2fd84ba 100644 --- a/docs/metalctlv2_tenant_update.md +++ b/docs/metalctlv2_tenant_update.md @@ -37,7 +37,7 @@ metalctlv2 tenant update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token.md b/docs/metalctlv2_token.md index 82cbe42..d1ee5a4 100644 --- a/docs/metalctlv2_token.md +++ b/docs/metalctlv2_token.md @@ -20,7 +20,7 @@ manage api tokens for accessing the metal-stack.io api -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_apply.md b/docs/metalctlv2_token_apply.md index 72b2fee..0e376b2 100644 --- a/docs/metalctlv2_token_apply.md +++ b/docs/metalctlv2_token_apply.md @@ -35,7 +35,7 @@ metalctlv2 token apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_create.md b/docs/metalctlv2_token_create.md index f2bb26a..00b3ff2 100644 --- a/docs/metalctlv2_token_create.md +++ b/docs/metalctlv2_token_create.md @@ -41,7 +41,7 @@ metalctlv2 token create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_delete.md b/docs/metalctlv2_token_delete.md index 6155756..2a78a94 100644 --- a/docs/metalctlv2_token_delete.md +++ b/docs/metalctlv2_token_delete.md @@ -35,7 +35,7 @@ metalctlv2 token delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_describe.md b/docs/metalctlv2_token_describe.md index 016694f..0c7b204 100644 --- a/docs/metalctlv2_token_describe.md +++ b/docs/metalctlv2_token_describe.md @@ -20,7 +20,7 @@ metalctlv2 token describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_edit.md b/docs/metalctlv2_token_edit.md index 77abfb8..ef1871d 100644 --- a/docs/metalctlv2_token_edit.md +++ b/docs/metalctlv2_token_edit.md @@ -20,7 +20,7 @@ metalctlv2 token edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_list.md b/docs/metalctlv2_token_list.md index 6cdd69a..8a29a24 100644 --- a/docs/metalctlv2_token_list.md +++ b/docs/metalctlv2_token_list.md @@ -21,7 +21,7 @@ metalctlv2 token list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_update.md b/docs/metalctlv2_token_update.md index 4055f11..230b5b8 100644 --- a/docs/metalctlv2_token_update.md +++ b/docs/metalctlv2_token_update.md @@ -35,7 +35,7 @@ metalctlv2 token update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_user.md b/docs/metalctlv2_user.md index c416e39..2a6360e 100644 --- a/docs/metalctlv2_user.md +++ b/docs/metalctlv2_user.md @@ -20,7 +20,7 @@ manage api users for accessing the metal-stack.io api -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_user_describe.md b/docs/metalctlv2_user_describe.md index 9d994bd..4f58c56 100644 --- a/docs/metalctlv2_user_describe.md +++ b/docs/metalctlv2_user_describe.md @@ -20,7 +20,7 @@ metalctlv2 user describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_version.md b/docs/metalctlv2_version.md index 40350c6..bed466f 100644 --- a/docs/metalctlv2_version.md +++ b/docs/metalctlv2_version.md @@ -24,7 +24,7 @@ metalctlv2 version [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template), wide is a table with more columns. (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/tests/e2e/admin/audit_test.go b/tests/e2e/admin/audit_test.go index 9071842..066b966 100644 --- a/tests/e2e/admin/audit_test.go +++ b/tests/e2e/admin/audit_test.go @@ -37,15 +37,15 @@ func Test_AdminAuditCmd_List(t *testing.T) { }, ), WantTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE CODE - 2001-01-01 00:00:00 5091c4e9-e8db-483c-ab6b-fe14f82570a7 Larry 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_REQUEST - 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST + TIME REQUEST ID USER PROJECT METHOD PHASE CODE + 2001-01-01 00:00:00 5091c4e9-e8db-483c-ab6b-fe14f82570a7 Larry 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_REQUEST + 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_RESPONSE AlreadyExists `), WantWideTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY - 2001-01-01 00:00:00 5091c4e9-e8db-483c-ab6b-fe14f82570a7 Larry 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_REQUEST 1.2.3.4 result body - 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST 1.2.3.4 request body + TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY + 2001-01-01 00:00:00 5091c4e9-e8db-483c-ab6b-fe14f82570a7 Larry 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_REQUEST 1.2.3.4 result body + 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST 1.2.3.4 request body 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_RESPONSE 1.2.3.4 AlreadyExists result body `), Template: new("{{ .uuid }} {{ .user }} {{ .phase }}"), @@ -85,7 +85,6 @@ func Test_AuditCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Trace1(), WantProtoObject: testresources.Trace1(), WantTable: new(` TIME REQUEST ID USER PROJECT METHOD PHASE CODE diff --git a/tests/e2e/admin/component_test.go b/tests/e2e/admin/component_test.go index 8652f48..c0d3be7 100644 --- a/tests/e2e/admin/component_test.go +++ b/tests/e2e/admin/component_test.go @@ -31,7 +31,6 @@ func Test_AdminComponentCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Component1(), WantProtoObject: testresources.Component1(), WantTable: new(` ID TYPE IDENTIFIER STARTED AGE VERSION TOKEN TOKEN EXPIRES IN @@ -126,7 +125,7 @@ func Test_AdminComponentCmd_Delete(t *testing.T) { }, }, }), - WantObject: testresources.Component1(), + WantProtoObject: testresources.Component1(), }, } for _, tt := range tests { diff --git a/tests/e2e/admin/image_test.go b/tests/e2e/admin/image_test.go index ec2ed42..f184135 100644 --- a/tests/e2e/admin/image_test.go +++ b/tests/e2e/admin/image_test.go @@ -33,7 +33,6 @@ func Test_AdminImageCmd_Delete(t *testing.T) { }, }, }), - WantObject: testresources.Image1(), WantProtoObject: testresources.Image1(), WantTable: new(` ID NAME DESCRIPTION FEATURES EXPIRATION STATUS @@ -84,9 +83,9 @@ func Test_AdminImageCmd_Create(t *testing.T) { }, }, }), - WantObject: testresources.Image1(), + WantProtoObject: testresources.Image1(), WantTable: new(` - ID NAME DESCRIPTION FEATURES EXPIRATION STATUS + ID NAME DESCRIPTION FEATURES EXPIRATION STATUS ubuntu-24.04 Ubuntu 24.04 Ubuntu 24.04 LTS machine supported `), }, @@ -158,9 +157,9 @@ func Test_AdminImageCmd_Update(t *testing.T) { }, }, }), - WantObject: testresources.Image1(), + WantProtoObject: testresources.Image1(), WantTable: new(` - ID NAME DESCRIPTION FEATURES EXPIRATION STATUS + ID NAME DESCRIPTION FEATURES EXPIRATION STATUS ubuntu-24.04 Ubuntu 24.04 Ubuntu 24.04 LTS machine supported `), }, diff --git a/tests/e2e/admin/size_test.go b/tests/e2e/admin/size_test.go index de25e98..5548404 100644 --- a/tests/e2e/admin/size_test.go +++ b/tests/e2e/admin/size_test.go @@ -33,7 +33,6 @@ func Test_AdminSizeCmd_Delete(t *testing.T) { }, }, }), - WantObject: testresources.Size1(), WantProtoObject: testresources.Size1(), WantTable: new(` ID NAME DESCRIPTION CPU RANGE MEMORY RANGE STORAGE RANGE GPU RANGE @@ -81,10 +80,6 @@ func Test_AdminSizeCmd_List(t *testing.T) { }, }, }), - WantObject: []*apiv2.Size{ - testresources.Size2(), - testresources.Size1(), - }, WantTable: new(` ID NAME DESCRIPTION CPU RANGE MEMORY RANGE STORAGE RANGE GPU RANGE g1-medium-x86 g1-medium-x86 A medium sized GPU server 32 - 32 275 GB - 275 GB 1.8 TB - 1.8 TB AD102GL [RTX 6000 Ada Generation]: 1 - 1 diff --git a/tests/e2e/admin/switch_test.go b/tests/e2e/admin/switch_test.go index 10c13b0..4754ff8 100644 --- a/tests/e2e/admin/switch_test.go +++ b/tests/e2e/admin/switch_test.go @@ -33,7 +33,6 @@ func Test_AdminSwitchCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Switch2(), WantProtoObject: testresources.Switch2(), WantDefault: new(` description: leaf switch 2 @@ -130,7 +129,7 @@ func Test_AdminSwitchCmd_Delete(t *testing.T) { }, }, }), - WantObject: testresources.Switch2(), + WantProtoObject: testresources.Switch2(), }, } for _, tt := range tests { @@ -167,11 +166,11 @@ func Test_AdminSwitchCmd_Update(t *testing.T) { }, }), WantTable: new(` - ID PARTITION RACK OS STATUS LAST SYNC + ID PARTITION RACK OS STATUS LAST SYNC leaf02 fra-equ01 rack-1 🦔 ● `), WantWideTable: new(` - ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR + ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR leaf02 fra-equ01 rack-1 SONiC (4.2.0) v0.9.1 (abc1234) 10.0.0.2 operational 200ms `), Template: new("{{ .id }} {{ .os.metal_core_version }}"), @@ -209,8 +208,8 @@ func Test_AdminSwitchCmd_ConnectedMachines(t *testing.T) { }, }), WantTable: new(` - ID NIC NAME IDENTIFIER PARTITION RACK SIZE PRODUCT SERIAL CHASSIS SERIAL - leaf01 fra-equ01 rack-1 + ID NIC NAME IDENTIFIER PARTITION RACK SIZE PRODUCT SERIAL CHASSIS SERIAL + leaf01 fra-equ01 rack-1 └─╴id1 Ethernet0 (up) oid:0x1000000000001 fra-equ01 rack-1 m1-small ps-1 cs-1 `), }, @@ -244,8 +243,8 @@ func Test_AdminSwitchCmd_Detail(t *testing.T) { }, }), WantTable: new(` - PARTITION RACK SWITCH PORT MACHINE VNI - FILTER CIDR - FILTER - fra-equ01 rack-1 leaf01 Ethernet0 id1 10001 10.0.0.0/24 + PARTITION RACK SWITCH PORT MACHINE VNI - FILTER CIDR - FILTER + fra-equ01 rack-1 leaf01 Ethernet0 id1 10001 10.0.0.0/24 10002 192.168.100.0/24 `), Template: new("{{ .id }} {{ .partition }} {{ .rack }}"), diff --git a/tests/e2e/admin/task_test.go b/tests/e2e/admin/task_test.go index 2137989..1326ee8 100644 --- a/tests/e2e/admin/task_test.go +++ b/tests/e2e/admin/task_test.go @@ -103,7 +103,6 @@ func Test_AdminTaskCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Task1(), WantProtoObject: testresources.Task1(), Template: new("{{ .id }} {{ .type }}"), WantTemplate: new(` @@ -128,7 +127,6 @@ func Test_AdminTaskCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Task3(), WantProtoObject: testresources.Task3(), Template: new("{{ .id }} {{ .queue }} {{ .type }}"), WantTemplate: new(` diff --git a/tests/e2e/admin/tenant_test.go b/tests/e2e/admin/tenant_test.go index 56ff47f..62cb850 100644 --- a/tests/e2e/admin/tenant_test.go +++ b/tests/e2e/admin/tenant_test.go @@ -58,7 +58,6 @@ func Test_AdminTenantCmd_Create(t *testing.T) { }, }, }), - WantObject: adminTenant1(), WantProtoObject: adminTenant1(), }, } diff --git a/tests/e2e/admin/token_test.go b/tests/e2e/admin/token_test.go index 6901af8..48644f2 100644 --- a/tests/e2e/admin/token_test.go +++ b/tests/e2e/admin/token_test.go @@ -33,13 +33,13 @@ func Test_AdminTokenCmd_List(t *testing.T) { }, }), WantTable: new(` - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES - TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) TOKEN_TYPE_API b4c2e7f3-5a9d-4b8e-a1c3-2d6f9e4b8a01 dev@metal-stack.io dev token 0 2 2000-01-03 00:00:00 UTC (in 2d) `), WantWideTable: new(` - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES - TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) TOKEN_TYPE_API b4c2e7f3-5a9d-4b8e-a1c3-2d6f9e4b8a01 dev@metal-stack.io dev token 0 2 2000-01-03 00:00:00 UTC (in 2d) `), Template: new("{{ .uuid }} {{ .description }}"), @@ -78,7 +78,7 @@ func Test_AdminTokenCmd_Delete(t *testing.T) { }, }, }), - WantObject: &apiv2.Token{ + WantProtoObject: &apiv2.Token{ Uuid: testresources.Token1().Uuid, }, }, diff --git a/tests/e2e/api/audit_test.go b/tests/e2e/api/audit_test.go index 9b0e492..5892630 100644 --- a/tests/e2e/api/audit_test.go +++ b/tests/e2e/api/audit_test.go @@ -38,13 +38,13 @@ func Test_AuditCmd_List(t *testing.T) { }, ), WantTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE CODE - 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST + TIME REQUEST ID USER PROJECT METHOD PHASE CODE + 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_RESPONSE AlreadyExists `), WantWideTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY - 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST 1.2.3.4 request body + TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY + 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST 1.2.3.4 request body 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_RESPONSE 1.2.3.4 AlreadyExists result body `), Template: new("{{ .uuid }} {{ .user }} {{ .phase }}"), @@ -83,11 +83,11 @@ d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 2`), }, ), WantTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE CODE + TIME REQUEST ID USER PROJECT METHOD PHASE CODE 2001-01-01 00:00:00 5091c4e9-e8db-483c-ab6b-fe14f82570a7 Larry 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_REQUEST `), WantWideTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY + TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY 2001-01-01 00:00:00 5091c4e9-e8db-483c-ab6b-fe14f82570a7 Larry 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.List/ AUDIT_PHASE_REQUEST 1.2.3.4 result body `), Template: new("{{ .uuid }} {{ .user }} {{ .phase }}"), @@ -157,14 +157,13 @@ func Test_AuditCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Trace1(), WantProtoObject: testresources.Trace1(), WantTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE CODE + TIME REQUEST ID USER PROJECT METHOD PHASE CODE 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST `), WantWideTable: new(` - TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY + TIME REQUEST ID USER PROJECT METHOD PHASE SOURCE IP CODE BODY 2000-01-01 00:00:00 d1ff7267-2fbb-4a63-a7c1-44f1a83381a7 me 0d81bca7-73f6-4da3-8397-4a8c52a0c583 /apiv2.Create/ AUDIT_PHASE_REQUEST 1.2.3.4 request body `), Template: new("{{ .uuid }} {{ .user }} {{ .phase }}"), diff --git a/tests/e2e/api/health_test.go b/tests/e2e/api/health_test.go index 08f845e..ad45d7a 100644 --- a/tests/e2e/api/health_test.go +++ b/tests/e2e/api/health_test.go @@ -54,7 +54,6 @@ func Test_HealthCmd(t *testing.T) { |---|------|--------------| | ✔ | ipam | i am healthy | `), - WantObject: health1(), WantProtoObject: health1(), Template: new("{{ range $s := .services }}{{ $s.message }} {{ end }}"), WantTemplate: new(` diff --git a/tests/e2e/api/image_test.go b/tests/e2e/api/image_test.go index 60bacb1..e01f24a 100644 --- a/tests/e2e/api/image_test.go +++ b/tests/e2e/api/image_test.go @@ -81,7 +81,6 @@ func Test_ImageCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Image1(), WantProtoObject: testresources.Image1(), WantTable: new(` ID NAME DESCRIPTION FEATURES EXPIRATION STATUS @@ -126,7 +125,6 @@ func Test_ImageCmd_Latest(t *testing.T) { }, }, }), - WantObject: testresources.Image1(), WantProtoObject: testresources.Image1(), WantTable: new(` ID NAME DESCRIPTION FEATURES EXPIRATION STATUS diff --git a/tests/e2e/api/ip_test.go b/tests/e2e/api/ip_test.go index b3d869b..9513092 100644 --- a/tests/e2e/api/ip_test.go +++ b/tests/e2e/api/ip_test.go @@ -84,7 +84,6 @@ func Test_IPCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.IP1(), WantProtoObject: testresources.IP1(), WantTable: new(` IP PROJECT ID TYPE NAME ATTACHED SERVICE @@ -131,7 +130,7 @@ func Test_IPCmd_Create(t *testing.T) { }, }, }), - WantObject: testresources.IP1(), + WantProtoObject: testresources.IP1(), }, { Name: "create from file", @@ -192,7 +191,7 @@ func Test_IPCmd_Delete(t *testing.T) { }, }, }), - WantObject: testresources.IP1(), + WantProtoObject: testresources.IP1(), }, { Name: "delete from file", @@ -254,7 +253,7 @@ func Test_IPCmd_Update(t *testing.T) { }, }, ), - WantObject: testresources.IP1(), + WantProtoObject: testresources.IP1(), WantTable: new(` IP PROJECT ID TYPE NAME ATTACHED SERVICE 1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 static a diff --git a/tests/e2e/api/project_test.go b/tests/e2e/api/project_test.go index d44751e..1b2864b 100644 --- a/tests/e2e/api/project_test.go +++ b/tests/e2e/api/project_test.go @@ -34,7 +34,6 @@ func Test_ProjectCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Project1(), WantProtoObject: testresources.Project1(), WantTable: new(` ID TENANT NAME DESCRIPTION CREATION DATE @@ -81,7 +80,6 @@ func Test_ProjectCmd_Create(t *testing.T) { }, }, }), - WantObject: testresources.Project1(), WantProtoObject: testresources.Project1(), }, { @@ -176,7 +174,7 @@ func Test_ProjectCmd_Delete(t *testing.T) { }, }, }), - WantObject: testresources.Project1(), + WantProtoObject: testresources.Project1(), }, { Name: "delete from file", @@ -230,7 +228,7 @@ func Test_ProjectCmd_Update(t *testing.T) { }, }, }), - WantObject: testresources.Project1(), + WantProtoObject: testresources.Project1(), }, { Name: "update from file", @@ -341,7 +339,7 @@ func Test_ProjectCmd_Apply(t *testing.T) { }, ), WantTable: new(` - ID TENANT NAME DESCRIPTION CREATION DATE + ID TENANT NAME DESCRIPTION CREATION DATE 0d81bca7-73f6-4da3-8397-4a8c52a0c583 metal-stack project-a first project 2000-01-01 00:00:00 UTC `), }, @@ -378,7 +376,7 @@ func Test_ProjectCmd_Apply(t *testing.T) { }, ), WantTable: new(` - ID TENANT NAME DESCRIPTION CREATION DATE + ID TENANT NAME DESCRIPTION CREATION DATE 0d81bca7-73f6-4da3-8397-4a8c52a0c583 metal-stack project-a first project 2000-01-01 00:00:00 UTC `), }, @@ -409,13 +407,13 @@ func Test_ProjectCmd_ListInvites(t *testing.T) { }, }), WantTable: new(` - SECRET PROJECT ROLE EXPIRES IN - secret 0d81bca7-73f6-4da3-8397-4a8c52a0c583 PROJECT_ROLE_EDITOR 2 days from now + SECRET PROJECT ROLE EXPIRES IN + secret 0d81bca7-73f6-4da3-8397-4a8c52a0c583 PROJECT_ROLE_EDITOR 2 days from now secret f3b4e6a1-2c8d-4e5f-a7b9-1d3e5f7a9b0c PROJECT_ROLE_EDITOR 2 days from now `), WantWideTable: new(` - SECRET PROJECT ROLE EXPIRES IN - secret 0d81bca7-73f6-4da3-8397-4a8c52a0c583 PROJECT_ROLE_EDITOR 2 days from now + SECRET PROJECT ROLE EXPIRES IN + secret 0d81bca7-73f6-4da3-8397-4a8c52a0c583 PROJECT_ROLE_EDITOR 2 days from now secret f3b4e6a1-2c8d-4e5f-a7b9-1d3e5f7a9b0c PROJECT_ROLE_EDITOR 2 days from now `), Template: new("{{ .project }} {{ .role }}"), @@ -558,13 +556,13 @@ func Test_ProjectCmd_ListMembers(t *testing.T) { }, }), WantTable: new(` - ID ROLE INHERITED SINCE - 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 PROJECT_ROLE_OWNER false now - 40c0da4b-9eb9-4371-91aa-1ae62193fa54 PROJECT_ROLE_EDITOR true now + ID ROLE INHERITED SINCE + 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 PROJECT_ROLE_OWNER false now + 40c0da4b-9eb9-4371-91aa-1ae62193fa54 PROJECT_ROLE_EDITOR true now `), WantWideTable: new(` - ID ROLE INHERITED SINCE - 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 PROJECT_ROLE_OWNER false now + ID ROLE INHERITED SINCE + 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 PROJECT_ROLE_OWNER false now 40c0da4b-9eb9-4371-91aa-1ae62193fa54 PROJECT_ROLE_EDITOR true now `), Template: new("{{ .id }} {{ .role }}"), @@ -632,9 +630,9 @@ func Test_ProjectCmd_UpdateMember(t *testing.T) { }, }, }), - WantObject: testresources.Project1Members(), + WantProtoObject: testresources.Project1Members(), WantTable: new(` - ID ROLE INHERITED SINCE + ID ROLE INHERITED SINCE 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 PROJECT_ROLE_OWNER false now `), }, diff --git a/tests/e2e/api/size_test.go b/tests/e2e/api/size_test.go index 70ca9ee..a1c3a97 100644 --- a/tests/e2e/api/size_test.go +++ b/tests/e2e/api/size_test.go @@ -33,10 +33,6 @@ func Test_SizeCmd_List(t *testing.T) { }, }, }), - WantObject: []*apiv2.Size{ - testresources.Size2(), - testresources.Size1(), - }, WantTable: new(` ID NAME DESCRIPTION CPU RANGE MEMORY RANGE STORAGE RANGE GPU RANGE g1-medium-x86 g1-medium-x86 A medium sized GPU server 32 - 32 275 GB - 275 GB 1.8 TB - 1.8 TB AD102GL [RTX 6000 Ada Generation]: 1 - 1 @@ -84,7 +80,7 @@ func Test_SizeCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.Size1(), + WantProtoObject: testresources.Size1(), WantTable: new(` ID NAME DESCRIPTION CPU RANGE MEMORY RANGE STORAGE RANGE GPU RANGE v1-medium-x86 v1-medium-x86 Virtual size for mini-lab 4 - 4 500 MB - 4.0 GB 1.0 GB - 100 GB diff --git a/tests/e2e/api/tenant_test.go b/tests/e2e/api/tenant_test.go index dd34dc8..d806fe0 100644 --- a/tests/e2e/api/tenant_test.go +++ b/tests/e2e/api/tenant_test.go @@ -47,7 +47,6 @@ func Test_TenantCmd_Describe(t *testing.T) { |-------------|-------------|---------------------|------------| | metal-stack | Metal Stack | info@metal-stack.io | now | `), - WantObject: testresources.Tenant1(), WantProtoObject: testresources.Tenant1(), Template: new("{{ .login }} {{ .name }}"), WantTemplate: new(` @@ -129,7 +128,6 @@ func Test_TenantCmd_Create(t *testing.T) { }, }, }), - WantObject: testresources.Tenant1(), WantProtoObject: testresources.Tenant1(), }, { @@ -156,7 +154,7 @@ func Test_TenantCmd_Create(t *testing.T) { }, }), WantTable: new(` - ID NAME EMAIL REGISTERED + ID NAME EMAIL REGISTERED metal-stack Metal Stack info@metal-stack.io now `), }, @@ -197,8 +195,8 @@ func Test_TenantCmd_Create(t *testing.T) { }, }), WantTable: new(` - ID NAME EMAIL REGISTERED - metal-stack Metal Stack info@metal-stack.io now + ID NAME EMAIL REGISTERED + metal-stack Metal Stack info@metal-stack.io now acme-corp ACME Corp admin@acme.io now `), }, @@ -227,7 +225,7 @@ func Test_TenantCmd_Delete(t *testing.T) { }, }, }), - WantObject: testresources.Tenant1(), + WantProtoObject: testresources.Tenant1(), }, { Name: "delete from file", @@ -250,7 +248,7 @@ func Test_TenantCmd_Delete(t *testing.T) { }, }), WantTable: new(` - ID NAME EMAIL REGISTERED + ID NAME EMAIL REGISTERED metal-stack Metal Stack info@metal-stack.io now `), }, @@ -307,7 +305,7 @@ func Test_TenantCmd_Update(t *testing.T) { }, }), WantTable: new(` - ID NAME EMAIL REGISTERED + ID NAME EMAIL REGISTERED metal-stack Metal Stack info@metal-stack.io now `), }, @@ -345,7 +343,7 @@ func Test_TenantCmd_Apply(t *testing.T) { }, ), WantTable: new(` - ID NAME EMAIL REGISTERED + ID NAME EMAIL REGISTERED metal-stack Metal Stack info@metal-stack.io now `), }, @@ -384,7 +382,7 @@ func Test_TenantCmd_Apply(t *testing.T) { }, ), WantTable: new(` - ID NAME EMAIL REGISTERED + ID NAME EMAIL REGISTERED metal-stack Metal Stack info@metal-stack.io now `), }, @@ -417,13 +415,13 @@ func Test_TenantCmd_ListMembers(t *testing.T) { }, }), WantTable: new(` - ID ROLE SINCE - 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 TENANT_ROLE_OWNER now + ID ROLE SINCE + 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 TENANT_ROLE_OWNER now 40c0da4b-9eb9-4371-91aa-1ae62193fa54 TENANT_ROLE_EDITOR now `), WantWideTable: new(` - ID ROLE SINCE - 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 TENANT_ROLE_OWNER now + ID ROLE SINCE + 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 TENANT_ROLE_OWNER now 40c0da4b-9eb9-4371-91aa-1ae62193fa54 TENANT_ROLE_EDITOR now `), Template: new("{{ .id }} {{ .role }} {{ .projects }}"), @@ -491,9 +489,9 @@ func Test_TenantCmd_UpdateMember(t *testing.T) { }, }, }), - WantObject: testresources.Tenant1Members(), + WantProtoObject: testresources.Tenant1Members(), WantTable: new(` - ID ROLE SINCE + ID ROLE SINCE 16d6e8ba-f574-494f-8d5e-74f6cb2d8db0 TENANT_ROLE_OWNER now `), }, @@ -526,13 +524,13 @@ func Test_TenantCmd_ListInvites(t *testing.T) { }, }), WantTable: new(` - SECRET TENANT INVITED BY ROLE EXPIRES IN - secret acme-corp acme-corp TENANT_ROLE_EDITOR 2 days from now + SECRET TENANT INVITED BY ROLE EXPIRES IN + secret acme-corp acme-corp TENANT_ROLE_EDITOR 2 days from now secret metal-stack metal-stack TENANT_ROLE_VIEWER 2 days from now `), WantWideTable: new(` - SECRET TENANT INVITED BY ROLE EXPIRES IN - secret acme-corp acme-corp TENANT_ROLE_EDITOR 2 days from now + SECRET TENANT INVITED BY ROLE EXPIRES IN + secret acme-corp acme-corp TENANT_ROLE_EDITOR 2 days from now secret metal-stack metal-stack TENANT_ROLE_VIEWER 2 days from now `), Template: new("{{ .tenant }} {{ .role }}"), diff --git a/tests/e2e/api/token_test.go b/tests/e2e/api/token_test.go index 11b5fa1..867225d 100644 --- a/tests/e2e/api/token_test.go +++ b/tests/e2e/api/token_test.go @@ -47,7 +47,6 @@ func Test_TokenCmd_Describe(t *testing.T) { |----------------|--------------------------------------|-------|----------------------|-------------|-------|-------|---------------------------------| | TOKEN_TYPE_API | a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 | | admin@metal-stack.io | ci token | 0 | 0 | 2000-01-02 00:00:00 UTC (in 1d) | `), - WantObject: testresources.Token1(), WantProtoObject: testresources.Token1(), Template: new("{{ .uuid }} {{ .description }}"), WantTemplate: new(` @@ -81,13 +80,13 @@ func Test_TokenCmd_List(t *testing.T) { }, }), WantTable: new(` - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES - TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) TOKEN_TYPE_API b4c2e7f3-5a9d-4b8e-a1c3-2d6f9e4b8a01 dev@metal-stack.io dev token 0 2 2000-01-03 00:00:00 UTC (in 2d) `), WantWideTable: new(` - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES - TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) TOKEN_TYPE_API b4c2e7f3-5a9d-4b8e-a1c3-2d6f9e4b8a01 dev@metal-stack.io dev token 0 2 2000-01-03 00:00:00 UTC (in 2d) `), Template: new("{{ .uuid }} {{ .description }}"), @@ -125,7 +124,7 @@ func Test_TokenCmd_Delete(t *testing.T) { }, }, }), - WantObject: &apiv2.Token{Uuid: testresources.Token1().Uuid}, + WantProtoObject: &apiv2.Token{Uuid: testresources.Token1().Uuid}, }, { Name: "delete from file", @@ -148,7 +147,7 @@ func Test_TokenCmd_Delete(t *testing.T) { }, ), WantTable: new(` - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES TOKEN_TYPE_UNSPECIFIED a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 0 0 1970-01-01 00:00:00 UTC (in -10957d) `), }, @@ -181,12 +180,12 @@ func Test_TokenCmd_Create(t *testing.T) { }), WantMarkdown: new(` Make sure to copy your personal access token now as you will not be able to see this again. - + token-secret - + | TYPE | ID | ADMIN | USER | DESCRIPTION | ROLES | PERMS | EXPIRES | |----------------|--------------------------------------|-------|----------------------|-------------|-------|-------|---------------------------------| - | TOKEN_TYPE_API | a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 | | admin@metal-stack.io | ci token | 0 | 0 | 2000-01-02 00:00:00 UTC (in 1d) | + | TOKEN_TYPE_API | a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 | | admin@metal-stack.io | ci token | 0 | 0 | 2000-01-02 00:00:00 UTC (in 1d) | `), }, { @@ -214,10 +213,10 @@ func Test_TokenCmd_Create(t *testing.T) { }), WantTable: new(` Make sure to copy your personal access token now as you will not be able to see this again. - + token-secret - - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) `), }, @@ -256,7 +255,7 @@ func Test_UpdateCmd_Update(t *testing.T) { }, ), WantTable: new(` - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES TOKEN_TYPE_API b4c2e7f3-5a9d-4b8e-a1c3-2d6f9e4b8a01 dev@metal-stack.io dev token 0 2 2000-01-03 00:00:00 UTC (in 2d) `), Template: new("{{ .uuid }} {{ .permissions }}"), @@ -297,10 +296,10 @@ func Test_TokenCmd_Apply(t *testing.T) { ), WantTable: new(` Make sure to copy your personal access token now as you will not be able to see this again. - - - - TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES + + + + TYPE ID ADMIN USER DESCRIPTION ROLES PERMS EXPIRES TOKEN_TYPE_API a3b1f6d2-4e8c-4f7a-9d2e-1b5c8f3a7e90 admin@metal-stack.io ci token 0 0 2000-01-02 00:00:00 UTC (in 1d) `), }, diff --git a/tests/e2e/api/user_test.go b/tests/e2e/api/user_test.go index f7df29e..261a846 100644 --- a/tests/e2e/api/user_test.go +++ b/tests/e2e/api/user_test.go @@ -28,14 +28,13 @@ func Test_UserCmd_Describe(t *testing.T) { }, }, }), - WantObject: testresources.User(), WantProtoObject: testresources.User(), WantTable: new(` - LOGIN NAME EMAIL + LOGIN NAME EMAIL larry@metal-stack.io@openid-connect Larry larry@metal-stack.io `), WantWideTable: new(` - LOGIN NAME EMAIL TENANTS PROJECTS + LOGIN NAME EMAIL TENANTS PROJECTS larry@metal-stack.io@openid-connect Larry larry@metal-stack.io Metal Stack, ACME Corp project-a, project-b `), WantMarkdown: new(` From 98abeccc531152ccdf2e75f25dac24509367e1dd Mon Sep 17 00:00:00 2001 From: Gerrit Date: Tue, 7 Jul 2026 12:40:19 +0200 Subject: [PATCH 2/4] For sizes. --- cmd/admin/v2/image.go | 5 ++ cmd/admin/v2/size.go | 18 +++---- cmd/admin/v2/tenant.go | 5 ++ go.mod | 2 +- go.sum | 4 +- pkg/helpers/meta.go | 18 +++++++ tests/e2e/admin/size_test.go | 2 +- tests/e2e/admin/switch_test.go | 98 +++++++++++++++++----------------- 8 files changed, 90 insertions(+), 62 deletions(-) create mode 100644 pkg/helpers/meta.go diff --git a/cmd/admin/v2/image.go b/cmd/admin/v2/image.go index 4aaf53d..e651d08 100644 --- a/cmd/admin/v2/image.go +++ b/cmd/admin/v2/image.go @@ -8,6 +8,7 @@ import ( adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" + "github.com/metal-stack/cli/pkg/helpers" "github.com/metal-stack/metal-lib/pkg/genericcli" "github.com/metal-stack/metal-lib/pkg/genericcli/printers" "github.com/metal-stack/metal-lib/pkg/pointer" @@ -86,6 +87,10 @@ func (c *image) Create(rq *adminv2.ImageServiceCreateRequest) (*apiv2.Image, err resp, err := c.c.Client.Adminv2().Image().Create(ctx, rq) if err != nil { + if helpers.IsAlreadyExists(err) { + return nil, genericcli.AlreadyExistsError() + } + return nil, fmt.Errorf("failed to create image: %w", err) } diff --git a/cmd/admin/v2/size.go b/cmd/admin/v2/size.go index 634fe08..779f75d 100644 --- a/cmd/admin/v2/size.go +++ b/cmd/admin/v2/size.go @@ -7,6 +7,7 @@ import ( apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" "github.com/metal-stack/cli/cmd/sorters" + "github.com/metal-stack/cli/pkg/helpers" "github.com/metal-stack/metal-lib/pkg/genericcli" "github.com/metal-stack/metal-lib/pkg/genericcli/printers" "github.com/metal-stack/metal-lib/pkg/pointer" @@ -43,10 +44,6 @@ func newSizeCmd(c *config.Config) *cobra.Command { cmd.Flags().StringP("name", "", "", "size name to update") cmd.Flags().StringP("description", "", "", "size description to update") }, - CreateCmdMutateFn: func(cmd *cobra.Command) { - - }, - // TODO: create from CLI might be nice to have? } return genericcli.NewCmds(cmdsConfig) @@ -72,6 +69,10 @@ func (c *size) Create(rq *adminv2.SizeServiceCreateRequest) (*apiv2.Size, error) resp, err := c.c.Client.Adminv2().Size().Create(ctx, rq) if err != nil { + if helpers.IsAlreadyExists(err) { + return nil, genericcli.AlreadyExistsError() + } + return nil, fmt.Errorf("failed to create size: %w", err) } @@ -121,7 +122,9 @@ func (c *size) Update(rq *adminv2.SizeServiceUpdateRequest) (*apiv2.Size, error) } func (c *size) Convert(r *apiv2.Size) (string, *adminv2.SizeServiceCreateRequest, *adminv2.SizeServiceUpdateRequest, error) { - return r.Id, &adminv2.SizeServiceCreateRequest{ + + return r.Id, + &adminv2.SizeServiceCreateRequest{ Size: &apiv2.Size{ Id: r.Id, Name: r.Name, @@ -134,10 +137,7 @@ func (c *size) Convert(r *apiv2.Size) (string, *adminv2.SizeServiceCreateRequest Name: r.Name, Description: r.Description, Constraints: r.Constraints, - UpdateMeta: &apiv2.UpdateMeta{ - LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_CLIENT, - UpdatedAt: r.Meta.UpdatedAt, - }, + UpdateMeta: helpers.UpdateMetaFromMeta(r.Meta), Labels: &apiv2.UpdateLabels{ Strategy: &apiv2.UpdateLabels_Replace{ Replace: &apiv2.Labels{ diff --git a/cmd/admin/v2/tenant.go b/cmd/admin/v2/tenant.go index 1f630b5..1aa58f0 100644 --- a/cmd/admin/v2/tenant.go +++ b/cmd/admin/v2/tenant.go @@ -7,6 +7,7 @@ import ( apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" "github.com/metal-stack/cli/cmd/sorters" + "github.com/metal-stack/cli/pkg/helpers" "github.com/metal-stack/metal-lib/pkg/genericcli" "github.com/metal-stack/metal-lib/pkg/genericcli/printers" "github.com/metal-stack/metal-lib/pkg/pointer" @@ -87,6 +88,10 @@ func (c *tenant) Create(rq *adminv2.TenantServiceCreateRequest) (*apiv2.Tenant, resp, err := c.c.Client.Adminv2().Tenant().Create(ctx, rq) if err != nil { + if helpers.IsAlreadyExists(err) { + return nil, genericcli.AlreadyExistsError() + } + return nil, fmt.Errorf("failed to create tenant: %w", err) } diff --git a/go.mod b/go.mod index 61b8dd4..e553852 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 github.com/metal-stack/api v0.2.3 - github.com/metal-stack/metal-lib v0.25.2 + github.com/metal-stack/metal-lib v0.25.3-0.20260707093008-1dcc55686fde github.com/metal-stack/v v1.0.3 github.com/spf13/afero v1.15.0 github.com/spf13/cobra v1.10.2 diff --git a/go.sum b/go.sum index b3f02bf..0346011 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/a github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/metal-stack/api v0.2.3 h1:+WxXfcsd3R9Hr8BzOa0ybXv8rlarDNJDSlVgetwAYns= github.com/metal-stack/api v0.2.3/go.mod h1:+WrGqA7QpQ2O60vakm3tjDbo70Q4c92pdco4R5MRcL8= -github.com/metal-stack/metal-lib v0.25.2 h1:OW8y6PtlV5lv3bXSDU1MaNGvtbroiDYjuhSxqKHKAgw= -github.com/metal-stack/metal-lib v0.25.2/go.mod h1:tnx4MM5oml10EMN6Nq6oFSbjOKB9B27WUZQUyZ4MywA= +github.com/metal-stack/metal-lib v0.25.3-0.20260707093008-1dcc55686fde h1:SdZwSK3SAcpDlN+Q/lMrE1l9bHx0jkRCR4Suig1PhF8= +github.com/metal-stack/metal-lib v0.25.3-0.20260707093008-1dcc55686fde/go.mod h1:tnx4MM5oml10EMN6Nq6oFSbjOKB9B27WUZQUyZ4MywA= github.com/metal-stack/v v1.0.3 h1:Sh2oBlnxrCUD+mVpzfC8HiqL045YWkxs0gpTvkjppqs= github.com/metal-stack/v v1.0.3/go.mod h1:YTahEu7/ishwpYKnp/VaW/7nf8+PInogkfGwLcGPdXg= github.com/minio/minlz v1.1.1 h1:OGmft1V6AnI/Wme332U6bhG54nxEan+VFgkD7lat4KM= diff --git a/pkg/helpers/meta.go b/pkg/helpers/meta.go new file mode 100644 index 0000000..a433b87 --- /dev/null +++ b/pkg/helpers/meta.go @@ -0,0 +1,18 @@ +package helpers + +import apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + +// UpdateMetaFromMeta returns an update for a given meta. +// When the updated at field is set, it uses client locking, otherwise server locking. +func UpdateMetaFromMeta(meta *apiv2.Meta) *apiv2.UpdateMeta { + if meta == nil || meta.UpdatedAt == nil || meta.UpdatedAt.AsTime().IsZero() { + return &apiv2.UpdateMeta{ + LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_SERVER, + } + } + + return &apiv2.UpdateMeta{ + LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_CLIENT, + UpdatedAt: meta.UpdatedAt, + } +} diff --git a/tests/e2e/admin/size_test.go b/tests/e2e/admin/size_test.go index 5548404..1caaefe 100644 --- a/tests/e2e/admin/size_test.go +++ b/tests/e2e/admin/size_test.go @@ -172,7 +172,7 @@ func Test_AdminSizeCmd_Update(t *testing.T) { Name: testresources.Size1().Name, Description: testresources.Size1().Description, UpdateMeta: &apiv2.UpdateMeta{ - LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_CLIENT, + LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_SERVER, }, Labels: &apiv2.UpdateLabels{ Strategy: &apiv2.UpdateLabels_Replace{ diff --git a/tests/e2e/admin/switch_test.go b/tests/e2e/admin/switch_test.go index 4754ff8..b91de20 100644 --- a/tests/e2e/admin/switch_test.go +++ b/tests/e2e/admin/switch_test.go @@ -35,22 +35,22 @@ func Test_AdminSwitchCmd_Describe(t *testing.T) { }), WantProtoObject: testresources.Switch2(), WantDefault: new(` -description: leaf switch 2 id: leaf02 -lastSync: - duration: 0.200s - time: "2000-01-01T00:00:00Z" +meta: + createdAt: "2000-01-01T00:00:00Z" +description: leaf switch 2 +rack: rack-1 +partition: fra-equ01 managementIp: 10.0.0.2 managementUser: admin -meta: - createdAt: "2000-01-01T00:00:00Z" os: - metalCoreVersion: v0.9.1 (abc1234), tags/v0.9.1 - vendor: SWITCH_OS_VENDOR_SONIC - version: 4.2.0 -partition: fra-equ01 -rack: rack-1 - `), + vendor: SWITCH_OS_VENDOR_SONIC + version: 4.2.0 + metalCoreVersion: v0.9.1 (abc1234), tags/v0.9.1 +lastSync: + time: "2000-01-01T00:00:00Z" + duration: 0.200s + `), }, } for _, tt := range tests { @@ -83,26 +83,26 @@ func Test_AdminSwitchCmd_List(t *testing.T) { }, }), WantTable: new(` - ID PARTITION RACK OS STATUS LAST SYNC - leaf01 fra-equ01 rack-1 🦔 ● - leaf02 fra-equ01 rack-1 🦔 ● - `), + ID PARTITION RACK OS STATUS LAST SYNC + leaf01 fra-equ01 rack-1 🦔 ● + leaf02 fra-equ01 rack-1 🦔 ● + `), WantWideTable: new(` - ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR - leaf01 fra-equ01 rack-1 SONiC (4.2.0) v0.9.1 (abc1234) 10.0.0.1 operational 100ms - leaf02 fra-equ01 rack-1 SONiC (4.2.0) v0.9.1 (abc1234) 10.0.0.2 operational 200ms - `), + ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR + leaf01 fra-equ01 rack-1 SONiC (4.2.0) v0.9.1 (abc1234) 10.0.0.1 operational 100ms + leaf02 fra-equ01 rack-1 SONiC (4.2.0) v0.9.1 (abc1234) 10.0.0.2 operational 200ms + `), Template: new("{{ .id }} {{ .partition }}"), WantTemplate: new(` leaf01 fra-equ01 leaf02 fra-equ01 - `), + `), WantMarkdown: new(` - | ID | PARTITION | RACK | OS | STATUS | LAST SYNC | - |--------|-----------|--------|----|--------|-----------| - | leaf01 | fra-equ01 | rack-1 | 🦔 | ● | | - | leaf02 | fra-equ01 | rack-1 | 🦔 | ● | | - `), + | ID | PARTITION | RACK | OS | STATUS | LAST SYNC | + |--------|-----------|--------|----|--------|-----------| + | leaf01 | fra-equ01 | rack-1 | 🦔 | ● | | + | leaf02 | fra-equ01 | rack-1 | 🦔 | ● | | + `), }, } for _, tt := range tests { @@ -168,18 +168,18 @@ func Test_AdminSwitchCmd_Update(t *testing.T) { WantTable: new(` ID PARTITION RACK OS STATUS LAST SYNC leaf02 fra-equ01 rack-1 🦔 ● - `), + `), WantWideTable: new(` ID PARTITION RACK OS METALCORE IP MODE LAST SYNC SYNC DURATION LAST ERROR leaf02 fra-equ01 rack-1 SONiC (4.2.0) v0.9.1 (abc1234) 10.0.0.2 operational 200ms - `), + `), Template: new("{{ .id }} {{ .os.metal_core_version }}"), WantTemplate: new(`leaf02 v0.9.1 (abc1234), tags/v0.9.1`), WantMarkdown: new(` | ID | PARTITION | RACK | OS | STATUS | LAST SYNC | |--------|-----------|--------|----|--------|-----------| | leaf02 | fra-equ01 | rack-1 | 🦔 | ● | | - `), + `), }, } for _, tt := range tests { @@ -211,7 +211,7 @@ func Test_AdminSwitchCmd_ConnectedMachines(t *testing.T) { ID NIC NAME IDENTIFIER PARTITION RACK SIZE PRODUCT SERIAL CHASSIS SERIAL leaf01 fra-equ01 rack-1 └─╴id1 Ethernet0 (up) oid:0x1000000000001 fra-equ01 rack-1 m1-small ps-1 cs-1 - `), + `), }, } for _, tt := range tests { @@ -246,7 +246,7 @@ func Test_AdminSwitchCmd_Detail(t *testing.T) { PARTITION RACK SWITCH PORT MACHINE VNI - FILTER CIDR - FILTER fra-equ01 rack-1 leaf01 Ethernet0 id1 10001 10.0.0.0/24 10002 192.168.100.0/24 - `), + `), Template: new("{{ .id }} {{ .partition }} {{ .rack }}"), WantTemplate: new(`leaf01 fra-equ01 rack-1`), WantMarkdown: new(` @@ -254,7 +254,7 @@ func Test_AdminSwitchCmd_Detail(t *testing.T) { |-----------|--------|--------|-----------|---------|--------------|------------------| | fra-equ01 | rack-1 | leaf01 | Ethernet0 | id1 | 10001 | 10.0.0.0/24 | | | | | | | 10002 | 192.168.100.0/24 | - `), + `), }, } for _, tt := range tests { @@ -284,22 +284,22 @@ func Test_AdminSwitchCmd_Migrate(t *testing.T) { }), WantDefault: new(` switch: - description: leaf switch 2 - id: leaf02 - lastSync: - duration: 0.200s - time: "2000-01-01T00:00:00Z" - managementIp: 10.0.0.2 - managementUser: admin - meta: - createdAt: "2000-01-01T00:00:00Z" - os: - metalCoreVersion: v0.9.1 (abc1234), tags/v0.9.1 - vendor: SWITCH_OS_VENDOR_SONIC - version: 4.2.0 - partition: fra-equ01 - rack: rack-1 - `), + id: leaf02 + meta: + createdAt: "2000-01-01T00:00:00Z" + description: leaf switch 2 + rack: rack-1 + partition: fra-equ01 + managementIp: 10.0.0.2 + managementUser: admin + os: + vendor: SWITCH_OS_VENDOR_SONIC + version: 4.2.0 + metalCoreVersion: v0.9.1 (abc1234), tags/v0.9.1 + lastSync: + time: "2000-01-01T00:00:00Z" + duration: 0.200s +`), }, } for _, tt := range tests { @@ -457,7 +457,7 @@ Desired: actual: 1 desired: 1 vrf: default - `), + `), }, } for _, tt := range tests { From a02be45fff441853fe606c00c59322ce6e8501d7 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Tue, 7 Jul 2026 15:20:33 +0200 Subject: [PATCH 3/4] Use errorutil from API package. --- cmd/admin/v2/image.go | 4 ++-- cmd/admin/v2/size.go | 3 ++- cmd/admin/v2/tenant.go | 4 ++-- cmd/api/v2/ip.go | 3 ++- cmd/api/v2/project.go | 4 ++-- cmd/api/v2/tenant.go | 4 ++-- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ pkg/helpers/errors.go | 15 --------------- 9 files changed, 30 insertions(+), 43 deletions(-) delete mode 100644 pkg/helpers/errors.go diff --git a/cmd/admin/v2/image.go b/cmd/admin/v2/image.go index e651d08..c934922 100644 --- a/cmd/admin/v2/image.go +++ b/cmd/admin/v2/image.go @@ -5,10 +5,10 @@ import ( "strings" "time" + "github.com/metal-stack/api/go/errorutil" adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" - "github.com/metal-stack/cli/pkg/helpers" "github.com/metal-stack/metal-lib/pkg/genericcli" "github.com/metal-stack/metal-lib/pkg/genericcli/printers" "github.com/metal-stack/metal-lib/pkg/pointer" @@ -87,7 +87,7 @@ func (c *image) Create(rq *adminv2.ImageServiceCreateRequest) (*apiv2.Image, err resp, err := c.c.Client.Adminv2().Image().Create(ctx, rq) if err != nil { - if helpers.IsAlreadyExists(err) { + if errorutil.IsConflict(err) { return nil, genericcli.AlreadyExistsError() } diff --git a/cmd/admin/v2/size.go b/cmd/admin/v2/size.go index 779f75d..13542b6 100644 --- a/cmd/admin/v2/size.go +++ b/cmd/admin/v2/size.go @@ -3,6 +3,7 @@ package v2 import ( "fmt" + "github.com/metal-stack/api/go/errorutil" adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" @@ -69,7 +70,7 @@ func (c *size) Create(rq *adminv2.SizeServiceCreateRequest) (*apiv2.Size, error) resp, err := c.c.Client.Adminv2().Size().Create(ctx, rq) if err != nil { - if helpers.IsAlreadyExists(err) { + if errorutil.IsConflict(err) { return nil, genericcli.AlreadyExistsError() } diff --git a/cmd/admin/v2/tenant.go b/cmd/admin/v2/tenant.go index 1aa58f0..ebcd7c5 100644 --- a/cmd/admin/v2/tenant.go +++ b/cmd/admin/v2/tenant.go @@ -3,11 +3,11 @@ package v2 import ( "fmt" + "github.com/metal-stack/api/go/errorutil" adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" "github.com/metal-stack/cli/cmd/sorters" - "github.com/metal-stack/cli/pkg/helpers" "github.com/metal-stack/metal-lib/pkg/genericcli" "github.com/metal-stack/metal-lib/pkg/genericcli/printers" "github.com/metal-stack/metal-lib/pkg/pointer" @@ -88,7 +88,7 @@ func (c *tenant) Create(rq *adminv2.TenantServiceCreateRequest) (*apiv2.Tenant, resp, err := c.c.Client.Adminv2().Tenant().Create(ctx, rq) if err != nil { - if helpers.IsAlreadyExists(err) { + if errorutil.IsConflict(err) { return nil, genericcli.AlreadyExistsError() } diff --git a/cmd/api/v2/ip.go b/cmd/api/v2/ip.go index 283af54..8e237f5 100644 --- a/cmd/api/v2/ip.go +++ b/cmd/api/v2/ip.go @@ -1,6 +1,7 @@ package v2 import ( + "github.com/metal-stack/api/go/errorutil" apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" "github.com/metal-stack/cli/cmd/sorters" @@ -151,7 +152,7 @@ func (c *ip) Create(rq *apiv2.IPServiceCreateRequest) (*apiv2.IP, error) { resp, err := c.c.Client.Apiv2().IP().Create(ctx, rq) if err != nil { - if helpers.IsAlreadyExists(err) { + if errorutil.IsConflict(err) { return nil, genericcli.AlreadyExistsError() } diff --git a/cmd/api/v2/project.go b/cmd/api/v2/project.go index 07ceb38..ae47d22 100644 --- a/cmd/api/v2/project.go +++ b/cmd/api/v2/project.go @@ -5,10 +5,10 @@ import ( "github.com/dustin/go-humanize" "github.com/fatih/color" + "github.com/metal-stack/api/go/errorutil" apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" "github.com/metal-stack/cli/cmd/sorters" - "github.com/metal-stack/cli/pkg/helpers" "github.com/metal-stack/metal-lib/pkg/genericcli" "github.com/metal-stack/metal-lib/pkg/genericcli/printers" "github.com/metal-stack/metal-lib/pkg/pointer" @@ -206,7 +206,7 @@ func (c *project) Create(rq *apiv2.ProjectServiceCreateRequest) (*apiv2.Project, resp, err := c.c.Client.Apiv2().Project().Create(ctx, rq) if err != nil { - if helpers.IsAlreadyExists(err) { + if errorutil.IsConflict(err) { return nil, genericcli.AlreadyExistsError() } diff --git a/cmd/api/v2/tenant.go b/cmd/api/v2/tenant.go index 52cb3c2..c1526ba 100644 --- a/cmd/api/v2/tenant.go +++ b/cmd/api/v2/tenant.go @@ -5,10 +5,10 @@ import ( "github.com/dustin/go-humanize" "github.com/fatih/color" + "github.com/metal-stack/api/go/errorutil" apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" "github.com/metal-stack/cli/cmd/config" "github.com/metal-stack/cli/cmd/sorters" - "github.com/metal-stack/cli/pkg/helpers" "github.com/metal-stack/metal-lib/pkg/genericcli" "github.com/metal-stack/metal-lib/pkg/genericcli/printers" "github.com/metal-stack/metal-lib/pkg/pointer" @@ -204,7 +204,7 @@ func (c *tenant) Create(rq *apiv2.TenantServiceCreateRequest) (*apiv2.Tenant, er resp, err := c.c.Client.Apiv2().Tenant().Create(ctx, rq) if err != nil { - if helpers.IsAlreadyExists(err) { + if errorutil.IsConflict(err) { return nil, genericcli.AlreadyExistsError() } diff --git a/go.mod b/go.mod index e553852..9c4666a 100644 --- a/go.mod +++ b/go.mod @@ -9,14 +9,14 @@ require ( github.com/fatih/color v1.19.0 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 - github.com/metal-stack/api v0.2.3 + github.com/metal-stack/api v0.2.5 github.com/metal-stack/metal-lib v0.25.3-0.20260707093008-1dcc55686fde github.com/metal-stack/v v1.0.3 github.com/spf13/afero v1.15.0 github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 - google.golang.org/grpc v1.81.1 + google.golang.org/grpc v1.82.0 google.golang.org/protobuf v1.36.11 sigs.k8s.io/yaml v1.6.0 ) @@ -40,9 +40,9 @@ require ( github.com/goccy/go-json v0.10.6 // indirect github.com/goccy/go-yaml v1.19.2 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect - github.com/google/cel-go v0.28.1 // indirect + github.com/google/cel-go v0.29.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.18.6 // indirect + github.com/klauspost/compress v1.19.0 // indirect github.com/klauspost/connect-compress/v2 v2.1.1 // indirect github.com/mattn/go-colorable v0.1.15 // indirect github.com/mattn/go-isatty v0.0.22 // indirect @@ -67,8 +67,8 @@ require ( golang.org/x/net v0.56.0 // indirect golang.org/x/sys v0.46.0 // indirect golang.org/x/text v0.38.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260622175928-b703f567277d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apimachinery v0.35.1 // indirect diff --git a/go.sum b/go.sum index 0346011..8be8b3f 100644 --- a/go.sum +++ b/go.sum @@ -49,16 +49,16 @@ github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= -github.com/google/cel-go v0.28.1 h1:YWIwi77J4xIsYUwAF/iIuS6haffzIHS8yWI8glSbLWM= -github.com/google/cel-go v0.28.1/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= +github.com/google/cel-go v0.29.1 h1:8Gx3S5HPop5XPOHtZI8vkaGk+DBW/nn9fkpNPbh5dBk= +github.com/google/cel-go v0.29.1/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= -github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.19.0 h1:sXLILfc9jV2QYWkzFOPWStmcUVH2RHEB1JCdY2oVvCQ= +github.com/klauspost/compress v1.19.0/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/klauspost/connect-compress/v2 v2.1.1 h1:ycZNp4rWOZBodVE2Ls5AzK4aHkyK+GteEfzRZgKNs+c= github.com/klauspost/connect-compress/v2 v2.1.1/go.mod h1:9oilsPHJMzGKkjafSBk9J7iVo4mO+dw0G0KSdVpnlVE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -71,8 +71,8 @@ github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU= github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= -github.com/metal-stack/api v0.2.3 h1:+WxXfcsd3R9Hr8BzOa0ybXv8rlarDNJDSlVgetwAYns= -github.com/metal-stack/api v0.2.3/go.mod h1:+WrGqA7QpQ2O60vakm3tjDbo70Q4c92pdco4R5MRcL8= +github.com/metal-stack/api v0.2.5 h1:4w6nllK8GGCbQGp1//jgWTJF5Jm1W5F1MLQy/JSoRVM= +github.com/metal-stack/api v0.2.5/go.mod h1:DEo89zN3hNMVbUGgotrWqFVMI3ECnX3WmFA0g4LCaB0= github.com/metal-stack/metal-lib v0.25.3-0.20260707093008-1dcc55686fde h1:SdZwSK3SAcpDlN+Q/lMrE1l9bHx0jkRCR4Suig1PhF8= github.com/metal-stack/metal-lib v0.25.3-0.20260707093008-1dcc55686fde/go.mod h1:tnx4MM5oml10EMN6Nq6oFSbjOKB9B27WUZQUyZ4MywA= github.com/metal-stack/v v1.0.3 h1:Sh2oBlnxrCUD+mVpzfC8HiqL045YWkxs0gpTvkjppqs= @@ -131,12 +131,12 @@ golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= -google.golang.org/genproto/googleapis/api v0.0.0-20260622175928-b703f567277d h1:xr2lwHI91bn3UiXcnyzRMQjp2LRiM8wEHzwUaE0YhTs= -google.golang.org/genproto/googleapis/api v0.0.0-20260622175928-b703f567277d/go.mod h1:O0ZOWSrfWfJ+Z5HbwZ+wNtHsg/vk1k2C/w67eww8PfQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d h1:mpAgMyM9vQHxycBlDq50y1VHpfSfVwzXvrQKtYbXuUY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.81.1 h1:VnnIIZ88UzOOKLukQi+ImGz8O1Wdp8nAGGnvOfEIWQQ= -google.golang.org/grpc v1.81.1/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= +google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 h1:jQ9p21COKWjP3VwuFrNRiiOTMh3mPpN45R7SLrH/HUU= +google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7/go.mod h1:KqHwBx2upmfa1XSi1WuRvC+2VGCLtooKkfmyvRbUmqA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 h1:eM/YSd5bBFagF51o1E745Ta7RwzpW0h+z+QDNZOgmQ8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.82.0 h1:vguDnZUPjE26w09A63VoxZPnvPjB5Riyc0mkXPFmAIU= +google.golang.org/grpc v1.82.0/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pkg/helpers/errors.go b/pkg/helpers/errors.go deleted file mode 100644 index 813c1da..0000000 --- a/pkg/helpers/errors.go +++ /dev/null @@ -1,15 +0,0 @@ -package helpers - -import ( - "errors" - - "connectrpc.com/connect" -) - -func IsAlreadyExists(err error) bool { - if connectErr, ok := errors.AsType[*connect.Error](err); ok && connectErr.Code() == connect.CodeAlreadyExists { - return true - } - - return false -} From ab626e61253c633b0e455e69b7ae0971ce9def34 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Wed, 8 Jul 2026 09:55:39 +0200 Subject: [PATCH 4/4] Respect Env var. --- cmd/config/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/config/config.go b/cmd/config/config.go index 12cfe1f..a5b9017 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -101,14 +101,14 @@ func (c *Config) GetTenant() (string, error) { } func (c *Config) GetToken() string { - if viper.IsSet("api-token") { + if viper.GetString("api-token") != "" { return viper.GetString("api-token") } return c.Context.Token } func (c *Config) GetApiURL() string { - if viper.IsSet("api-url") { + if viper.GetString("api-url") != "" { return viper.GetString("api-url") } if c.Context.ApiURL != nil { @@ -120,7 +120,7 @@ func (c *Config) GetApiURL() string { } func (c *Config) GetProvider() string { - if viper.IsSet("provider") { + if viper.GetString("provider") != "" { return viper.GetString("provider") } return c.Context.Provider