Skip to content
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/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.20'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.20'
- name: Generate release artifacts
run: |
make release
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
run:
timeout: 5m
go: "1.19"
go: "1.20"
skip-files:
- "zz_generated.*\\.go$"
allow-parallel-runners: true
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.19.0 as builder
# Run this with docker build --build-arg builder_image=<golang:x.y.z>
ARG builder_image

FROM ${builder_image} as builder
WORKDIR /workspace

# Run this with docker build --build-arg goproxy=$(go env GOPROXY) to override the goproxy
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ ROOT:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

.DEFAULT_GOAL:=help

GO_VERSION ?= 1.20.4
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)

# Use GOPROXY environment variable if set
GOPROXY := $(shell go env GOPROXY)
ifeq ($(GOPROXY),)
Expand Down Expand Up @@ -318,12 +321,12 @@ modules: ## Runs go mod to ensure modules are up to date.
.PHONY: docker-pull-prerequisites
docker-pull-prerequisites:
docker pull docker.io/docker/dockerfile:1.4
docker pull docker.io/library/golang:1.19.0
docker pull $(GO_CONTAINER_IMAGE)
docker pull gcr.io/distroless/static:latest

.PHONY: docker-build
docker-build: docker-pull-prerequisites ## Build the docker image for controller-manager
docker build --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)
docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)

.PHONY: docker-push
docker-push: ## Push the docker image
Expand Down
3 changes: 0 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package main
import (
"flag"
"fmt"
"math/rand"
"net/http"
"os"
"time"
Expand Down Expand Up @@ -113,8 +112,6 @@ func InitFlags(fs *pflag.FlagSet) {
}

func main() {
rand.Seed(time.Now().UnixNano())

InitFlags(pflag.CommandLine)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()
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 sigs.k8s.io/cluster-api-operator

go 1.19
go 1.20

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.4.3

Expand Down
2 changes: 1 addition & 1 deletion hack/chart-update/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/cluster-api-operator/hack/chart-update

go 1.19
go 1.20

require (
github.com/google/go-github/v50 v50.1.0
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ EOF
local go_version
IFS=" " read -ra go_version <<< "$(go version)"
local minimum_go_version
minimum_go_version=go1.19.0
minimum_go_version=go1.20.4
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then
cat <<EOF
Detected go version: ${go_version[*]}.
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/cluster-api-operator/hack/tools

go 1.19
go 1.20

require (
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ set -o pipefail
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
cd "${REPO_ROOT}" || exit 1

echo "*** Verifying Cluster API ***"
echo "*** Verifying Cluster API Operator ***"
make verify