GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(k8s): guard against nil vol.Path in ProcessVolumes by Elvand-Lie · Pull Request #3805 · knative/func

Conversation

@Elvand-Lie

@Elvand-Lie Elvand-Lie commented May 20, 2026

Copy link
Copy Markdown
Contributor

Problem

ProcessVolumes 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.

Fix

Added a nil guard for vol.Path before the dereference block that returns a descriptive error instead of panicking.

Tests added

  • Test_ProcessVolumes_NilPath: secret volume with nil path returns error
  • Test_ProcessVolumes_NilPathConfigMap: configMap volume with nil path returns error
  • Test_ProcessVolumes_ValidPath: valid volume with path works correctly

Fixes #3796

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos May 20, 2026 19:47
@knative-prow knative-prow Bot added size/M 🤖 PR changes 30-99 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels May 20, 2026
@knative-prow

knative-prow Bot commented May 20, 2026

Copy link
Copy Markdown

Hi @Elvand-Lie. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented May 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.45%. Comparing base (ad6edb6) to head (6f981e0).
⚠️ Report is 42 commits behind head on main.

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              
Flag Coverage Δ
e2e 33.68% <0.00%> (-0.02%) ⬇️
e2e go 29.64% <0.00%> (-0.01%) ⬇️
e2e node 25.86% <0.00%> (-0.01%) ⬇️
e2e python 29.97% <0.00%> (-0.01%) ⬇️
e2e quarkus 25.97% <0.00%> (-0.01%) ⬇️
e2e rust 25.43% <0.00%> (-0.02%) ⬇️
e2e springboot 24.11% <0.00%> (-0.01%) ⬇️
e2e typescript 25.96% <0.00%> (-0.01%) ⬇️
e2e-config-ci 26.75% <0.00%> (-0.01%) ⬇️
integration 15.63% <0.00%> (+<0.01%) ⬆️
unit macos-14 42.42% <100.00%> (+0.22%) ⬆️
unit macos-latest 42.42% <100.00%> (+0.22%) ⬆️
unit ubuntu-24.04-arm 42.71% <100.00%> (+0.20%) ⬆️
unit ubuntu-latest 43.28% <100.00%> (+0.22%) ⬆️
unit windows-latest 42.46% <100.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Elvand-Lie
fix(k8s): guard against nil vol.Path in ProcessVolumes
6f981e0
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
@Elvand-Lie
Elvand-Lie force-pushed the fix/processvolumes-nil-path branch from 7a46429 to 6f981e0 Compare May 21, 2026 06:30
@lkingland lkingland added ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test 🤖 Needs an org member to approve testing labels May 21, 2026
@matejvasek

matejvasek commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/approve
/lgtm
/ok-to-test

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot assigned matejvasek Jun 11, 2026
@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Jun 11, 2026
@knative-prow

knative-prow Bot commented Jun 11, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [matejvasek]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Jun 11, 2026
@knative-prow
knative-prow Bot merged commit 28dfd0c into knative:main Jun 11, 2026
41 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dsimansk dsimansk Awaiting requested review from dsimansk
@jrangelramos jrangelramos Awaiting requested review from jrangelramos

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@matejvasek matejvasek

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. lgtm 🤖 PR is ready to be merged. ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. size/M 🤖 PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

k8s: ProcessVolumes panics on nil vol.Path

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Elvand-Lie @matejvasek @lkingland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.