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

update to go 1.15 #8220

Merged
merged 1 commit into from
Oct 7, 2020
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
60 changes: 30 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ defaults:
working_directory: '/go/src/github.com/influxdata/telegraf'
environment:
GOFLAGS: -p=8
go-1_13: &go-1_13
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.13.13'
go-1_14: &go-1_14
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.14.5'
- image: 'quay.io/influxdb/telegraf-ci:1.14.9'
go-1_15: &go-1_15
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.15.2'
mac: &mac
macos:
xcode: 11.3.1
Expand All @@ -21,7 +21,7 @@ defaults:
version: 2
jobs:
deps:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -62,31 +62,31 @@ jobs:
- 'usr/local/bin/gofmt'
- 'Users/distiller/go'

test-go-1.13:
<<: [ *defaults, *go-1_13 ]
test-go-1.14:
<<: [ *defaults, *go-1_14 ]
steps:
- attach_workspace:
at: '/go'
- run: 'make'
- run: 'make test'
test-go-1.13-386:
<<: [ *defaults, *go-1_13 ]
test-go-1.14-386:
<<: [ *defaults, *go-1_14 ]
steps:
- attach_workspace:
at: '/go'
- run: 'GOARCH=386 make'
- run: 'GOARCH=386 make test'
test-go-1.14:
<<: [ *defaults, *go-1_14 ]
test-go-1.15:
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
- run: 'make'
- run: 'make check'
- run: 'make check-deps'
- run: 'make test'
test-go-1.14-386:
<<: [ *defaults, *go-1_14 ]
test-go-1.15-386:
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
Expand All @@ -103,7 +103,7 @@ jobs:
- run: 'make test'

package:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
Expand All @@ -113,7 +113,7 @@ jobs:
destination: 'build/dist'

release:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
Expand All @@ -122,7 +122,7 @@ jobs:
path: './build/dist'
destination: 'build/dist'
nightly:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
Expand All @@ -144,25 +144,25 @@ workflows:
filters:
tags:
only: /.*/
- 'test-go-1.13':
- 'test-go-1.14':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.13-386':
- 'test-go-1.14-386':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.14':
- 'test-go-1.15':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.14-386':
- 'test-go-1.15-386':
requires:
- 'deps'
filters:
Expand All @@ -177,17 +177,17 @@ workflows:
- 'package':
requires:
- 'test-go-darwin'
- 'test-go-1.13'
- 'test-go-1.13-386'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
- 'release':
requires:
- 'test-go-darwin'
- 'test-go-1.13'
- 'test-go-1.13-386'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
filters:
tags:
only: /.*/
Expand All @@ -197,16 +197,16 @@ workflows:
jobs:
- 'deps'
- 'macdeps'
- 'test-go-1.13':
- 'test-go-1.14':
requires:
- 'deps'
- 'test-go-1.13-386':
- 'test-go-1.14-386':
requires:
- 'deps'
- 'test-go-1.14':
- 'test-go-1.15':
requires:
- 'deps'
- 'test-go-1.14-386':
- 'test-go-1.15-386':
requires:
- 'deps'
- 'test-go-darwin':
Expand All @@ -215,10 +215,10 @@ workflows:
- 'nightly':
requires:
- 'test-go-darwin'
- 'test-go-1.13'
- 'test-go-1.13-386'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
triggers:
- schedule:
cron: "0 7 * * *"
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ telegraf:
# Used by dockerfile builds
.PHONY: go-install
go-install:
go install -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf
go install -mod=mod -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf

.PHONY: test
test:
Expand Down Expand Up @@ -159,7 +159,7 @@ clean:

.PHONY: docker-image
docker-image:
docker build -f scripts/stretch.docker -t "telegraf:$(commit)" .
docker build -f scripts/buster.docker -t "telegraf:$(commit)" .

plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
ragel -Z -G2 $^ -o $@
Expand All @@ -169,15 +169,15 @@ plugin-%:
@echo "Starting dev environment for $${$(@)} input plugin..."
@docker-compose -f plugins/inputs/$${$(@)}/dev/docker-compose.yml up

.PHONY: ci-1.15
ci-1.15:
docker build -t quay.io/influxdb/telegraf-ci:1.15.2 - < scripts/ci-1.15.docker
docker push quay.io/influxdb/telegraf-ci:1.15.2

.PHONY: ci-1.14
ci-1.14:
docker build -t quay.io/influxdb/telegraf-ci:1.14.5 - < scripts/ci-1.14.docker
docker push quay.io/influxdb/telegraf-ci:1.14.5

.PHONY: ci-1.13
ci-1.13:
docker build -t quay.io/influxdb/telegraf-ci:1.13.13 - < scripts/ci-1.13.docker
docker push quay.io/influxdb/telegraf-ci:1.13.13
docker build -t quay.io/influxdb/telegraf-ci:1.14.9 - < scripts/ci-1.14.docker
docker push quay.io/influxdb/telegraf-ci:1.14.9

.PHONY: install
install: $(buildbin)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Ansible role: https://github.com/rossmcdonald/telegraf

Telegraf requires Go version 1.13 or newer, the Makefile requires GNU make.

1. [Install Go](https://golang.org/doc/install) >=1.13 (1.14 recommended)
1. [Install Go](https://golang.org/doc/install) >=1.13 (1.15 recommended)
2. Clone the Telegraf repository:
```
cd ~/src
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/influxdata/telegraf

go 1.13
go 1.15

require (
cloud.google.com/go v0.53.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/alpine.docker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.7 as builder
FROM golang:1.15.2 as builder
WORKDIR /go/src/github.com/influxdata/telegraf

COPY . /go/src/github.com/influxdata/telegraf
Expand Down
15 changes: 15 additions & 0 deletions scripts/buster.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.15.2-buster as builder
WORKDIR /go/src/github.com/influxdata/telegraf

COPY . /go/src/github.com/influxdata/telegraf
RUN make go-install

FROM buildpack-deps:buster-curl
COPY --from=builder /go/bin/* /usr/bin/
COPY etc/telegraf.conf /etc/telegraf/telegraf.conf

EXPOSE 8125/udp 8092/udp 8094

COPY scripts/docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"]
2 changes: 1 addition & 1 deletion scripts/ci-1.14.docker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.5
FROM golang:1.14.9

RUN chmod -R 755 "$GOPATH"

Expand Down
7 changes: 1 addition & 6 deletions scripts/ci-1.13.docker → scripts/ci-1.15.docker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13.13
FROM golang:1.15.2

RUN chmod -R 755 "$GOPATH"

Expand All @@ -21,8 +21,3 @@ RUN locale-gen C.UTF-8 || true
ENV LANG=C.UTF-8

RUN gem install fpm

RUN go get -d github.com/golang/dep && \
cd src/github.com/golang/dep && \
git checkout -q v0.5.0 && \
go install -ldflags="-X main.version=v0.5.0" ./cmd/dep
2 changes: 1 addition & 1 deletion scripts/stretch.docker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.7-stretch as builder
FROM golang:1.14.9-stretch as builder
WORKDIR /go/src/github.com/influxdata/telegraf

COPY . /go/src/github.com/influxdata/telegraf
Expand Down