Add discovery port name helper#24555
Merged
Merged
Conversation
3 tasks
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3 tasks
Contributor
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 26b0664 | Docs | Datadog PR Page | Give us feedback! |
vitkyrka
force-pushed
the
vitkyrka/disco-port-name-helper
branch
from
July 15, 2026 09:42
09a231c to
57e665d
Compare
An empty string in `names` would otherwise match every unnamed port (Port.name defaults to ""), which is the opposite of the intended match-by-name semantics. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The one-liner omitted the name-priority ordering and no-fallback behavior that the existing tests already assert, matching the sibling candidate_ports docstring's existing standard. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Folds the five standalone tests into one pytest.mark.parametrize table, keeping the scenario names as ids so they stay visually aligned and distinguishable. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
vitkyrka
marked this pull request as ready for review
July 15, 2026 10:17
This was referenced Jul 15, 2026
sarah-witt
approved these changes
Jul 15, 2026
Contributor
Validation ReportAll 21 validations passed. Show details
|
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Add a discovery helper to get ports by name. This will be used in a new strategy which will allow ports to be selected using the name specified in the Kubernetes deployment. This strategy can be re-used by multiple integrations whose services use named ports for their metrics port, such as
veleroorargo_rollouts.This helper is unused in this PR except for tests but is added in a separate PR following the example of earlier PRs where it was requested to keep changes to
datadog_checks_baseseparate from other changes.Motivation
Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged