-
Notifications
You must be signed in to change notification settings - Fork 10
chore: update dependencies and improve environment setup #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| * @navikt/aura | ||
| * @navikt/nais |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM golang:1.24-alpine AS builder | ||
| FROM golang:1.25-alpine AS builder | ||
|
|
||
| RUN apk add --no-cache git make curl | ||
| ENV GOOS=linux | ||
|
|
@@ -11,12 +11,12 @@ COPY go.sum . | |
| RUN go mod download | ||
| COPY . . | ||
|
|
||
| RUN make kubebuilder | ||
| RUN go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
|
||
| RUN make test | ||
| RUN make deploy-alpine | ||
|
|
||
|
|
||
| FROM alpine:3 | ||
| FROM alpine:3.20 | ||
|
|
||
| WORKDIR /app | ||
| RUN apk add --no-cache ca-certificates | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM golang:1.24-alpine AS builder | ||
| FROM golang:1.25-alpine AS builder | ||
|
|
||
| RUN apk add --no-cache git make curl | ||
| ENV GOOS=linux | ||
|
|
@@ -11,12 +11,12 @@ COPY go.sum . | |
| RUN go mod download | ||
| COPY . . | ||
|
|
||
| RUN make kubebuilder | ||
| RUN go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
|
||
| RUN make test | ||
| RUN make deploy-alpine | ||
|
|
||
|
|
||
| FROM alpine:3 | ||
| FROM alpine:3.20 | ||
|
|
||
| WORKDIR /app | ||
| RUN apk add --no-cache ca-certificates wget | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM golang:1.24-alpine AS builder | ||
| FROM golang:1.25-alpine AS builder | ||
|
|
||
| RUN apk add --no-cache git make curl | ||
| ENV GOOS=linux | ||
|
|
@@ -11,12 +11,12 @@ COPY go.sum . | |
| RUN go mod download | ||
| COPY . . | ||
|
|
||
| RUN make kubebuilder | ||
| RUN go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
|
||
| RUN make test | ||
| RUN make deploy-alpine | ||
|
|
||
|
|
||
| FROM alpine:3 | ||
| FROM alpine:3.20 | ||
|
|
||
| WORKDIR /app | ||
| ENV TZ="Europe/Oslo" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM golang:1.24-alpine AS builder | ||
| FROM golang:1.25-alpine AS builder | ||
|
|
||
| RUN apk add --no-cache git make curl | ||
| ENV GOOS=linux | ||
|
|
@@ -11,12 +11,12 @@ COPY go.sum . | |
| RUN go mod download | ||
| COPY . . | ||
|
|
||
| RUN make kubebuilder | ||
| RUN go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
|
||
| RUN make test | ||
| RUN make deployd-alpine | ||
|
|
||
|
|
||
| FROM alpine:3 | ||
| FROM alpine:3.20 | ||
|
|
||
| WORKDIR /app | ||
| RUN apk add --no-cache ca-certificates | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM golang:1.24-alpine AS builder | ||
| FROM golang:1.25-alpine AS builder | ||
|
|
||
| RUN apk add --no-cache git make curl | ||
| ENV GOOS=linux | ||
|
|
@@ -11,12 +11,12 @@ COPY go.sum . | |
| RUN go mod download | ||
| COPY . . | ||
|
|
||
| RUN make kubebuilder | ||
| RUN go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
|
||
| RUN make test | ||
| RUN make hookd-alpine | ||
|
|
||
|
|
||
| FROM alpine:3 | ||
| FROM alpine:3.20 | ||
|
|
||
| WORKDIR /app | ||
| RUN apk add --no-cache ca-certificates | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,16 +2,17 @@ PROTOC = $(shell which protoc) | |
| PROTOC_GEN_GO = $(shell which protoc-gen-go) | ||
| BUILDTIME = $(shell date "+%s") | ||
| DATE = $(shell date "+%Y-%m-%d") | ||
| K8S_VERSION := 1.27.1 | ||
| K8S_VERSION := 1.33.5 | ||
| LAST_COMMIT = $(shell git rev-parse --short HEAD) | ||
| VERSION ?= $(DATE)-$(LAST_COMMIT) | ||
| LDFLAGS := -X github.com/nais/deploy/pkg/version.Revision=$(LAST_COMMIT) -X github.com/nais/deploy/pkg/version.Date=$(DATE) -X github.com/nais/deploy/pkg/version.BuildUnixTime=$(BUILDTIME) | ||
| arch := $(shell uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) | ||
| os := $(shell uname -s | tr '[:upper:]' '[:lower:]') | ||
| testbin_dir := ./.testbin/ | ||
| tools_archive := kubebuilder-tools-${K8S_VERSION}-$(os)-$(arch).tar.gz | ||
| SETUP_ENVTEST := $(shell command -v setup-envtest 2>/dev/null || command -v $(shell go env GOPATH)/bin/setup-envtest 2>/dev/null) | ||
|
|
||
| .PHONY: all proto hookd deployd token-generator deploy alpine test docker upload deploy-alpine hookd-alpine deployd-alpine | ||
| .PHONY: all proto hookd deployd token-generator deploy alpine test docker upload deploy-alpine hookd-alpine deployd-alpine envtest-info | ||
|
|
||
| all: hookd deployd deploy | ||
|
|
||
|
|
@@ -63,8 +64,18 @@ alpine: | |
| go build -a -installsuffix cgo -o bin/deployd -ldflags "-s $(LDFLAGS)" cmd/deployd/main.go | ||
| go build -a -installsuffix cgo -o bin/deploy -ldflags "-s $(LDFLAGS)" cmd/deploy/main.go | ||
|
|
||
| test: kubebuilder | ||
| go test ./... -count=1 | ||
| test: | ||
| @if [ -n "$(SETUP_ENVTEST)" ]; then \ | ||
| ASSETS=$$($(SETUP_ENVTEST) use -p path); \ | ||
| echo "Using envtest assets: $$ASSETS"; \ | ||
| export KUBEBUILDER_ASSETS=$$ASSETS; \ | ||
| go test ./... -count=1; \ | ||
| else \ | ||
| echo "setup-envtest not found; falling back to kubebuilder tools download"; \ | ||
| $(MAKE) kubebuilder; \ | ||
| export KUBEBUILDER_ASSETS=$(testbin_dir); \ | ||
|
||
| go test ./... -count=1; \ | ||
| fi | ||
|
|
||
| migration: | ||
| go generate ./... | ||
|
|
@@ -75,7 +86,7 @@ kubebuilder: $(testbin_dir)/$(tools_archive) | |
|
|
||
| $(testbin_dir)/$(tools_archive): | ||
| mkdir -p $(testbin_dir) | ||
| curl -L -O --output-dir $(testbin_dir) "https://storage.googleapis.com/kubebuilder-tools/$(tools_archive)" | ||
| curl -fL --output $(testbin_dir)/$(tools_archive) "https://storage.googleapis.com/kubebuilder-tools/$(tools_archive)" | ||
ybelMekk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| check: | ||
| go run honnef.co/go/tools/cmd/staticcheck ./... | ||
|
|
@@ -88,3 +99,16 @@ hookd-alpine: | |
|
|
||
| deploy-alpine: | ||
| go build -a -installsuffix cgo -o bin/deploy -ldflags "-s $(LDFLAGS)" ./cmd/deploy/ | ||
|
|
||
| envtest-info: | ||
| @echo "setup-envtest (PATH): $$(command -v setup-envtest || true)" | ||
| @echo "setup-envtest (GOPATH/bin): $$(command -v $(shell go env GOPATH)/bin/setup-envtest || true)" | ||
| @echo "GOPATH: $$(go env GOPATH)" | ||
| @echo "KUBEBUILDER_ASSETS (env): $${KUBEBUILDER_ASSETS:-<unset>}" | ||
| @if [ -n "$(SETUP_ENVTEST)" ]; then \ | ||
| ASSETS=$$($(SETUP_ENVTEST) use -p path); \ | ||
| echo "envtest assets: $$ASSETS"; \ | ||
| ls -la "$$ASSETS"; \ | ||
| else \ | ||
| echo "setup-envtest not found"; \ | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [tools] | ||
| go = "1.25.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent commit hash used for actions/checkout@v4. This file uses commit hash 34e114876b0b11c390a56381ad16ebd13914f8d5, while other workflow files use de0fac2e4500dabe0009e67214ff5f5447ce83dd for v6. If the intention is to update to the same version, the commit hashes should match. If this is intentionally kept at v4 while others use v6, please clarify why.