fix(cache): propagate runtime-level podMetadata and imagePullSecrets to component pods #6188
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.73) × (1 − Review Confidence (0.54)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 592 lines diff across 7 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.382
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.073
Real PR Conversation Timeline
1 comments
"Review active on #6188"
general
weight: 0.35
cheyang
Ⅰ. Describe what this PR does
CacheRuntimeSpechas two runtime-level fields whose doc comments say they apply to everycomponent:
They are in the CRD and the API server takes them, but the transform path does not read
either.
transformComponentPodTemplatecomposes a component's pod template from theCacheRuntimeClass template and the component-level
RuntimeComponentCommonSpec; theruntime-level layer is not one of its arguments, so it never enters. Setting both fields on a
CacheRuntime is accepted, and then nothing lands on the pod:
The component-level control landing is what narrows it: template rendering and the manifest
are fine, only the middle layer goes missing.
imagePullSecretsis the one likely to hurt —the kubelet gets no credentials for a component image behind a private registry, and the pull
failure names the image and the registry rather than the field that was dropped, so the runtime
spec is not an obvious place to look.
Approach.
podMetadatahas the same three-layer shape asspec.options, which alreadycomposes all three layers (
cm.go:146), so it is given the same order here: CacheRuntimeClasstemplate < runtime level < component level.
UnionMapsWithOverridecopies both operands andtolerates nil, so the old
!= nilguards around the component layer are no longer needed.imagePullSecretshas no component-level counterpart, so there is no precedence to settle.The runtime-level list is appended onto whatever the template declares, skipping names that
are already there. The CRD marks the field
+patchStrategy=merge +patchMergeKey=name, whichI read as a name declared at both layers being one entry rather than two. Replacing the
template's list outright would be defensible too, but that seemed more likely to surprise an
owner whose class template already pins a registry secret — happy to switch if maintainers
prefer the simpler rule.
Master, worker and client all go through
transformComponentPodTemplate, so all three callsites now pass
runtime.Spec.One thing this does not do: both fields are read on the transform path, which runs at setup,
so editing either on a live CacheRuntime still has no effect —
syncRuntimeSpechandlesruntimeVersion,resourcesandreplicasonly. That looks like a separate change, and itis part of what #6185 is about.
Ⅱ. Does this pull request fix one issue?
fixes #6184
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
transform_common_test.gocoverstransformComponentPodTemplatedirectly:the runtime level alone reaches the pod; the component level alone reaches the pod; all
three layers union, and a key declared at more than one layer takes the value from the
latest one.
runtime-level list alone reaches the pod; both layers merge, and a name declared at both
appears once.
composition_matrix_test.gois the executable form of the composition table in #6185. Eachrow states what the three layers declare and what the component should end up with, and every
row is replayed through both paths that compose them — the transform path on create and the
sync path on update — since the two are written independently and are expected to agree.
Rows tagged
knownBugpin current behaviour rather than intended behaviour, so that achange to any of them shows up in review; each names the issue that will change it and what
it should say afterwards (#6173 for resources, #6178 for
runtimeVersion, and theenv/nodeSelectormismatches under #6185). If #6177 merges first, the#6173row is theone that will need updating.
Rows for fields the sync path does not patch are restricted to the create path, which is
stated per row rather than left implicit.
Existing specs in the package are unchanged. The 12 failures in
ufs_test.goandsync_test.goon this package are present onmasteras well and are unrelated to thesechanges.