Skip to content

test/kubernetes: use zero-value TextParser until prometheus/common is bumped#175

Open
SAY-5 wants to merge 1 commit intocoredns:masterfrom
SAY-5:fix/metrics-test-revert-to-zero-textparser-7731
Open

test/kubernetes: use zero-value TextParser until prometheus/common is bumped#175
SAY-5 wants to merge 1 commit intocoredns:masterfrom
SAY-5:fix/metrics-test-revert-to-zero-textparser-7731

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 21, 2026

What this PR does / why we need it:

expfmt.NewTextParser was introduced in a later prometheus/common release than the one pinned here (v0.59.1), so every CoreDNS PR that runs the Kubernetes test step fails with:

./metrics_test.go:87:15: undefined: expfmt.NewTextParser

(reported against coredns/coredns#7731 - e.g. the Circle-CI failure on coredns/coredns#7728).

Revert that call site to the zero-value var tp expfmt.TextParser pattern (which defaults to legacy validation) so the job compiles on the currently pinned dependency. Once go.mod's prometheus/common is bumped to a version that exports NewTextParser, this can be re-applied without the compat note.

Also drops the now-unused prometheus/common/model import.

Release note:

NONE

… bumped

expfmt.NewTextParser was introduced in a later prometheus/common
release than the one pinned here (v0.59.1), so every CoreDNS PR
that runs the Kubernetes test step fails with:

  ./metrics_test.go:87:15: undefined: expfmt.NewTextParser

Revert that call site to the zero-value `var tp expfmt.TextParser`
pattern (which defaults to legacy validation) so the job compiles
on the currently pinned dependency. Once go.mod's prometheus/
common is bumped to a version that exports NewTextParser (see
coredns/coredns#7731), this can be re-applied without the compat
note.

Also drop the now-unused prometheus/common/model import.

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented May 5, 2026

The five kubernetes-tests-v1.25..1.29 CircleCI jobs have been red since the PR opened in late April; same red across every K8s version, which suggests the CircleCI runner image / kind setup is broken for these branches independently of this small text-parser revert. The change only touches test/kubernetes/metrics_test.go and stops calling expfmt.NewTextParser(model.LegacyValidation) (which doesn't exist in the pinned prometheus/common v0.59.1) so the parse compiles again. Could a maintainer retrigger CI or look at whether the kind images need refreshing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant