Define kube_config_dict schema and make it Fleet configurable in kai_scheduler and kueue #26160
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.71) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.71 · 530 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.375
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.071
Real PR Conversation Timeline
1 comments
"Review active on #26160"
general
weight: 0.35
martavicentenavarro
What does this PR do?
<!-- Give a minimal but complete description of the change and how it works. -->
Defines the contents of
kube_config_dictin thekai_schedulerandkueueconfig specs and makes it Fleet configurable again.The schema declares every kubeconfig key the
kubernetes==35.0.0client reads: cluster (server, CA file/data,insecure-skip-tls-verify,tls-server-name), contexts, and users withtoken/tokenFile, client certificates (file/data),username/password,auth-provider(gcp, azure, oidc) andexec.token,password,client-key-dataand theaccess-token,refresh-token,id-tokenandclient-secretfields ofauth-provider.configare markedsecret, so Fleet requires secret references for them.With properties declared, the config model is a nested pydantic model with aliased kebab-case keys, so
kube_client.pynow dumps it back to a kubeconfig dict (by_alias,exclude_unset) before checking whether it is empty.{}still falls back to the in-cluster config.Motivation
<!--
Briefly explain why this change is needed and how it fits in: is it part of a bigger project, and
how does it fit into it? Are there related or follow-up PRs? Link only the references a reviewer
needs (e.g. Jira ticket, design doc, upstream docs or changelog, related PRs).
-->
Supersedes #26156, which excluded the option from Fleet because the spec declared it as a free-form object: the generated schema only accepted
{}and Fleet could not treat credentials as secrets.Trade-offs:
preferences,proxy-url, impersonation) are dropped; Agent behavior is otherwise unchanged. Clusterextensionsare kept as free-form objects becauseexecplugins withprovideClusterInforeceive theclient.authentication.k8s.io/execextension.execis kept for parity with existing Agent configs, so Fleet can push a credential plugin command that runs on the Agent host.expirytimestamp parsed by YAML as a date.Follow-up: dd-source
fleet-sync-workeroverrides.yamlhas a narrowerkueuekube_config_dictoverride that should be removed once this merges.New unit tests check that every declared field reaches the Kubernetes client unchanged, undeclared keys are dropped,
{}uses in-cluster config, and the real client loads token and kind-style kubeconfigs. I also ran the dd-source converter on both specs and validated sample configs against the generated schema.Checklist before requesting review
<!--
The
pr-descriptionvalidation (Run Validations) fails until every item below is ticked andthe visible description (excluding HTML comments) is at most 3,000 characters. CI, the changelog,
and the QA label have their own checks. Request review only once all checks pass:
gh pr checks <PR> --repo DataDog/integrations-core --watch.-->
<!--
How to verify: run
gh pr diff <PR> --repo DataDog/integrations-core, review every changed line,and compare the final diff with the description above.
-->
<!--
How to verify: check the diff for relevant tests and run them as described in
AGENTS.md.-->
<!--
How to verify: run
gh api repos/DataDog/integrations-core/pulls/<PR>/commentsandgh pr view <PR> --repo DataDog/integrations-core --json reviews,comments, then fix eachfinding or reply with the reason no change is needed.
-->
<!-- Coding agents: never tick this item. Only the human author may tick it. -->
<!--
QA label: PRs that only change code owned exclusively by @DataDog/agent-integrations (see
.github/CODEOWNERS) always useqa/skip-qa, neverqa/required.-->