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
14 changes: 7 additions & 7 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,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'
cache: false
Expand Down Expand Up @@ -58,10 +58,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 @@ -80,19 +80,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: ${{ github.actor }}
password: ${{ secrets.GITHUB_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
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
- uses: release-drafter/release-drafter@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM alpine:3.23
FROM alpine:3.24
COPY bin/metal-linux-amd64 /metal
ENTRYPOINT ["/metal"]
16 changes: 8 additions & 8 deletions cmd/api/v1/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ func (c *project) Delete(id string) (*apiv1.Project, error) {

func (c *project) Convert(r *apiv1.Project) (string, *apiv1.ProjectServiceCreateRequest, *apiv1.ProjectServiceUpdateRequest, error) {
return r.Uuid, &apiv1.ProjectServiceCreateRequest{
Login: r.Tenant,
Name: r.Name,
Description: r.Description,
}, &apiv1.ProjectServiceUpdateRequest{
Project: r.Uuid,
Name: new(r.Name),
Description: new(r.Description),
}, nil
Login: r.Tenant,
Name: r.Name,
Description: r.Description,
}, &apiv1.ProjectServiceUpdateRequest{
Project: r.Uuid,
Name: new(r.Name),
Description: new(r.Description),
}, nil
}

func (c *project) Update(rq *apiv1.ProjectServiceUpdateRequest) (*apiv1.Project, error) {
Expand Down
26 changes: 13 additions & 13 deletions cmd/api/v1/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,17 @@ func (c *token) Update(rq *apiv1.TokenServiceUpdateRequest) (*apiv1.Token, error

func (c *token) Convert(r *apiv1.Token) (string, *apiv1.TokenServiceCreateRequest, *apiv1.TokenServiceUpdateRequest, error) {
return r.Uuid, &apiv1.TokenServiceCreateRequest{
Description: r.GetDescription(),
Permissions: r.GetPermissions(),
ProjectRoles: r.GetProjectRoles(),
TenantRoles: r.GetTenantRoles(),
Expires: durationpb.New(time.Until(r.GetExpires().AsTime())),
}, &apiv1.TokenServiceUpdateRequest{
Uuid: r.Uuid,
Description: pointer.PointerOrNil(r.Description),
Permissions: r.Permissions,
ProjectRoles: r.ProjectRoles,
TenantRoles: r.TenantRoles,
AdminRole: r.AdminRole,
}, nil
Description: r.GetDescription(),
Permissions: r.GetPermissions(),
ProjectRoles: r.GetProjectRoles(),
TenantRoles: r.GetTenantRoles(),
Expires: durationpb.New(time.Until(r.GetExpires().AsTime())),
}, &apiv1.TokenServiceUpdateRequest{
Uuid: r.Uuid,
Description: pointer.PointerOrNil(r.Description),
Permissions: r.Permissions,
ProjectRoles: r.ProjectRoles,
TenantRoles: r.TenantRoles,
AdminRole: r.AdminRole,
}, nil
}
15 changes: 6 additions & 9 deletions cmd/api/v1/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/spf13/viper"

corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
)

Expand Down Expand Up @@ -194,8 +193,8 @@ func (c *volume) volumeManifest(args []string) error {

filesystem := corev1.PersistentVolumeFilesystem
pv := corev1.PersistentVolume{
TypeMeta: v1.TypeMeta{Kind: "PersistentVolume", APIVersion: "v1"},
ObjectMeta: v1.ObjectMeta{Name: name, Namespace: namespace},
Kind: "PersistentVolume", APIVersion: "v1",
Name: name, Namespace: namespace,
Spec: corev1.PersistentVolumeSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
VolumeMode: &filesystem,
Expand Down Expand Up @@ -231,12 +230,10 @@ func (v *volume) volumeEncryptionSecretManifest() error {
namespace := viper.GetString("namespace")
passphrase := viper.GetString("passphrase")
secret := corev1.Secret{
TypeMeta: v1.TypeMeta{Kind: "Secret", APIVersion: "v1"},
ObjectMeta: v1.ObjectMeta{
Name: "storage-encryption-key",
Namespace: namespace,
},
Type: corev1.SecretTypeOpaque,
Kind: "Secret", APIVersion: "v1",
Name: "storage-encryption-key",
Namespace: namespace,
Type: corev1.SecretTypeOpaque,
StringData: map[string]string{
"host-encryption-passphrase": passphrase,
},
Expand Down
6 changes: 2 additions & 4 deletions cmd/kubernetes/execconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ func (ec *ExecCache) ExecConfig(clusterid string, kubeRaw string, exp time.Durat
ai := kubeconfig.AuthInfos[0]
expiration := metav1.NewTime(time.Now().Add(exp))
ed := c.ExecCredential{
TypeMeta: metav1.TypeMeta{
APIVersion: "client.authentication.k8s.io/v1", // since k8s 1.24, if earlier versions are used, the API version is client.authentication.k8s.io/v1beta1
Kind: "ExecCredential",
},
APIVersion: "client.authentication.k8s.io/v1", // since k8s 1.24, if earlier versions are used, the API version is client.authentication.k8s.io/v1beta1
Kind: "ExecCredential",
Status: &c.ExecCredentialStatus{
ClientCertificateData: string(ai.AuthInfo.ClientCertificateData),
ClientKeyData: string(ai.AuthInfo.ClientKeyData),
Expand Down
7 changes: 2 additions & 5 deletions cmd/kubernetes/execconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

"github.com/spf13/afero"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
c "k8s.io/client-go/pkg/apis/clientauthentication/v1"
)

Expand Down Expand Up @@ -108,10 +107,8 @@ func TestExecCache_ExecConfig(t *testing.T) {
},
wantErr: false,
want: &c.ExecCredential{
TypeMeta: metav1.TypeMeta{
Kind: "ExecCredential",
APIVersion: "client.authentication.k8s.io/v1",
},
Kind: "ExecCredential",
APIVersion: "client.authentication.k8s.io/v1",
Spec: c.ExecCredentialSpec{
Interactive: false,
},
Expand Down
Loading