Skip to content

Commit

Permalink
Downgrade go to 1.20.7 as there are some issues with go 1.21.0 (fluxn…
Browse files Browse the repository at this point in the history
…inja#2569)

Reverting the Go version upgrade as there are some issues with `go
generate` and proto file namespace conflict

"Chore: Downgraded Golang version and updated cache keys"

- Downgraded the Golang version from 1.21.0 to 1.20.7 across all
Dockerfiles, configuration files, and scripts for consistency and
compatibility.
- Updated the cache keys in CircleCI configuration files from "v12" to
"v13" to ensure proper cache invalidation and regeneration.
- Adjusted the `go mod tidy` command to use `-compat=1.20` instead of
`-compat=1.21` in pre-commit hooks and scripts.
  
These changes do not introduce any new features or bug fixes, but they
help maintain the project's stability and efficiency.
  • Loading branch information
hdkshingala authored Sep 1, 2023
1 parent 327c2d8 commit 84f2f8e
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 134 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-v12-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v13-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{
checksum "go.mod" }}
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v13-{{ 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-v12-{{ checksum "~/month" }}-<<
aperture-asdf-cache-v13-{{ 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.21.0
- image: cimg/go:1.20.7
user: root
python-cimg-executor:
docker:
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
- restore_cache:
name: Restore daily cache
keys:
- aperture-v10-daily-cache-{{ checksum "~/day" }}
- aperture-v11-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-v10-daily-cache-{{ checksum "~/day" }}
key: aperture-v11-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-v3-go-cache-upload-policies
- aperture-v4-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-v3-go-cache-upload-policies
key: aperture-v4-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-v12-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v13-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{
checksum "tools/go/go.mod" }}
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v13-{{ 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-v12-{{ checksum "~/month" }}-<<
aperture-asdf-cache-v13-{{ 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-v12-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v13-{{ checksum "~/month" }}-<<
parameters.cache_name >>-{{ checksum ".tool-versions" }}-{{
checksum "go.mod" }}-{{ checksum "~/installed-tools" }}
- aperture-asdf-cache-v12-{{ checksum "~/month" }}-<<
- aperture-asdf-cache-v13-{{ 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-v12-{{ checksum "~/month" }}-<<
aperture-asdf-cache-v13-{{ 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.21"
go: "1.20"
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.21
- -compat=1.20
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pre-commit 3.3.1
bats 1.9.0
python 3.11.4
gcloud 429.0.0
golang 1.21.0
golang 1.20.7
golangci-lint 1.54.1
grpcurl 1.8.7
mockery 2.26.1
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.21.0-bullseye AS builder
FROM golang:1.20.7-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.21.0,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=agent-1.21.0,sharing=private \
--mount=type=cache,target=/root/.cache/go-build/,id=agent-1.20.7,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=agent-1.20.7,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.21.0-bullseye AS builder
FROM golang:1.20.7-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.21.0,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=controller-1.21.0,sharing=private \
--mount=type=cache,target=/root/.cache/go-build/,id=controller-1.20.7,sharing=private \
--mount=type=cache,target=/root/.aperturectl,id=controller-1.20.7,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.21
go 1.20

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

0 comments on commit 84f2f8e

Please sign in to comment.