Skip to content

Commit

Permalink
Pin and review.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Sep 30, 2024
1 parent e96e505 commit 9c6da5c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
10 changes: 6 additions & 4 deletions cmd/tableprinters/size.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ func (t *TablePrinter) SizeReservationTable(data []*models.V1SizeReservationResp

func (t *TablePrinter) SizeReservationUsageTable(data []*models.V1SizeReservationUsageResponse, wide bool) ([]string, [][]string, error) {
var (
header = []string{"ID", "Size", "Project", "Partition", "Used/Amount", "Project Allocations"}
header = []string{"ID", "Size", "Project", "Partition", "Used/Amount"}
rows [][]string
)

if wide {
header = append(header, "Labels")
header = append(header, "Allocated", "Labels")
}

for _, d := range data {
Expand All @@ -115,13 +115,15 @@ func (t *TablePrinter) SizeReservationUsageTable(data []*models.V1SizeReservatio
pointer.SafeDeref(d.Projectid),
pointer.SafeDeref(d.Partitionid),
fmt.Sprintf("%d/%d", pointer.SafeDeref(d.Usedamount), pointer.SafeDeref(d.Amount)),
strconv.Itoa(int(pointer.SafeDeref(d.Projectallocations))),
}

if wide {
labels := genericcli.MapToLabels(d.Labels)
sort.Strings(labels)
row = append(row, strings.Join(labels, "\n"))
row = append(row,
strconv.Itoa(int(pointer.SafeDeref(d.Projectallocations))),
strings.Join(labels, "\n"),
)
}

rows = append(rows, row)
Expand Down
6 changes: 3 additions & 3 deletions docs/metalctl_machine_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
updates the machine

```
metalctl machine update [flags]
metalctl machine update <id> [flags]
```

### Options
Expand All @@ -18,9 +18,9 @@ metalctl machine update [flags]
$ metalctl machine describe machine-1 -o yaml > machine.yaml
$ vi machine.yaml
$ # either via stdin
$ cat machine.yaml | metalctl machine update -f -
$ cat machine.yaml | metalctl machine update <id> -f -
$ # or via file
$ metalctl machine update -f machine.yaml
$ metalctl machine update <id> -f machine.yaml
the file can also contain multiple documents and perform a bulk operation.
Expand Down
6 changes: 3 additions & 3 deletions docs/metalctl_network_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
updates the network

```
metalctl network update [flags]
metalctl network update <id> [flags]
```

### Options
Expand All @@ -20,9 +20,9 @@ metalctl network update [flags]
$ metalctl network describe network-1 -o yaml > network.yaml
$ vi network.yaml
$ # either via stdin
$ cat network.yaml | metalctl network update -f -
$ cat network.yaml | metalctl network update <id> -f -
$ # or via file
$ metalctl network update -f network.yaml
$ metalctl network update <id> -f network.yaml
the file can also contain multiple documents and perform a bulk operation.
Expand Down
6 changes: 3 additions & 3 deletions docs/metalctl_size_reservation_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
updates the reservation

```
metalctl size reservation update [flags]
metalctl size reservation update <id> [flags]
```

### Options
Expand All @@ -18,9 +18,9 @@ metalctl size reservation update [flags]
$ metalctl reservation describe reservation-1 -o yaml > reservation.yaml
$ vi reservation.yaml
$ # either via stdin
$ cat reservation.yaml | metalctl reservation update -f -
$ cat reservation.yaml | metalctl reservation update <id> -f -
$ # or via file
$ metalctl reservation update -f reservation.yaml
$ metalctl reservation update <id> -f reservation.yaml
the file can also contain multiple documents and perform a bulk operation.
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.35.3-0.20240926084747-24263b1712fc
github.com/metal-stack/metal-go v0.36.0
github.com/metal-stack/metal-lib v0.18.3
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.35.3-0.20240926084747-24263b1712fc h1:QKGuvGFDsjuPp8bbbB7OFa0M8C9FCRnaHpMISLsDEY8=
github.com/metal-stack/metal-go v0.35.3-0.20240926084747-24263b1712fc/go.mod h1:3MJTYCS4YJz8D8oteTKhjpaAKNMMjMKYDrIy9awHGtQ=
github.com/metal-stack/metal-go v0.36.0 h1:U3J3rolrw/uU5J2V982UPoCm23U8/0oq/eq0oXiq81c=
github.com/metal-stack/metal-go v0.36.0/go.mod h1:3MJTYCS4YJz8D8oteTKhjpaAKNMMjMKYDrIy9awHGtQ=
github.com/metal-stack/metal-lib v0.18.3 h1:bovFiJPB9SMvuGLqcXVWz6jFB8HrdzwnCX7TFlen4r0=
github.com/metal-stack/metal-lib v0.18.3/go.mod h1:Ctyi6zaXFr2NVrQZLFsDLnFCzupKnYErTtgRFKAsnbw=
github.com/metal-stack/security v0.8.1 h1:4zmVUxZvDWShVvVIxM3XhIv7pTmPe9DvACRIHW6YTsk=
Expand Down

0 comments on commit 9c6da5c

Please sign in to comment.