Skip to content
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

Golang and dependencies update #443

Merged
merged 4 commits into from
Oct 2, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
file: Dockerfile.controller
push: true
build-args: |
GO_BUILDER_IMG=golang:1.21
GO_BUILDER_IMG=golang:1.22
tags: |
ghcr.io/grafana/k6-operator:${{ github.sha }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
cache: false
- name: lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
push: true
file: Dockerfile.controller
build-args: |
GO_BUILDER_IMG=golang:1.21
GO_BUILDER_IMG=golang:1.22
platforms: linux/amd64,linux/arm64
tags: ghcr.io/grafana/k6-operator:latest,ghcr.io/grafana/k6-operator:controller-${{env.IMAGETAG}}
- name: "Build:dockerimage"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
test:
strategy:
matrix:
go-version: [1.21.x]
k8s_version: [1.19.2, 1.24.1, 1.27.1]
go-version: [1.22.x]
k8s_version: [1.24.1, 1.27.1, 1.30.0]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v4
- name: Test
run: |
make test-setup-ci
make test-setup
make test
env:
ENVTEST_K8S_VERSION: ${{ matrix.k8s_version }}
26 changes: 10 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

CONTROLLER_GEN_VERSION=v0.16.1
CONTROLLER_GEN=$(GOBIN)/controller-gen

# Image to use for building Go
GO_BUILDER_IMG ?= "golang:1.21"
GO_BUILDER_IMG ?= "golang:1.22"
# Image URL to use all building/pushing image targets
IMG_NAME ?= ghcr.io/grafana/k6-operator
IMG_TAG ?= latest
Expand All @@ -30,9 +33,9 @@ endif
all: manager

# Run tests
ENVTEST_VERSION ?= release-0.17
ENVTEST_VERSION ?= latest # ref. https://github.com/kubernetes-sigs/controller-runtime/tree/main/tools/setup-envtest
ENVTEST_ASSETS_DIR = $(shell pwd)/testbin
ENVTEST_K8S_VERSION ?= 1.24.1
ENVTEST_K8S_VERSION ?= 1.30.0
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
KUBEBUILDER_ASSETS_ROOT=/tmp
Expand All @@ -47,12 +50,6 @@ test-setup:
mv kubebuilder $(KUBEBUILDER_ASSETS_ROOT)
export KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS); go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION)

test-setup-ci:
curl -L -O "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-$(ENVTEST_K8S_VERSION)-$(GOOS)-$(GOARCH).tar.gz"
tar -xvf kubebuilder-tools-$(ENVTEST_K8S_VERSION)-$(GOOS)-$(GOARCH).tar.gz
mv kubebuilder $(KUBEBUILDER_ASSETS_ROOT)
export KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS); go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION)

e2e: deploy
kubectl create configmap crocodile-stress-test --from-file e2e/test.js
kubectl apply -f e2e/test.yaml
Expand Down Expand Up @@ -117,15 +114,12 @@ docker-push:
# find or download controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@{ \
set -e ;\
go install sigs.k8s.io/controller-tools/cmd/[email protected] ;\
if ! which $(CONTROLLER_GEN) || [ 'Version $(CONTROLLER_GEN_VERSION)' != "$$($(CONTROLLER_GEN) --version)" ]; then\
set -e ;\
go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) ;\
fi;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif

kustomize:
ifeq (, $(shell which kustomize))
Expand Down
Loading
Loading