Skip to content

Conversation

@hajiler
Copy link
Contributor

@hajiler hajiler commented Sep 24, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:
This PR introduces a safeguard to compare a disk's reported size against its expected size before running mkfs. If the disk's actual size does not match the expected size, the NodeStageVolume fails, and the operation will be retried.

Which issue(s) this PR fixes:

Fixes #
#2179

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Introduced a safeguard in NodeStageVolume to compare a disk's reported size against its expected size before running mkfs. If the sizes do not match, the operation will fail and be retried.

Note: To enable this validation, the --enable-disk-size-validation flag must be set to true on the node server.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hajiler
Once this PR has been reviewed and has the lgtm label, please assign amacaskill for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

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

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 24, 2025
@hajiler hajiler force-pushed the pvc-mount-issue-fix branch 2 times, most recently from 1b7e25c to 8a3e720 Compare September 25, 2025 02:25
@hajiler hajiler force-pushed the pvc-mount-issue-fix branch from 8a3e720 to aa1cf88 Compare September 25, 2025 02:28
@hajiler
Copy link
Contributor Author

hajiler commented Sep 25, 2025

/retest

@hajiler
Copy link
Contributor Author

hajiler commented Sep 26, 2025

/retest

1 similar comment
@hajiler
Copy link
Contributor Author

hajiler commented Sep 29, 2025

/retest

@k8s-ci-robot
Copy link
Contributor

@hajiler: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-gcp-compute-persistent-disk-csi-driver-e2e-windows-2022 a6bd669 link false /test pull-gcp-compute-persistent-disk-csi-driver-e2e-windows-2022
pull-gcp-compute-persistent-disk-csi-driver-e2e-arm a6bd669 link false /test pull-gcp-compute-persistent-disk-csi-driver-e2e-arm
pull-gcp-compute-persistent-disk-csi-driver-verify a6bd669 link true /test pull-gcp-compute-persistent-disk-csi-driver-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@mattcary
Copy link
Contributor

The govet error must be a new check, as that setup_e2e_test code has been in since february.

I'll force-submit, and push a PR to fix the e2e test.

@mattcary mattcary merged commit 7568643 into kubernetes-sigs:master Sep 29, 2025
6 of 10 checks passed
@hajiler
Copy link
Contributor Author

hajiler commented Oct 14, 2025

/cherry-pick release-1.21

@k8s-infra-cherrypick-robot

@hajiler: #2178 failed to apply on top of branch "release-1.21":

Applying: Add NodeStageVolume disk size validation before mounting
Using index info to reconstruct a base tree...
M	pkg/gce-pd-csi-driver/node.go
M	pkg/gce-pd-csi-driver/node_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/gce-pd-csi-driver/node_test.go
Auto-merging pkg/gce-pd-csi-driver/node.go
Applying: Flag protect disk validation
Using index info to reconstruct a base tree...
M	cmd/gce-pd-csi-driver/main.go
M	pkg/gce-pd-csi-driver/gce-pd-driver.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/gce-pd-csi-driver/gce-pd-driver.go
Auto-merging cmd/gce-pd-csi-driver/main.go
CONFLICT (content): Merge conflict in cmd/gce-pd-csi-driver/main.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0002 Flag protect disk validation

In response to this:

/cherry-pick release-1.21

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.

k8s-ci-robot added a commit that referenced this pull request Oct 15, 2025
…upstream-release-1.21

Automated cherry pick of #2178: Add NodeStageVolume disk size validation before mounting
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants