Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/hashicorp/v…
Browse files Browse the repository at this point in the history
…ault/api-1.13.0
  • Loading branch information
jonasvinther committed May 27, 2024
2 parents e4aa052 + 6d2665c commit e7c4e0a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,3 @@ jobs:
- name: Go Report update
if: ${{ github.repository == 'jonasvinther/medusa' }}
run: "curl -X POST -F \"repo=github.com/$GITHUB_REPOSITORY\" https://goreportcard.com/checks"

- name: Run codecov
run: go test -race -covermode=atomic -v ./... -coverprofile=coverage.txt

- name: Upload coverage to Codecov
if: success() && ${{ github.repository == 'jonasvinther/medusa' }}
uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
token: ${{secrets.CODECOV}}
fail_ci_if_error: true
14 changes: 11 additions & 3 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,21 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ env.TAG }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM golang:alpine AS builder
FROM --platform=$BUILDPLATFORM golang:alpine AS builder
ARG VERSION
ARG TARGETARCH

RUN apk update && apk add --no-cache git

Expand All @@ -10,7 +12,9 @@ ADD . .

RUN go mod download
RUN go get -d -v
RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/medusa
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build \
-ldflags="-X 'github.com/jonasvinther/medusa/cmd.Version=${VERSION}'" \
-o /go/bin/medusa

RUN adduser -S scratchuser
RUN chown scratchuser /go/bin/medusa
Expand All @@ -19,4 +23,4 @@ FROM scratch
COPY --from=builder /go/bin/medusa /medusa
COPY --from=builder /etc/passwd /etc/passwd
USER scratchuser
ENTRYPOINT ["/medusa"]
ENTRYPOINT ["/medusa"]
4 changes: 3 additions & 1 deletion pkg/vaultengine/vaultclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func NewClient(addr, token string, insecure bool, namespace string, role string,
authPath: authPath,
}

client.newVaultClient()
if err := client.newVaultClient(); err != nil {
panic(err)
}

return client
}
Expand Down

0 comments on commit e7c4e0a

Please sign in to comment.