From 80419d8ab46d2d76f4feac35ed9d639b170185a2 Mon Sep 17 00:00:00 2001 From: Alexei Ledenev Date: Wed, 6 Sep 2023 12:30:21 +0300 Subject: [PATCH] fix multi-arch build --- .github/workflows/github-release.yaml | 2 +- .github/workflows/test.yaml | 2 +- Dockerfile | 2 +- go.mod | 2 +- pkg/secrets/aws/secrets.go | 3 ++- pkg/secrets/aws/secrets_test.go | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github-release.yaml b/.github/workflows/github-release.yaml index 0c7a06d..7f91c7a 100644 --- a/.github/workflows/github-release.yaml +++ b/.github/workflows/github-release.yaml @@ -20,7 +20,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: '>=1.19.0' + go-version: '>=1.21.0' - name: Cross-Platform build run: | diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index efc4700..0128692 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,7 +25,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: '>=1.19.0' + go-version: '>=1.21.0' - name: Lint run: | diff --git a/Dockerfile b/Dockerfile index 7676838..151f21d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:experimental -FROM --platform=${BUILDPLATFORM} golang:1.19-alpine as builder +FROM --platform=${BUILDPLATFORM} golang:1.21-alpine as builder # passed by buildkit ARG TARGETOS ARG TARGETARCH diff --git a/go.mod b/go.mod index 745bb05..713bf3c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module secrets-init -go 1.19 +go 1.21 require ( cloud.google.com/go/compute v1.10.0 diff --git a/pkg/secrets/aws/secrets.go b/pkg/secrets/aws/secrets.go index 310458d..28cb6c6 100644 --- a/pkg/secrets/aws/secrets.go +++ b/pkg/secrets/aws/secrets.go @@ -3,6 +3,7 @@ package aws import ( "context" "encoding/json" + "sort" "strings" "secrets-init/pkg/secrets" //nolint:gci @@ -96,7 +97,7 @@ func (sp *SecretsProvider) ResolveSecrets(_ context.Context, vars []string) ([]s } envs = append(envs, env) } - + sort.Strings(envs) return envs, nil } diff --git a/pkg/secrets/aws/secrets_test.go b/pkg/secrets/aws/secrets_test.go index 96b66a6..1a60bd3 100644 --- a/pkg/secrets/aws/secrets_test.go +++ b/pkg/secrets/aws/secrets_test.go @@ -48,8 +48,8 @@ func TestSecretsProvider_ResolveSecrets(t *testing.T) { "test-secret-2=arn:aws:secretsmanager:87654321", }, want: []string{ - "test-secret-1=test-secret-value-1", "non-secret=hello", + "test-secret-1=test-secret-value-1", "test-secret-2=test-secret-value-2", }, mockServiceProvider: func(mockSM *mocks.SecretsManagerAPI, mockSSM *mocks.SSMAPI) secrets.Provider {