Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
48b508e
Improvements on test framework.
Gerrit91 Mar 18, 2026
65a0496
Add full output format coverage and tests for project, tenant, token,…
chbmuc Mar 18, 2026
3f588be
Move into e2e package.
Gerrit91 Mar 18, 2026
f66177d
Also add raw outputs with same approach.
Gerrit91 Mar 18, 2026
ed89dae
Refactor again.
Gerrit91 Mar 19, 2026
48383c0
Fix.
Gerrit91 Mar 19, 2026
ae57709
Fixes and run in time bubble.
Gerrit91 Mar 19, 2026
ef7eb2b
Make exhaustive work again.
Gerrit91 Mar 19, 2026
f92b62d
Test for interceptor.
Gerrit91 Mar 19, 2026
85c3b24
Support multiple client calls.
Gerrit91 Mar 19, 2026
33c0931
More tests and fixes.
Gerrit91 Mar 19, 2026
53a4c91
Move things around.
Gerrit91 Mar 19, 2026
27401af
Add yaml/json output format coverage to image describe test
chbmuc Mar 19, 2026
896672e
Add token list test
chbmuc Mar 19, 2026
983460a
Add tenant list test
chbmuc Mar 19, 2026
b05b65e
Add project create, delete, update tests with from-file variants.
chbmuc Mar 19, 2026
a912333
Add admin tenant list test
chbmuc Mar 19, 2026
ea373a6
Add admin tenant create test
chbmuc Mar 19, 2026
1266b22
Add admin token list test
chbmuc Mar 19, 2026
b7e248a
Add admin token delete test
chbmuc Mar 19, 2026
a151c8b
Add admin project list test
chbmuc Mar 19, 2026
4490717
Add admin component describe test
chbmuc Mar 19, 2026
4b95c44
Add admin component list test
chbmuc Mar 19, 2026
f658e45
Add admin component delete test
chbmuc Mar 19, 2026
02badc7
Add admin switch describe test
chbmuc Mar 19, 2026
d5c3bdb
Add admin switch list test
chbmuc Mar 19, 2026
a4e9a70
Add admin switch delete test
chbmuc Mar 19, 2026
9353f7c
Refactor.
Gerrit91 Mar 19, 2026
8b1e31d
Naming.
Gerrit91 Mar 19, 2026
ed7ba45
Remove coupons.
Gerrit91 Mar 19, 2026
964f804
One more test.
Gerrit91 Mar 20, 2026
55f8a65
Helper func.
Gerrit91 Mar 20, 2026
8a97c27
Review.
Gerrit91 Mar 20, 2026
38ed827
Move stuff around.
Gerrit91 Mar 20, 2026
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
5 changes: 0 additions & 5 deletions cmd/api/v2/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ func newImageCmd(c *config.Config) *cobra.Command {
DescribePrinter: func() printers.Printer { return c.DescribePrinter },
ListPrinter: func() printers.Printer { return c.ListPrinter },
OnlyCmds: genericcli.OnlyCmds(genericcli.DescribeCmd, genericcli.ListCmd),
DescribeCmdMutateFn: func(cmd *cobra.Command) {
cmd.RunE = func(cmd *cobra.Command, args []string) error {
return gcli.DescribeAndPrint("", w.c.DescribePrinter)
}
},
ListCmdMutateFn: func(cmd *cobra.Command) {
cmd.Flags().StringP("id", "", "", "image id to filter for")
cmd.Flags().StringP("os", "", "", "image os to filter for")
Expand Down
14 changes: 10 additions & 4 deletions cmd/api/v2/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"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"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -69,9 +70,9 @@ func newIPCmd(c *config.Config) *cobra.Command {
CreateRequestFromCLI: func() (*apiv2.IPServiceCreateRequest, error) {
return &apiv2.IPServiceCreateRequest{
Project: c.GetProject(),
Name: new(viper.GetString("name")),
Description: new(viper.GetString("description")),
Network: viper.GetString("network"),
Name: pointer.PointerOrNil(viper.GetString("name")),
Description: pointer.PointerOrNil(viper.GetString("description")),
// Labels: viper.GetStringSlice("tags"), // FIXME implement
Type: new(ipStaticToType(viper.GetBool("static"))),
AddressFamily: addressFamilyToType(viper.GetString("addressfamily")),
Expand Down Expand Up @@ -125,6 +126,10 @@ 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) {
return nil, genericcli.AlreadyExistsError()
}

return nil, err
}

Expand Down Expand Up @@ -199,12 +204,14 @@ func (c *ip) Update(rq *apiv2.IPServiceUpdateRequest) (*apiv2.IP, error) {

func (c *ip) Convert(r *apiv2.IP) (string, *apiv2.IPServiceCreateRequest, *apiv2.IPServiceUpdateRequest, error) {
responseToUpdate, err := c.IpResponseToUpdate(r)
return helpers.EncodeProject(r.Uuid, r.Project), IpResponseToCreate(r), responseToUpdate, err
return helpers.EncodeProject(r.Ip, r.Project), IpResponseToCreate(r), responseToUpdate, err
}

func IpResponseToCreate(r *apiv2.IP) *apiv2.IPServiceCreateRequest {
return &apiv2.IPServiceCreateRequest{
Ip: &r.Ip,
Project: r.Project,
Network: r.Network,
Name: &r.Name,
Description: &r.Description,
Labels: r.Meta.Labels,
Expand All @@ -213,7 +220,6 @@ func IpResponseToCreate(r *apiv2.IP) *apiv2.IPServiceCreateRequest {
}

func (c *ip) IpResponseToUpdate(desired *apiv2.IP) (*apiv2.IPServiceUpdateRequest, error) {

ctx, cancel := c.c.NewRequestContext()
defer cancel()

Expand Down
312 changes: 0 additions & 312 deletions cmd/common_test.go

This file was deleted.

Loading
Loading