From ae615c88293e99233ca97a6493c704b99ad34267 Mon Sep 17 00:00:00 2001 From: gold-kou Date: Wed, 24 Jan 2024 18:13:41 +0900 Subject: [PATCH] Update go version --- Dockerfile | 2 +- Makefile | 12 ++++++------ controllers/gatling_controller.go | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index e79cac9..7505aaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.17 as builder +FROM golang:1.21-bullseye as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/Makefile b/Makefile index b24e571..f2d5fa3 100644 --- a/Makefile +++ b/Makefile @@ -138,26 +138,26 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi CONTROLLER_GEN = $(shell pwd)/bin/controller-gen controller-gen: ## Download controller-gen locally if necessary. - $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1) + $(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1) KUSTOMIZE = $(shell pwd)/bin/kustomize kustomize: ## Download kustomize locally if necessary. - $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7) + $(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7) CRD_REF_DOCS = $(shell pwd)/bin/crd-ref-docs crd-ref-docs: ## Download crd-ref-docs locally if necessary. - $(call go-get-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs@master) + $(call go-install-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs@master) -# go-get-tool will 'go get' any package $2 and install it to $1. +# go-install-tool will 'go get' any package $2 and install it to $1. PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) -define go-get-tool +define go-install-tool @[ -f $(1) ] || { \ set -e ;\ TMP_DIR=$$(mktemp -d) ;\ cd $$TMP_DIR ;\ go mod init tmp ;\ echo "Downloading $(2)" ;\ -GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\ +GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ rm -rf $$TMP_DIR ;\ } endef diff --git a/controllers/gatling_controller.go b/controllers/gatling_controller.go index 07c302d..55c0845 100644 --- a/controllers/gatling_controller.go +++ b/controllers/gatling_controller.go @@ -464,8 +464,8 @@ func (r *GatlingReconciler) newGatlingRunnerJobForCR(gatling *gatlingv1alpha1.Ga }, Spec: batchv1.JobSpec{ BackoffLimit: &noRestarts, - Parallelism: r.getGatlingRunnerJobParallelism(gatling), - Completions: r.getGatlingRunnerJobParallelism(gatling), + Parallelism: r.getGatlingRunnerJobParallelism(gatling), + Completions: r.getGatlingRunnerJobParallelism(gatling), Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Name: r.getObjectMeta(gatling).Name, @@ -531,8 +531,8 @@ func (r *GatlingReconciler) newGatlingRunnerJobForCR(gatling *gatlingv1alpha1.Ga }, Spec: batchv1.JobSpec{ BackoffLimit: &noRestarts, - Parallelism: &gatling.Spec.TestScenarioSpec.Parallelism, - Completions: &gatling.Spec.TestScenarioSpec.Parallelism, + Parallelism: &gatling.Spec.TestScenarioSpec.Parallelism, + Completions: &gatling.Spec.TestScenarioSpec.Parallelism, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Name: r.getObjectMeta(gatling).Name,