Skip to content

Commit 0d81144

Browse files
Backport go 1.20.6 to 2.8 (#9944)
**What this PR does / why we need it**: Update the 2.8 branch so it uses Go version 1.20.6. A 2.8.x release will be built from this later on. **Checklist** - [X] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [ ] Documentation added - [ ] Tests updated - [ ] `CHANGELOG.md` updated - [ ] If the change is worth mentioning in the release notes, add `add-to-release-notes` label - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md` - [ ] For Helm chart changes bump the Helm chart version in `production/helm/loki/Chart.yaml` and update `production/helm/loki/CHANGELOG.md` and `production/helm/loki/README.md`. [Example PR](d10549e) --------- Signed-off-by: Michel Hollands <[email protected]> Signed-off-by: Michel Hollands <[email protected]>
1 parent 780c879 commit 0d81144

24 files changed

+59
-59
lines changed

.drone/drone.jsonnet

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
472472

473473
[
474474
pipeline('loki-build-image') {
475-
local build_image_tag = '0.28.3',
475+
local build_image_tag = '0.29.3-golangci.1.51.2',
476476
workspace: {
477477
base: '/src',
478478
path: 'loki',

.drone/drone.yml

+22-22
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ steps:
1010
dry_run: true
1111
repo: grafana/loki-build-image
1212
tags:
13-
- 0.28.3
13+
- 0.29.3-golangci.1.51.2
1414
when:
1515
event:
1616
- pull_request
@@ -26,7 +26,7 @@ steps:
2626
from_secret: docker_password
2727
repo: grafana/loki-build-image
2828
tags:
29-
- 0.28.3
29+
- 0.29.3-golangci.1.51.2
3030
username:
3131
from_secret: docker_username
3232
when:
@@ -93,14 +93,14 @@ steps:
9393
depends_on:
9494
- clone
9595
environment: {}
96-
image: grafana/loki-build-image:0.28.3
96+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
9797
name: check-drone-drift
9898
- commands:
9999
- make BUILD_IN_CONTAINER=false check-generated-files
100100
depends_on:
101101
- clone
102102
environment: {}
103-
image: grafana/loki-build-image:0.28.3
103+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
104104
name: check-generated-files
105105
- commands:
106106
- cd ..
@@ -110,7 +110,7 @@ steps:
110110
depends_on:
111111
- clone
112112
environment: {}
113-
image: grafana/loki-build-image:0.28.3
113+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
114114
name: clone-target-branch
115115
when:
116116
event:
@@ -121,15 +121,15 @@ steps:
121121
- clone-target-branch
122122
- check-generated-files
123123
environment: {}
124-
image: grafana/loki-build-image:0.28.3
124+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
125125
name: test
126126
- commands:
127127
- cd ../loki-target-branch
128128
- BUILD_IN_CONTAINER=false make test
129129
depends_on:
130130
- clone-target-branch
131131
environment: {}
132-
image: grafana/loki-build-image:0.28.3
132+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
133133
name: test-target-branch
134134
when:
135135
event:
@@ -142,7 +142,7 @@ steps:
142142
- test
143143
- test-target-branch
144144
environment: {}
145-
image: grafana/loki-build-image:0.28.3
145+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
146146
name: compare-coverage
147147
when:
148148
event:
@@ -160,7 +160,7 @@ steps:
160160
TOKEN:
161161
from_secret: github_token
162162
USER: grafanabot
163-
image: grafana/loki-build-image:0.28.3
163+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
164164
name: report-coverage
165165
when:
166166
event:
@@ -170,15 +170,15 @@ steps:
170170
depends_on:
171171
- check-generated-files
172172
environment: {}
173-
image: grafana/loki-build-image:0.28.3
173+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
174174
name: lint
175175
- commands:
176176
- make BUILD_IN_CONTAINER=false check-mod
177177
depends_on:
178178
- test
179179
- lint
180180
environment: {}
181-
image: grafana/loki-build-image:0.28.3
181+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
182182
name: check-mod
183183
- commands:
184184
- apk add make bash && make lint-scripts
@@ -189,28 +189,28 @@ steps:
189189
depends_on:
190190
- check-generated-files
191191
environment: {}
192-
image: grafana/loki-build-image:0.28.3
192+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
193193
name: loki
194194
- commands:
195195
- make BUILD_IN_CONTAINER=false check-doc
196196
depends_on:
197197
- loki
198198
environment: {}
199-
image: grafana/loki-build-image:0.28.3
199+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
200200
name: check-doc
201201
- commands:
202202
- make BUILD_IN_CONTAINER=false validate-example-configs
203203
depends_on:
204204
- loki
205205
environment: {}
206-
image: grafana/loki-build-image:0.28.3
206+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
207207
name: validate-example-configs
208208
- commands:
209209
- make BUILD_IN_CONTAINER=false check-example-config-doc
210210
depends_on:
211211
- clone
212212
environment: {}
213-
image: grafana/loki-build-image:0.28.3
213+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
214214
name: check-example-config-doc
215215
- commands:
216216
- mkdir -p /hugo/content/docs/loki/latest
@@ -243,7 +243,7 @@ steps:
243243
depends_on:
244244
- clone
245245
environment: {}
246-
image: grafana/loki-build-image:0.28.3
246+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
247247
name: loki-mixin-check
248248
when:
249249
event:
@@ -268,7 +268,7 @@ steps:
268268
depends_on:
269269
- clone
270270
environment: {}
271-
image: grafana/loki-build-image:0.28.3
271+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
272272
name: documentation-helm-reference-check
273273
trigger:
274274
ref:
@@ -1431,15 +1431,15 @@ steps:
14311431
NFPM_SIGNING_KEY:
14321432
from_secret: gpg_private_key
14331433
NFPM_SIGNING_KEY_FILE: /drone/src/private-key.key
1434-
image: grafana/loki-build-image:0.28.3
1434+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
14351435
name: write-key
14361436
- commands:
14371437
- make BUILD_IN_CONTAINER=false packages
14381438
environment:
14391439
NFPM_PASSPHRASE:
14401440
from_secret: gpg_passphrase
14411441
NFPM_SIGNING_KEY_FILE: /drone/src/private-key.key
1442-
image: grafana/loki-build-image:0.28.3
1442+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
14431443
name: test packaging
14441444
- commands:
14451445
- ./tools/packaging/verify-deb-install.sh
@@ -1465,7 +1465,7 @@ steps:
14651465
NFPM_PASSPHRASE:
14661466
from_secret: gpg_passphrase
14671467
NFPM_SIGNING_KEY_FILE: /drone/src/private-key.key
1468-
image: grafana/loki-build-image:0.28.3
1468+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
14691469
name: publish
14701470
when:
14711471
event:
@@ -1499,7 +1499,7 @@ steps:
14991499
from_secret: docker_password
15001500
DOCKER_USERNAME:
15011501
from_secret: docker_username
1502-
image: grafana/loki-build-image:0.28.3
1502+
image: grafana/loki-build-image:0.29.3-golangci.1.51.2
15031503
name: build and push
15041504
privileged: true
15051505
volumes:
@@ -1764,6 +1764,6 @@ kind: secret
17641764
name: gpg_private_key
17651765
---
17661766
kind: signature
1767-
hmac: e55dd10435cadfde79f6f334a0d9ad45fc78e6568159c6d58673fcdd3e92d44e
1767+
hmac: 50c36b419eb83a2b2216847784a107cc72c862d059ae4a84f02350e4397dce25
17681768

17691769
...

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
2929
BUILD_IN_CONTAINER ?= true
3030

3131
# ensure you run `make drone` after changing this
32-
BUILD_IMAGE_VERSION := 0.28.3
32+
BUILD_IMAGE_VERSION := 0.29.3-golangci.1.51.2
3333

3434
# Docker image info
3535
IMAGE_PREFIX ?= grafana

clients/cmd/docker-driver/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.3
1+
ARG BUILD_IMAGE=grafana/loki-build-image:0.29.3
22
# Directories in this file are referenced from the root of the project not this folder
33
# This file is intended to be called from the root like so:
44
# docker build -t grafana/loki -f cmd/loki/Dockerfile .

clients/cmd/fluent-bit/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.19.5@sha256:a0b51fe882f269828b63e7f69e6925f85afc548cf7cf967ecbfbcce6afe6f235 AS builder
1+
FROM golang:1.20.6@sha256:832f2f74baa3e2b00ace688cb2fa934dffeade39f5b4c0cc8b1cff8d3fb084a0 AS builder
22

33
COPY . /src
44

clients/cmd/promtail/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4-bullseye as build
1+
FROM golang:1.20.6-bullseye as build
22

33
COPY . /src/loki
44
WORKDIR /src/loki

clients/cmd/promtail/Dockerfile.arm32

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4-bullseye as build
1+
FROM golang:1.20.6-bullseye as build
22

33
COPY . /src/loki
44
WORKDIR /src/loki

clients/cmd/promtail/Dockerfile.cross

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.3
1+
ARG BUILD_IMAGE=grafana/loki-build-image:0.29.3-golangci.1.51.2
22
# Directories in this file are referenced from the root of the project not this folder
33
# This file is intended to be called from the root like so:
44
# docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile .
5-
FROM golang:1.20.4-alpine as goenv
5+
FROM golang:1.20.6-alpine as goenv
66
RUN go env GOARCH > /goarch && \
77
go env GOARM > /goarm
88

clients/cmd/promtail/Dockerfile.debug

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is intended to be called from the root like so:
33
# docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile.debug .
44

5-
FROM grafana/loki-build-image:0.28.3 as build
5+
FROM grafana/loki-build-image:0.29.3-golangci.1.51.2 as build
66
ARG GOARCH="amd64"
77
COPY . /src/loki
88
WORKDIR /src/loki

cmd/logcli/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4 as build
1+
FROM golang:1.20.6 as build
22

33
COPY . /src/loki
44
WORKDIR /src/loki

cmd/logql-analyzer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4 as build
1+
FROM golang:1.20.6 as build
22

33
COPY . /src/loki
44
WORKDIR /src/loki

cmd/loki-canary/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4 as build
1+
FROM golang:1.20.6 as build
22

33
COPY . /src/loki
44
WORKDIR /src/loki

cmd/loki-canary/Dockerfile.cross

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.3
1+
ARG BUILD_IMAGE=grafana/loki-build-image:0.29.3-golangci.1.51.2
22
# Directories in this file are referenced from the root of the project not this folder
33
# This file is intended to be called from the root like so:
44
# docker build -t grafana/promtail -f cmd/promtail/Dockerfile .
5-
FROM golang:1.20.4-alpine as goenv
5+
FROM golang:1.20.6-alpine as goenv
66
RUN go env GOARCH > /goarch && \
77
go env GOARM > /goarm
88

cmd/loki/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4 as build
1+
FROM golang:1.20.6 as build
22

33
COPY . /src/loki
44
WORKDIR /src/loki

cmd/loki/Dockerfile.cross

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.3
1+
ARG BUILD_IMAGE=grafana/loki-build-image:0.29.3-golangci.1.51.2
22
# Directories in this file are referenced from the root of the project not this folder
33
# This file is intended to be called from the root like so:
44
# docker build -t grafana/loki -f cmd/loki/Dockerfile .
5-
FROM golang:1.20.4-alpine as goenv
5+
FROM golang:1.20.6-alpine as goenv
66
RUN go env GOARCH > /goarch && \
77
go env GOARM > /goarm
88

cmd/loki/Dockerfile.debug

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.3
1+
ARG BUILD_IMAGE=grafana/loki-build-image:0.29.3-golangci.1.51.2
22
# Directories in this file are referenced from the root of the project not this folder
33
# This file is intended to be called from the root like so:
44
# docker build -t grafana/loki -f cmd/loki/Dockerfile.debug .
55

6-
FROM golang:1.20.4-alpine as goenv
6+
FROM golang:1.20.6-alpine as goenv
77
RUN go env GOARCH > /goarch && \
88
go env GOARM > /goarm && \
99
go install github.com/go-delve/delve/cmd/dlv@latest

cmd/migrate/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4 as build
1+
FROM golang:1.20.6 as build
22
COPY . /src/loki
33
WORKDIR /src/loki
44
RUN make clean && make BUILD_IN_CONTAINER=false migrate

cmd/querytee/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.4 as build
1+
FROM golang:1.20.6 as build
22

33
COPY . /src/loki
44
WORKDIR /src/loki

cmd/querytee/Dockerfile.cross

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.3
1+
ARG BUILD_IMAGE=grafana/loki-build-image:0.29.3-golangci.1.51.2
22
# Directories in this file are referenced from the root of the project not this folder
33
# This file is intended to be called from the root like so:
44
# docker build -t grafana/promtail -f cmd/promtail/Dockerfile .
5-
FROM golang:1.20.4-alpine as goenv
5+
FROM golang:1.20.6-alpine as goenv
66
RUN go env GOARCH > /goarch && \
77
go env GOARM > /goarm
88

loki-build-image/Dockerfile

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See ../docs/sources/maintaining/release-loki-build-image.md
66

77
# Install helm (https://helm.sh/) and helm-docs (https://github.com/norwoodj/helm-docs) for generating Helm Chart reference.
8-
FROM golang:1.20.4 as helm
8+
FROM golang:1.20.6-bullseye as helm
99
ARG HELM_VER="v3.2.3"
1010
RUN curl -L -o /tmp/helm-$HELM_VER.tgz https://get.helm.sh/helm-${HELM_VER}-linux-amd64.tar.gz && \
1111
tar -xz -C /tmp -f /tmp/helm-$HELM_VER.tgz && \
@@ -38,7 +38,7 @@ RUN apk add --no-cache docker-cli
3838
# TODO this should be fixed to download and extract the specific release binary from github as we do for golangci and helm above
3939
# however we need a commit which hasn't been released yet: https://github.com/drone/drone-cli/commit/1fad337d74ca0ecf420993d9d2d7229a1c99f054
4040
# Read the comment below regarding GO111MODULE=on and why it is necessary
41-
FROM golang:1.20.4 as drone
41+
FROM golang:1.20.6-bullseye as drone
4242
RUN curl -L https://github.com/drone/drone-cli/releases/download/v1.4.0/drone_linux_amd64.tar.gz | tar zx && \
4343
install -t /usr/local/bin drone
4444

@@ -47,32 +47,32 @@ RUN curl -L https://github.com/drone/drone-cli/releases/download/v1.4.0/drone_li
4747
# Error:
4848
# github.com/fatih/[email protected] requires golang.org/x/[email protected]
4949
# (not golang.org/x/[email protected] from golang.org/x/tools/cmd/goyacc@58d531046acdc757f177387bc1725bfa79895d69)
50-
FROM golang:1.20.4 as faillint
50+
FROM golang:1.20.6-bullseye as faillint
5151
RUN GO111MODULE=on go install github.com/fatih/[email protected]
5252

53-
FROM golang:1.20.4 as delve
53+
FROM golang:1.20.6-bullseye as delve
5454
RUN GO111MODULE=on go install github.com/go-delve/delve/cmd/dlv@latest
5555

5656
# Install ghr used to push binaries and template the release
5757
# This collides with the version of go tools used in the base image, thus we install it in its own image and copy it over.
58-
FROM golang:1.20.4 as ghr
58+
FROM golang:1.20.6-bullseye as ghr
5959
RUN GO111MODULE=on go install github.com/tcnksm/ghr@9349474
6060

6161
# Install nfpm (https://nfpm.goreleaser.com) for creating .deb and .rpm packages.
62-
FROM golang:1.20.4 as nfpm
62+
FROM golang:1.20.6-bullseye as nfpm
6363
RUN GO111MODULE=on go install github.com/goreleaser/nfpm/v2/cmd/[email protected]
6464

6565
# Install gotestsum
66-
FROM golang:1.20.4 as gotestsum
66+
FROM golang:1.20.6-bullseye as gotestsum
6767
RUN GO111MODULE=on go install gotest.tools/[email protected]
6868

6969
# Install tools used to compile jsonnet.
70-
FROM golang:1.20.4 as jsonnet
70+
FROM golang:1.20.6-bullseye as jsonnet
7171
RUN GO111MODULE=on go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
7272
RUN GO111MODULE=on go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066
7373
RUN GO111MODULE=on go install github.com/google/go-jsonnet/cmd/[email protected]
7474

75-
FROM golang:1.20.4-buster
75+
FROM golang:1.20.6-bullseye
7676
RUN apt-get update && \
7777
apt-get install -qy \
7878
musl gnupg ragel \

0 commit comments

Comments
 (0)