Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: divyani-22 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Hi @divyani-22. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
…uire non-empty sources Signed-off-by: Divyani <divyanipapalkar22@gmail.com>
Description
Building cleanly on top of #4198, this PR addresses remaining validation gaps in both
pkg/functions/function_volumes.goandcmd/config_volumes.go:/mount paths:validateVolumespreviously only verifiedvol.Path != niland duplicate paths, allowing empty strings (""), relative paths ("etc/config"), or root ("/") to passFunction.Validate()/Function.Write()and fail later during Kubernetes admission (or shadow the container rootfs if mounted at/). BothvalidateVolumesandcmd/config_volumes.go(runAddVolumesPrompt,runAddVolume,runRemoveVolume) now reject root/(including normalized paths such as///).validateVolumescheckedPersistentVolumeClaim.ClaimName == nilbut did not check empty strings for*Secret == "",*ConfigMap == "", or*PersistentVolumeClaim.ClaimName == "".Changes
pkg/functions/function_volumes.go: InvalidateVolumes, reject empty/relative paths, root/mount paths (path.Clean(*vol.Path) == "/"), and empty secret/configMap/PVC claim names.cmd/config_volumes.go: Reject root/mount paths inrunAddVolumesPrompt,runAddVolume, andrunRemoveVolume.pkg/functions/function_volumes_unit_test.go: UpdatedTest_validateVolumesfixtures to absolute paths (/path) and added cases for relative path, empty path, root/&///paths, and empty secret/configMap/PVC claim names.cmd/config_volumes_test.go: AddedTestConfigVolumesAdd_MountPathValidationandTestConfigVolumesRemove_MountPathValidationtesting relative, root/, and clean root///rejection.Testing
Test_validateVolumesinpkg/functions/function_volumes_unit_test.goTestConfigVolumesAdd_MountPathValidationandTestConfigVolumesRemove_MountPathValidationincmd/config_volumes_test.go