Skip to content

Commit

Permalink
Merge pull request #105 from gold-kou/update_go
Browse files Browse the repository at this point in the history
Update go version to 1.21
  • Loading branch information
gold-kou authored Mar 1, 2024
2 parents 785eb68 + b36af76 commit b4d435a
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
go-version: '1.21'

- run: go version

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
go-version: '1.21'

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 12 additions & 12 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04

ENV GO_VERSION 1.17.13
ENV GO_VERSION 1.21.7
ENV KUBECTL_VERSION v1.21.10

# KEEP the value as arm64.
Expand All @@ -12,26 +12,26 @@ ENV ETCD_UNSUPPORTED_ARCH arm64

# Development tools
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
wget \
git \
make \
gcc
wget \
git \
make \
gcc

# Docker CLI
# Referring to https://docs.docker.com/engine/install/ubuntu/#installation-methods
RUN apt-get install -y \
ca-certificates \
curl \
gnupg \
ca-certificates \
curl \
gnupg \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod a+r /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "${VERSION_CODENAME}")" stable" \
| tee /etc/apt/sources.list.d/docker.list > /dev/null \
"$(. /etc/os-release && echo "${VERSION_CODENAME}")" stable" \
| tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update && apt-get install -y \
docker-ce-cli
docker-ce-cli

# kubectl
# Referring to https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected])
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])

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
8 changes: 4 additions & 4 deletions controllers/gatling_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion docs/build-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ git clone https://github.com/st-tech/gatling-operator
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
- [go](https://go.dev/doc/install)
- go version must be 1.17

## Create a Kubernetes cluster

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/st-tech/gatling-operator

go 1.17
go 1.21

require (
github.com/go-logr/logr v1.2.0
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
Expand Down

0 comments on commit b4d435a

Please sign in to comment.