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

CLOUDP-269300: Bump to Go 1.23 #1841

Merged
merged 9 commits into from
Oct 1, 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/actions/gen-install-scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22
FROM golang:1.23

ENV KUBECTL_VERSION 1.18.12
ENV GO111MODULE on
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ linters:
- dupl
- errcheck
- errorlint
- exportloopref
- copyloopvar
#- gocritic
- gocyclo
- goimports
Expand Down
2 changes: 1 addition & 1 deletion .licenses-gomod.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
100644 c4cf9120e81ef4e31f288eef5adccbba2862f023 go.mod
100644 6a6da89744c37c3cd16ce3e453f217e5927c2860 go.mod
2 changes: 1 addition & 1 deletion Dockerfile.post-install
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22 as builder
FROM golang:1.23 as builder

ENV CGO_ENABLED=0
ENV GOOS=linux
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ATLAS_KEY_SECRET_NAME = mongodb-atlas-operator-api-key

BASE_GO_PACKAGE = github.com/mongodb/mongodb-atlas-kubernetes/v2
GO_LICENSES = go-licenses
GO_LICENSES_VERSION = 1.6.0
KUSTOMIZE = kustomize
DISALLOWED_LICENSES = restricted,reciprocal

Expand Down Expand Up @@ -126,9 +127,9 @@ all: manager ## Build all binaries
build-licenses.csv: go.mod ## Track licenses in a CSV file
@echo "Tracking licenses into file $@"
@echo "========================================"
GOOS=linux GOARCH=amd64 go mod download
# https://github.com/google/go-licenses/issues/244
GOTOOLCHAIN=local GOOS=linux GOARCH=amd64 $(GO_LICENSES) csv --include_tests $(BASE_GO_PACKAGE)/... > licenses.csv
export GOOS=linux
export GOARCH=amd64
go run github.com/google/$(GO_LICENSES)@v$(GO_LICENSES_VERSION) csv --include_tests $(BASE_GO_PACKAGE)/... > licenses.csv
Comment on lines +130 to +132
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the prettiest fix, but the only one I could find.

From here:
google/go-licenses#149 (comment)

Seems we won't be able to use devbox/nix for the go-licenses binary and instead need to use it as a module dep.

cc @roothorp

echo $(GOMOD_SHA) > $(LICENSES_GOMOD_SHA_FILE)

.PHONY: recompute-licenses
Expand All @@ -145,8 +146,9 @@ licenses-up-to-date: ## Check if the licenses.csv is up to date
check-licenses: licenses-up-to-date ## Check licenses are compliant with our restrictions
@echo "Checking licenses not to be: $(DISALLOWED_LICENSES)"
@echo "============================================"
# https://github.com/google/go-licenses/issues/244
GOTOOLCHAIN=local GOOS=linux GOARCH=amd64 $(GO_LICENSES) check --include_tests \
export GOOS=linux
export GOARCH=amd64
go run github.com/google/$(GO_LICENSES)@v$(GO_LICENSES_VERSION) check --include_tests \
--disallowed_types $(DISALLOWED_LICENSES) $(BASE_GO_PACKAGE)/...
@echo "--------------------"
@echo "Licenses check: PASS"
Expand Down
5 changes: 2 additions & 3 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"yq-go@latest",
"[email protected]",
"jq@latest",
"go@1.22.5",
"go@1.23",
"gotests@latest",
"act@latest",
"kubectl@latest",
Expand All @@ -16,11 +16,10 @@
"kubernetes-helm@latest",
"govulncheck@latest",
"gotools@latest",
"go-licenses@latest",
"ginkgo@latest",
"[email protected]",
"shellcheck@latest",
"golangci-lint@1.59.1",
"golangci-lint@1.60",
"[email protected]"
]
}
Loading
Loading