Use Kueue v1beta2 Workload API#24563
Conversation
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.
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: fe07a7e | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
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.
📊 Validated against 9 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit f89a708 · What is Autotest? · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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.
Validation ReportAll 21 validations passed. Show details
|
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)
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