Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/admin/v2/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/metal-stack/cli/cmd/config"
"github.com/metal-stack/cli/cmd/sorters"
"github.com/metal-stack/cli/cmd/tableprinters"
"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"
Expand Down Expand Up @@ -276,6 +277,7 @@ func (c *switchCmd) Convert(sw *apiv2.Switch) (string, any, *adminv2.SwitchServi
ConsoleCommand: sw.ConsoleCommand,
Nics: sw.Nics,
Os: sw.Os,
UpdateMeta: helpers.UpdateMetaFromMeta(sw.Meta),
}, nil
}

Expand Down
1 change: 1 addition & 0 deletions cmd/api/v2/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ func (c *project) updateRequestFromCLI(args []string) (*apiv2.ProjectServiceUpda
Project: id,
Name: pointer.PointerOrNil(viper.GetString("name")),
Description: pointer.PointerOrNil(viper.GetString("description")),
UpdateMeta: &apiv2.UpdateMeta{LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_SERVER},
}, nil
}

Expand Down
3 changes: 3 additions & 0 deletions cmd/api/v2/project_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ func (c *projectMember) updateRequestFromCLI(args []string) (*apiv2.ProjectMembe
Project: project,
Member: member,
Role: pointer.PointerOrNil(apiv2.ProjectRole(apiv2.ProjectRole_value[viper.GetString("role")])),
UpdateMeta: &apiv2.UpdateMeta{
LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_SERVER,
},
}, nil
}

Expand Down
3 changes: 3 additions & 0 deletions cmd/api/v2/tenant_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ func (c *tenantMember) updateRequestFromCLI(args []string) (*apiv2.TenantMemberS
Login: tenant,
Member: member,
Role: pointer.PointerOrNil(apiv2.TenantRole(apiv2.TenantRole_value[viper.GetString("role")])),
UpdateMeta: &apiv2.UpdateMeta{
LockingStrategy: apiv2.OptimisticLockingStrategy_OPTIMISTIC_LOCKING_STRATEGY_SERVER,
},
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion testing/e2e/test_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ type TestConfig struct {
func NewRootCmd(t *testing.T, c *TestConfig) e2e_test.NewRootCmdFunc {
return func() (*cobra.Command, *bytes.Buffer) {
interceptors := []connect.Interceptor{
client.NewTestInterceptor(t, c.ClientCalls),
validate.NewInterceptor(),
client.NewTestInterceptor(t, c.ClientCalls),
}

cl, err := client.New(&client.DialConfig{
Expand Down
18 changes: 9 additions & 9 deletions tests/e2e/admin/ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func Test_IPCmd_List(t *testing.T) {
}),
WantTable: new(`
IP PROJECT ID NETWORK TYPE NAME ATTACHED SERVICE
4.3.2.1 46bdfc45-9c8d-4268-b359-b40e3079d384 9cef40ec-29c6-4dfa-aee8-47ee1f49223d internet ephemeral b
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 internet static a
4.3.2.1 46bdfc45-9c8d-4268-b359-b40e3079d384 9cef40ec-29c6-4dfa-aee8-47ee1f49223d internet ephemeral bb
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 internet static aa
`),
WantWideTable: new(`
IP PROJECT ID TYPE NAME DESCRIPTION LABELS
4.3.2.1 46bdfc45-9c8d-4268-b359-b40e3079d384 9cef40ec-29c6-4dfa-aee8-47ee1f49223d ephemeral b b description a=b
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 static a a description cluster.metal-stack.io/id/namespace/service=<cluster>/default/ingress-nginx
4.3.2.1 46bdfc45-9c8d-4268-b359-b40e3079d384 9cef40ec-29c6-4dfa-aee8-47ee1f49223d ephemeral bb b description a=b
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 static aa a description cluster.metal-stack.io/id/namespace/service=<cluster>/default/ingress-nginx
`),
Template: new("{{ .ip }} {{ .project }}"),
WantTemplate: new(`
Expand All @@ -52,8 +52,8 @@ func Test_IPCmd_List(t *testing.T) {
WantMarkdown: new(`
| IP | PROJECT | ID | NETWORK | TYPE | NAME | ATTACHED SERVICE |
|---------|--------------------------------------|--------------------------------------|----------|-----------|------|------------------|
| 4.3.2.1 | 46bdfc45-9c8d-4268-b359-b40e3079d384 | 9cef40ec-29c6-4dfa-aee8-47ee1f49223d | internet | ephemeral | b | |
| 1.1.1.1 | ce19a655-7933-4745-8f3e-9592b4a90488 | 2e0144a2-09ef-42b7-b629-4263295db6e8 | internet | static | a | |
| 4.3.2.1 | 46bdfc45-9c8d-4268-b359-b40e3079d384 | 9cef40ec-29c6-4dfa-aee8-47ee1f49223d | internet | ephemeral | bb | |
| 1.1.1.1 | ce19a655-7933-4745-8f3e-9592b4a90488 | 2e0144a2-09ef-42b7-b629-4263295db6e8 | internet | static | aa | |
`),
},
}
Expand Down Expand Up @@ -88,11 +88,11 @@ func Test_IPCmd_Describe(t *testing.T) {
WantProtoObject: testresources.IP1(),
WantTable: new(`
IP PROJECT ID NETWORK TYPE NAME ATTACHED SERVICE
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 internet static a
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 internet static aa
`),
WantWideTable: new(`
IP PROJECT ID TYPE NAME DESCRIPTION LABELS
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 static a a description cluster.metal-stack.io/id/namespace/service=<cluster>/default/ingress-nginx
1.1.1.1 ce19a655-7933-4745-8f3e-9592b4a90488 2e0144a2-09ef-42b7-b629-4263295db6e8 static aa a description cluster.metal-stack.io/id/namespace/service=<cluster>/default/ingress-nginx
`),
Template: new("{{ .ip }} {{ .project }}"),
WantTemplate: new(`
Expand All @@ -101,7 +101,7 @@ func Test_IPCmd_Describe(t *testing.T) {
WantMarkdown: new(`
| IP | PROJECT | ID | NETWORK | TYPE | NAME | ATTACHED SERVICE |
|---------|--------------------------------------|--------------------------------------|----------|--------|------|------------------|
| 1.1.1.1 | ce19a655-7933-4745-8f3e-9592b4a90488 | 2e0144a2-09ef-42b7-b629-4263295db6e8 | internet | static | a | |
| 1.1.1.1 | ce19a655-7933-4745-8f3e-9592b4a90488 | 2e0144a2-09ef-42b7-b629-4263295db6e8 | internet | static | aa | |
`),
},
}
Expand Down
Loading
Loading