rawkode / bring-your-own-telegraf

Docker base image for building your own lightweight Telegraf images
14 stars 5 forks source link

gen.go doesn't build with latest telegraf #2

Closed dgpc closed 3 years ago

dgpc commented 4 years ago

Looks like some upstream changes may have broken this tooling:

cannot load github.com/influxdata/telegraf/internal/config: module github.com/influxdata/telegraf@latest (v1.15.2) found, but
 does not contain package github.com/influxdata/telegraf/internal/config
dgpc commented 4 years ago

Correction, that error was from trying to isolate the problem outside the telegraf source tree, but of course that can't see internal packages.

When copied into the repo per the Dockerfile here, the error is:

build command-line-arguments: cannot load github.com/influxdata/telegraf/internal/config: no matching versions for query "latest"
dgpc commented 4 years ago

Reproduced the issue inside your Dockerfile.test.

The issue seems to be introduced somewhere between 1.14 and 1.15, with --build-arg VERSION=1.14 it works and with --build-arg VERSION=1.15 we get the error:

go: finding module for package github.com/influxdata/telegraf/internal/config
go: finding module for package github.com/influxdata/telegraf/internal/models
gen/gen.go:9:2: no matching versions for query "latest"
gen/gen.go:10:2: no matching versions for query "latest"

The last commit to touch internal/config/config.go seems to be: https://github.com/influxdata/telegraf/commit/90b159d5f5f601e32b29af5ef8e5c4661446781e

That file now seems to have moved out of /internal/config and up a level to /config, same with the models package (though I couldn't find the commit where this happened).

dgpc commented 4 years ago

Sent pull request https://github.com/rawkode/bring-your-own-telegraf/pull/3 to resolve.

rawkode commented 3 years ago

@dgpc Hey! I'm sorry I missed this :(