replace dots in shared-dir volume names#5188
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughNormalize Kubernetes volume names for shared-dir secrets by replacing dots with dashes via sharedDirVolumeName(), update addSharedDirSecret to use the normalized name for the volume and mount (SecretName unchanged), and add a table-driven test validating the mutation and naming behavior. ChangesShared dir secret handling
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/steps/multi_stage/gen_test.go`:
- Around line 548-552: The test currently dereferences vol.Secret and accesses
pod.Spec.Containers[0].VolumeMounts[0] without guards; add explicit nil/length
checks before those assertions: ensure vol.Secret != nil (and fail with t.Fatalf
or t.Errorf + return if nil) before checking vol.Secret.SecretName, and ensure
len(pod.Spec.Containers) > 0 and len(pod.Spec.Containers[0].VolumeMounts) > 0
before accessing the first mount (again failing the test with a clear message if
missing) so the test reports diagnostic failures instead of panicking.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: c3312e3b-25dc-483c-99b7-53ae231cb1a5
📒 Files selected for processing (2)
pkg/steps/multi_stage/gen.gopkg/steps/multi_stage/gen_test.go
021d7a3 to
e49fd05
Compare
e49fd05 to
b03a0f7
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deepsm007, eifrach The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold |
|
Scheduling tests matching the |
|
@deepsm007: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
https://redhat-internal.slack.com/archives/CBN38N3MW/p1779090578809989
/cc @openshift/test-platform
Fix shared-dir volume naming for Kubernetes DNS compliance
This change makes multi-stage test pods generated by ci-operator produce Kubernetes-safe volume and mount names for Secret-backed shared directories when the secret name contains dots.
What changed
Component and behavioral impact
Testing
This resolves pod creation errors caused by invalid volume names derived from dotted secret names while keeping Secret references intact.