GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(k8s): guard against nil vol.Path in ProcessVolumes by Elvand-Lie · Pull Request #3805 · knative/func Conversation
Contributor
ProblemProcessVolumes in pkg/k8s/deployer.go dereferences vol.Path (*string) at line 925 without a nil check. If a Volume entry has a source type (secret, configMap, PVC) but no path field set, the nil pointer dereference crashes the process. validateVolumes does detect a nil Path but returns []string (not error), and none of the callers of ProcessVolumes (k8s deployer, knative deployer) gate on validateVolumes before calling it. FixAdded a nil guard for vol.Path before the dereference block that returns a descriptive error instead of panicking. Tests added
Fixes #3796
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #3805 +/- ## ========================================== + Coverage 53.42% 53.45% +0.03% ========================================== Files 200 200 Lines 23426 23429 +3 ========================================== + Hits 12515 12524 +9 + Misses 9655 9649 -6 Partials 1256 1256
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ProcessVolumes dereferences vol.Path (*string) at line 925 without a nil check. If a Volume entry has a source type (secret, configMap, PVC) but no path field set, the nil pointer dereference crashes the process. None of the callers of ProcessVolumes (k8s deployer, knative deployer) gate on validateVolumes before calling ProcessVolumes, so a malformed func.yaml can trigger this crash. Added a nil guard that returns a descriptive error instead of panicking. Fixes knative#3796
7a46429 to
6f981e0
Compare
|
/approve |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Elvand-Lie, matejvasek 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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
k8s: ProcessVolumes panics on nil vol.Path
There was an error while loading. Please reload this page.