agent
agent copied to clipboard
Don't retry when --tags-from-gcp-labels successfully finds no labels
When there's no labels, --tags-from-gcp-labels
definitely shouldn't retry-loop nor log an ERROR, and possibly shouldn't log a WARN either.
I see it as “inherit any labels that may or may not be on the instance” rather than “there is DEFINITELY labels on this instance, make sure you get them”. And if it's the latter, the ERROR should be fatal otherwise it's just a misnamed WARN.
$ buildkite-agent start --tags-from-gcp-meta-data --tags-from-gcp-labels 2>&1 | egrep -i 'gcp|google'
2022-08-11 07:20:19 INFO Fetching GCP meta-data...
2022-08-11 07:20:19 INFO Fetching GCP instance labels...
2022-08-11 07:20:19 WARN GCP instance labels are empty (Attempt 0/5 Retrying in -2562047h47m14.854775807s)
2022-08-11 07:20:21 WARN GCP instance labels are empty (Attempt 1/5 Retrying in -84.053947ms)
2022-08-11 07:20:23 WARN GCP instance labels are empty (Attempt 2/5 Retrying in -110.148816ms)
2022-08-11 07:20:25 WARN GCP instance labels are empty (Attempt 3/5 Retrying in -124.625604ms)
2022-08-11 07:20:27 WARN GCP instance labels are empty (Attempt 4/5 Retrying in -131.842105ms)
2022-08-11 07:20:27 ERROR Failed to find GCP instance labels: GCP instance labels are empty