Skip to content

Use Kueue v1beta2 Workload API#24563

Open
gjulianm wants to merge 4 commits into
masterfrom
kueue-workload-v1beta2-fallback
Open

Use Kueue v1beta2 Workload API#24563
gjulianm wants to merge 4 commits into
masterfrom
kueue-workload-v1beta2-fallback

Conversation

@gjulianm

Copy link
Copy Markdown
Contributor

What does this PR do?

Queries Kueue Workloads through v1beta2, with v1beta1 fallback for older clusters.

Motivation

Some Kueue clusters no longer serve the v1beta1 Workload endpoint.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Prefer the current Kueue Workload API while retaining support for clusters that expose only v1beta1.
Document the Workload API compatibility fix in the release notes.
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 88.89%
Overall Coverage: 82.82% (-5.47%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fe07a7e | Docs | Datadog PR Page | Give us feedback!

@gjulianm gjulianm marked this pull request as ready for review July 16, 2026 08:43
@gjulianm gjulianm requested a review from a team as a code owner July 16, 2026 08:43

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

Kueue workload collection now tries v1beta2 first with automatic fallback to v1beta1 on 404 errors, enabling support for clusters that no longer serve the deprecated v1beta1 endpoint. The fallback logic is sound—it only falls back on 404 (not found) and re-raises other errors immediately, ensuring no silent failures from permission or server errors. All test scenarios pass including both cluster-level and namespaced queries.

Was this helpful? React 👍 or 👎

📊 Validated against 9 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit f89a708 · What is Autotest? · Any feedback? Reach out in #autotest

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f89a7084e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


def list_workloads(self, namespace: str | None = None) -> list[dict]:
try:
return self.list_workloads_for_version('v1beta2', namespace)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve priority-class tags when using v1beta2

When a cluster serves v1beta2, this new default returns v1beta2 Workload objects; for workloads with a priority class, that schema exposes the name at spec.priorityClassRef.name rather than the v1beta1 spec.priorityClassName (Kueue API docs). workload_event_tags still reads only spec.get('priorityClassName'), so lifecycle events collected through the new path silently lose the kueue_workload_priority_class tag while the fallback path keeps it. Please normalize the object or read both fields before preferring v1beta2.

Useful? React with 👍 / 👎.

Read the v1beta2 priority class reference while retaining compatibility with v1beta1 Workload objects.
@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant