buildkite / buildkite/agent

Don't retry when --tags-from-gcp-labels successfully finds no labels

Open
#1,743 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

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
```

Contributor guide

Open the contributing guide

Research direction

Start at the implementation of the `--tags-from-gcp-labels` entry point and reproduce the command shown in the issue. Trace the retry and error handling for an empty label response; done means an empty response does not retry or log an ERROR, with the warning behavior resolved consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, go
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.