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
10 changes: 5 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Setup Go
uses: actions/setup-go@v6
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'

Expand All @@ -67,19 +67,19 @@ jobs:
make cli GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }}

- name: Log in to the container registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
if: ${{ matrix.os == 'linux' && matrix.arch == 'amd64' }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4
if: ${{ matrix.os == 'linux' && matrix.arch == 'amd64' }}

- name: Build and push image
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: .
push: true
Expand Down
30 changes: 15 additions & 15 deletions cmd/admin/v2/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,27 +214,27 @@ func (c *image) List() ([]*apiv2.Image, error) {

func (c *image) Convert(r *apiv2.Image) (string, *adminv2.ImageServiceCreateRequest, *adminv2.ImageServiceUpdateRequest, error) {
return r.Id, &adminv2.ImageServiceCreateRequest{
Image: &apiv2.Image{
Id: r.Id,
Url: r.Url,
Name: r.Name,
Description: r.Description,
Features: r.Features,
Meta: r.Meta,
Classification: r.Classification,
ExpiresAt: r.ExpiresAt,
},
}, &adminv2.ImageServiceUpdateRequest{
UpdateMeta: helpers.UpdateMetaFromMeta(r.Meta),
Labels: helpers.UpdateLabelsFromMeta(r.Meta),
Image: &apiv2.Image{
Id: r.Id,
Url: &r.Url,
Url: r.Url,
Name: r.Name,
Description: r.Description,
Features: r.Features,
Meta: r.Meta,
Classification: r.Classification,
ExpiresAt: r.ExpiresAt,
}, nil
},
}, &adminv2.ImageServiceUpdateRequest{
UpdateMeta: helpers.UpdateMetaFromMeta(r.Meta),
Labels: helpers.UpdateLabelsFromMeta(r.Meta),
Id: r.Id,
Url: &r.Url,
Name: r.Name,
Description: r.Description,
Features: r.Features,
Classification: r.Classification,
ExpiresAt: r.ExpiresAt,
}, nil
}

func (c *image) Update(rq *adminv2.ImageServiceUpdateRequest) (*apiv2.Image, error) {
Expand Down
44 changes: 22 additions & 22 deletions cmd/admin/v2/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,31 +228,31 @@ func (t *token) Convert(r *apiv2.Token) (string, *adminv2.TokenServiceCreateRequ
}

return r.Uuid, &adminv2.TokenServiceCreateRequest{
User: &r.User,
TokenCreateRequest: &apiv2.TokenServiceCreateRequest{
Description: r.GetDescription(),
Permissions: perms,
ProjectRoles: r.GetProjectRoles(),
TenantRoles: r.GetTenantRoles(),
Expires: durationpb.New(time.Until(r.GetExpires().AsTime())),
Labels: pointer.SafeDeref(r.Meta).Labels,
},
}, &apiv2.TokenServiceUpdateRequest{
Uuid: r.Uuid,
Description: pointer.PointerOrNil(r.Description),
User: &r.User,
TokenCreateRequest: &apiv2.TokenServiceCreateRequest{
Description: r.GetDescription(),
Permissions: perms,
ProjectRoles: r.ProjectRoles,
TenantRoles: r.TenantRoles,
AdminRole: r.AdminRole,
Labels: &apiv2.UpdateLabels{
Strategy: &apiv2.UpdateLabels_Replace{
Replace: &apiv2.Labels{
Labels: pointer.SafeDeref(pointer.SafeDeref(r.Meta).Labels).Labels,
},
ProjectRoles: r.GetProjectRoles(),
TenantRoles: r.GetTenantRoles(),
Expires: durationpb.New(time.Until(r.GetExpires().AsTime())),
Labels: pointer.SafeDeref(r.Meta).Labels,
},
}, &apiv2.TokenServiceUpdateRequest{
Uuid: r.Uuid,
Description: pointer.PointerOrNil(r.Description),
Permissions: perms,
ProjectRoles: r.ProjectRoles,
TenantRoles: r.TenantRoles,
AdminRole: r.AdminRole,
Labels: &apiv2.UpdateLabels{
Strategy: &apiv2.UpdateLabels_Replace{
Replace: &apiv2.Labels{
Labels: pointer.SafeDeref(pointer.SafeDeref(r.Meta).Labels).Labels,
},
},
UpdateMeta: helpers.UpdateMetaFromMeta(r.Meta),
}, nil
},
UpdateMeta: helpers.UpdateMetaFromMeta(r.Meta),
}, nil
}

func (t *token) Update(rq *apiv2.TokenServiceUpdateRequest) (*apiv2.Token, error) {
Expand Down
16 changes: 8 additions & 8 deletions cmd/api/v2/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ func (c *project) Delete(id string) (*apiv2.Project, error) {

func (c *project) Convert(r *apiv2.Project) (string, *apiv2.ProjectServiceCreateRequest, *apiv2.ProjectServiceUpdateRequest, error) {
return r.Uuid, &apiv2.ProjectServiceCreateRequest{
Login: r.Tenant,
Name: r.Name,
Description: r.Description,
}, &apiv2.ProjectServiceUpdateRequest{
Project: r.Uuid,
Name: new(r.Name),
Description: new(r.Description),
}, nil
Login: r.Tenant,
Comment thread
majst01 marked this conversation as resolved.
Name: r.Name,
Description: r.Description,
}, &apiv2.ProjectServiceUpdateRequest{
Project: r.Uuid,
Name: new(r.Name),
Description: new(r.Description),
}, nil
}

func (c *project) Update(rq *apiv2.ProjectServiceUpdateRequest) (*apiv2.Project, error) {
Expand Down
32 changes: 16 additions & 16 deletions cmd/api/v2/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,20 @@ func (c *token) Convert(r *apiv2.Token) (string, *apiv2.TokenServiceCreateReques
}

return r.Uuid, &apiv2.TokenServiceCreateRequest{
Description: r.GetDescription(),
Permissions: perms,
ProjectRoles: r.GetProjectRoles(),
TenantRoles: r.GetTenantRoles(),
Expires: durationpb.New(time.Until(r.GetExpires().AsTime())),
Labels: pointer.SafeDeref(r.Meta).Labels,
}, &apiv2.TokenServiceUpdateRequest{
Uuid: r.Uuid,
Description: pointer.PointerOrNil(r.Description),
Permissions: perms,
ProjectRoles: r.ProjectRoles,
TenantRoles: r.TenantRoles,
AdminRole: r.AdminRole,
Labels: helpers.UpdateLabelsFromMeta(r.Meta),
UpdateMeta: helpers.UpdateMetaFromMeta(r.Meta),
}, nil
Description: r.GetDescription(),
Permissions: perms,
ProjectRoles: r.GetProjectRoles(),
TenantRoles: r.GetTenantRoles(),
Expires: durationpb.New(time.Until(r.GetExpires().AsTime())),
Labels: pointer.SafeDeref(r.Meta).Labels,
}, &apiv2.TokenServiceUpdateRequest{
Uuid: r.Uuid,
Description: pointer.PointerOrNil(r.Description),
Permissions: perms,
ProjectRoles: r.ProjectRoles,
TenantRoles: r.TenantRoles,
AdminRole: r.AdminRole,
Labels: helpers.UpdateLabelsFromMeta(r.Meta),
UpdateMeta: helpers.UpdateMetaFromMeta(r.Meta),
}, nil
}
30 changes: 15 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/metal-stack/cli

go 1.26.5
go 1.27

require (
connectrpc.com/connect v1.20.0
Expand All @@ -9,20 +9,20 @@ 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.5.0
github.com/metal-stack/api v0.5.1
github.com/metal-stack/metal-lib v0.26.3
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.12.0
google.golang.org/grpc v1.83.0
github.com/stretchr/testify v1.12.1
google.golang.org/grpc v1.83.2
google.golang.org/protobuf v1.36.12
sigs.k8s.io/yaml v1.6.0
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260709200747-435963d16310.1 // indirect
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.1 // indirect
buf.build/go/protovalidate v1.3.0 // indirect
buf.build/go/protoyaml v0.7.0 // indirect
cel.dev/expr v0.25.3 // indirect
Expand All @@ -36,12 +36,12 @@ require (
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/coder/websocket v1.8.15 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/creachadair/msync v0.10.0 // indirect
github.com/creachadair/msync v0.10.1 // indirect
github.com/dblohm7/wingoes v0.0.0-20260526185140-fb298caac7ca // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
github.com/fxamacker/cbor/v2 v2.9.3 // indirect
github.com/gaissmai/bart v0.29.0 // indirect
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 // indirect
github.com/go-openapi/errors v0.22.8 // indirect
github.com/go-openapi/strfmt v0.27.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
Expand All @@ -61,7 +61,7 @@ require (
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.24 // indirect
github.com/mattn/go-runewidth v0.0.27 // indirect
github.com/mattn/go-runewidth v0.0.28 // indirect
github.com/mdlayher/netlink v1.11.2 // indirect
github.com/mdlayher/socket v0.6.1 // indirect
github.com/minio/minlz v1.2.0 // indirect
Expand Down Expand Up @@ -90,9 +90,9 @@ require (
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
go4.org/netipx v0.0.0-20260823151212-3075585bcbeb // indirect
golang.org/x/crypto v0.55.0 // indirect
golang.org/x/exp v0.0.0-20260813180055-c1d0aacb2297 // indirect
golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa // indirect
golang.org/x/net v0.58.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.22.0 // indirect
Expand All @@ -102,12 +102,12 @@ require (
golang.org/x/time v0.15.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard/windows v1.0.1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260810153831-ec0a7760b754 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260810153831-ec0a7760b754 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gvisor.dev/gvisor v0.0.0-20260224225140-573d5e7127a8 // indirect
k8s.io/apimachinery v0.36.3 // indirect
k8s.io/apimachinery v0.36.4 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
tailscale.com v1.102.2 // indirect
tailscale.com v1.102.3 // indirect
)
Loading