Skip to content

Commit

Permalink
Upgrade to go v1.21.1 (fluxninja#2650)
Browse files Browse the repository at this point in the history
**Chore:**
- Upgraded Go programming language version from 1.20.6 to 1.21.1 across
all Dockerfiles, scripts, and configuration files. This update brings in
the latest features, improvements, and bug fixes from the new Go
version.
- Updated cache keys for ASDF (Another System Definition Facility) in
CircleCI configuration files to ensure correct cache restoration and
saving based on the updated cache version.
- Bumped up golangci-lint version from 1.53.3 to 1.54.2 in
.tool-versions file for enhanced linting capabilities.

These changes are part of routine maintenance and upgrade tasks and do
not directly impact end-user functionality.
  • Loading branch information
hdkshingala authored Sep 20, 2023
1 parent aa68a28 commit 5315f65
Show file tree
Hide file tree
Showing 22 changed files with 134 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ commands:
- restore_cache:
name: Restore ASDF cache
keys:
- aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{
checksum "go.mod" }}
- aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-
- run:
name: Copy tool-versions in HOME dir
Expand All @@ -66,7 +66,7 @@ commands:
- save_cache:
name: Save ASDF cache
key:
aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{ checksum
"go.mod" }}
paths:
Expand Down
16 changes: 8 additions & 8 deletions .circleci/continue-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ executors:
- image: cimg/base:2022.07
go-cimg-executor:
docker:
- image: cimg/go:1.20.6
- image: cimg/go:1.21.1
user: root
python-cimg-executor:
docker:
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
- restore_cache:
name: Restore daily cache
keys:
- aperture-v9-daily-cache-{{ checksum "~/day" }}
- aperture-v10-daily-cache-{{ checksum "~/day" }}
- run: &install_opsninja
name: Install opsninja and its dependencies
command: |
Expand Down Expand Up @@ -397,7 +397,7 @@ jobs:
fi
- save_cache:
name: Save daily cache
key: aperture-v9-daily-cache-{{ checksum "~/day" }}
key: aperture-v10-daily-cache-{{ checksum "~/day" }}
paths:
- ../.cache/go-build
- ../.cache/golangci-lint
Expand Down Expand Up @@ -1088,7 +1088,7 @@ jobs:
- restore_cache:
name: Restore go cache
keys:
- aperture-v2-go-cache-upload-policies
- aperture-v3-go-cache-upload-policies
- run:
name: Apply Policy
working_directory: .
Expand All @@ -1097,7 +1097,7 @@ jobs:
--controller << parameters.controller-endpoint >> --api-key ${CONTROLLER_API_KEY} -f -s
- save_cache:
name: Save go cache
key: aperture-v2-go-cache-upload-policies
key: aperture-v3-go-cache-upload-policies
paths:
- ../.cache/go-build
- ./blueprints/vendor
Expand Down Expand Up @@ -1497,10 +1497,10 @@ commands:
- restore_cache:
name: Restore ASDF cache
keys:
- aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{
checksum "tools/go/go.mod" }}
- aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-
- run:
name: Copy tool-versions in HOME dir
Expand All @@ -1522,7 +1522,7 @@ commands:
- save_cache:
name: Save ASDF cache
key:
aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{ checksum
"tools/go/go.mod" }}
paths:
Expand Down
6 changes: 3 additions & 3 deletions .circleci/post-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ commands:
- restore_cache:
name: Restore ASDF cache
keys:
- aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{
checksum "go.mod" }}-{{ checksum "~/installed-tools" }}
- aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-
- run:
name: Copy tool-versions in HOME dir
Expand All @@ -438,7 +438,7 @@ commands:
- save_cache:
name: Save ASDF cache
key:
aperture-asdf-cache-v11-{{ checksum "~/month" }}-<<
aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{ checksum
"go.mod" }}-{{ checksum "~/installed-tools" }}
paths:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run:
modules-download-mode: readonly
allow-parallel-runners: true
allow-serial-runners: true
go: "1.20"
go: "1.21"
linters-settings:
goimports:
local-prefixes: github.com/fluxninja
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ repos:
- id: go-generate
- id: go-mod-tidy-repo
args:
- -compat=1.20
- -compat=1.21
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pre-commit 3.3.1
bats 1.9.0
python 3.11.4
gcloud 429.0.0
golang 1.20.6
golangci-lint 1.53.3
golang 1.21.1
golangci-lint 1.54.2
grpcurl 1.8.7
mockery 2.26.1
buf 1.25.0
Expand Down
6 changes: 3 additions & 3 deletions cmd/aperture-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4
FROM golang:1.20.6-bullseye AS builder
FROM golang:1.21.1-bullseye AS builder

WORKDIR /src
COPY --link . .
Expand All @@ -15,8 +15,8 @@ ARG APERTURECTL_BUILD_FLAGS
ENV APERTURECTL_BUILD_FLAGS=${APERTURECTL_BUILD_FLAGS}

RUN --mount=type=cache,target=/go/pkg/ \
--mount=type=cache,target=/root/.cache/go-build/,id=agent-1.20.6,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=agent-1.20.6,sharing=private \
--mount=type=cache,target=/root/.cache/go-build/,id=agent-1.21.1,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=agent-1.21.1,sharing=private \
/bin/bash -c \
'set -eu; \
go mod download; \
Expand Down
6 changes: 3 additions & 3 deletions cmd/aperture-controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4
FROM golang:1.20.6-bullseye AS builder
FROM golang:1.21.1-bullseye AS builder

WORKDIR /src
COPY --link . .
Expand All @@ -15,8 +15,8 @@ ARG APERTURECTL_BUILD_FLAGS
ENV APERTURECTL_BUILD_FLAGS=${APERTURECTL_BUILD_FLAGS}

RUN --mount=type=cache,target=/go/pkg/ \
--mount=type=cache,target=/root/.cache/go-build/,id=controller-1.20.6,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=controller-1.20.6,sharing=private \
--mount=type=cache,target=/root/.cache/go-build/,id=controller-1.21.1,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=controller-1.21.1,sharing=private \
/bin/bash -c \
'go mod download; \
./scripts/build_aperturectl.sh ./cmd/aperturectl; \
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/fluxninja/aperture/v2

go 1.20
go 1.21

require (
github.com/BurntSushi/toml v1.3.2
Expand Down
Loading

0 comments on commit 5315f65

Please sign in to comment.