Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to metal-go v0.39.2. #268

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions cmd/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ func newPartitionCmd(c *config) *cobra.Command {

partitionCapacityCmd.Flags().StringP("id", "", "", "filter on partition id. [optional]")
partitionCapacityCmd.Flags().StringP("size", "", "", "filter on size id. [optional]")
partitionCapacityCmd.Flags().StringP("project-id", "", "", "consider project-specific counts, e.g. size reservations. [optional]")
partitionCapacityCmd.Flags().StringSlice("sort-by", []string{}, fmt.Sprintf("order by (comma separated) column(s), sort direction can be changed by appending :asc or :desc behind the column identifier. possible values: %s", strings.Join(sorters.PartitionCapacitySorter().AvailableKeys(), "|")))
genericcli.Must(partitionCapacityCmd.RegisterFlagCompletionFunc("id", c.comp.PartitionListCompletion))
genericcli.Must(partitionCapacityCmd.RegisterFlagCompletionFunc("project-id", c.comp.ProjectListCompletion))
genericcli.Must(partitionCapacityCmd.RegisterFlagCompletionFunc("size", c.comp.SizeListCompletion))
genericcli.Must(partitionCapacityCmd.RegisterFlagCompletionFunc("sort-by", cobra.FixedCompletions(sorters.PartitionCapacitySorter().AvailableKeys(), cobra.ShellCompDirectiveNoFileComp)))

Expand Down Expand Up @@ -161,8 +163,9 @@ func partitionResponseToUpdate(r *models.V1PartitionResponse) *models.V1Partitio

func (c *partitionCmd) partitionCapacity() error {
resp, err := c.client.Partition().PartitionCapacity(partition.NewPartitionCapacityParams().WithBody(&models.V1PartitionCapacityRequest{
ID: viper.GetString("id"),
Sizeid: viper.GetString("size"),
ID: viper.GetString("id"),
Sizeid: viper.GetString("size"),
Projectid: pointer.PointerOrNil(viper.GetString("project-id")),
}), nil)
if err != nil {
return err
Expand Down
7 changes: 4 additions & 3 deletions cmd/partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,16 @@ Total 1 3 0 2 | 5
{
name: "capacity with filters",
cmd: func(want []*models.V1PartitionCapacity) []string {
args := []string{"partition", "capacity", "--id", "1", "--size", "size-1"}
args := []string{"partition", "capacity", "--id", "1", "--size", "size-1", "--project-id", "123"}
assertExhaustiveArgs(t, args, "sort-by")
return args
},
mocks: &client.MetalMockFns{
Partition: func(mock *mock.Mock) {
mock.On("PartitionCapacity", testcommon.MatchIgnoreContext(t, partition.NewPartitionCapacityParams().WithBody(&models.V1PartitionCapacityRequest{
ID: "1",
Sizeid: "size-1",
ID: "1",
Sizeid: "size-1",
Projectid: pointer.Pointer("123"),
})), nil).Return(&partition.PartitionCapacityOK{
Payload: []*models.V1PartitionCapacity{
{
Expand Down
9 changes: 5 additions & 4 deletions docs/metalctl_partition_capacity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ metalctl partition capacity [flags]
### Options

```
-h, --help help for capacity
--id string filter on partition id. [optional]
--size string filter on size id. [optional]
--sort-by strings order by (comma separated) column(s), sort direction can be changed by appending :asc or :desc behind the column identifier. possible values: description|id|name
-h, --help help for capacity
--id string filter on partition id. [optional]
--project-id string consider project-specific counts, e.g. size reservations. [optional]
--size string filter on size id. [optional]
--sort-by strings order by (comma separated) column(s), sort direction can be changed by appending :asc or :desc behind the column identifier. possible values: description|id|name
```

### Options inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/go-openapi/strfmt v0.23.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/metal-stack/metal-go v0.39.1
github.com/metal-stack/metal-go v0.39.2
github.com/metal-stack/metal-lib v0.19.0
github.com/metal-stack/updater v1.2.2
github.com/metal-stack/v v1.0.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ github.com/mdlayher/sdnotify v1.0.0 h1:Ma9XeLVN/l0qpyx1tNeMSeTjCPH6NtuD6/N9XdTlQ
github.com/mdlayher/sdnotify v1.0.0/go.mod h1:HQUmpM4XgYkhDLtd+Uad8ZFK1T9D5+pNxnXQjCeJlGE=
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
github.com/metal-stack/metal-go v0.39.1 h1:oarRe7KbcvsOfjCLbXwlVVHJfX5AMlWxoCQrRpmbdrA=
github.com/metal-stack/metal-go v0.39.1/go.mod h1:ltItf/Md/z588c7Dr3X6iemCeOFh3rJ8nDL5Dpb9zFQ=
github.com/metal-stack/metal-go v0.39.2 h1:E2iZ8f7Qo/z2ClbtICYu4iKn91zFv0RonFmuPlbC6tk=
github.com/metal-stack/metal-go v0.39.2/go.mod h1:ltItf/Md/z588c7Dr3X6iemCeOFh3rJ8nDL5Dpb9zFQ=
github.com/metal-stack/metal-lib v0.19.0 h1:4yBnp/jPGgX9KeCje3A4MFL2oDjgjOjgsIK391LltRI=
github.com/metal-stack/metal-lib v0.19.0/go.mod h1:fCMaWwVGA/xAoGvBk72/nfzqBkHly0iOzrWpc55Fau4=
github.com/metal-stack/security v0.9.0 h1:FYBXJfNJwUw2E0HBa+jay37XF7b6EikEuf4Mw8u04EY=
Expand Down
Loading