Skip to content

Rewrite PD CSI error message when encountering diskType unsupported error #1212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pwschuurman
Copy link
Contributor

@pwschuurman pwschuurman commented Apr 25, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it:
On AttachDisk UNSUPPORTED_OPERATION failure (when a PD disk type is not supported by a VM family), the GCE API prints a non-intuitive error message:

"ControllerPublishVolume failed with error for disk projects/psch-gke-dev/zones/us-central1-c/disks/gcepd-csi-e2e-c3-d7397693-5097-4a70-9df0-b10204611053 on node projects/psch-gke-dev/zones/us-central1-c/instances/gce-pd-csi-e2e-us-central1-c: rpc error: code = Internal desc = '[pd-standard] features are not compatible for creating instance'

This PR changes the error message to the following:

"ControllerPublishVolume failed with error for disk projects/psch-gke-dev/zones/us-central1-c/disks/gcepd-csi-e2e-c3-39658ebc-95ad-434c-975a-e8e34b81fbbb on node projects/psch-gke-dev/zones/us-central1-c/instances/gce-pd-csi-e2e-us-central1-c: rpc error: code = Internal desc = 'pd-standard' is not a compatible disk type with the machine type 'c3-highcpu-4', please review the GKE online documentation for available persistent disk options

Special notes for your reviewer:
Tested this out e2e with the following command:

go test ./test/e2e/tests --ginkgo.focus="Should create->attach->stage->mount" --project "${PROJECT}" --service-account "${IAM_NAME}" --machine-type "c3-highcpu-4" --logtostderr -v 4          

Result (validated correct error message): https://gist.github.com/pwschuurman/bbba0a057b9f1c1b8ae28efd6483a987

Does this PR introduce a user-facing change?:

Updates error message to be more user friendly when PD CSI Driver encounters an disk type UNSUPPORTED_OPERATION on ControllerPublishVolume

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 25, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 25, 2023
@pwschuurman
Copy link
Contributor Author

pwschuurman commented Apr 25, 2023

/cc @qiutongs

@k8s-ci-robot k8s-ci-robot requested a review from qiutongs April 25, 2023 06:45
@pwschuurman pwschuurman force-pushed the fix-gce-create-err-msg branch from 26f73b6 to 4ae2e42 Compare April 25, 2023 15:28
@pwschuurman pwschuurman force-pushed the fix-gce-create-err-msg branch from 1c528e3 to 464ff18 Compare May 9, 2023 18:59
@pwschuurman
Copy link
Contributor Author

/retest

1 similar comment
@pwschuurman
Copy link
Contributor Author

/retest

@pwschuurman pwschuurman force-pushed the fix-gce-create-err-msg branch 2 times, most recently from b81aa67 to e347032 Compare May 10, 2023 18:10
@pwschuurman pwschuurman force-pushed the fix-gce-create-err-msg branch from e347032 to 5ba8e55 Compare May 11, 2023 00:40
@sunnylovestiramisu
Copy link
Contributor

sunnylovestiramisu commented May 12, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 12, 2023
@sunnylovestiramisu
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pwschuurman, sunnylovestiramisu

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 12, 2023
@k8s-ci-robot k8s-ci-robot merged commit ec41c54 into kubernetes-sigs:master May 12, 2023
k8s-ci-robot added a commit that referenced this pull request May 23, 2023
…212-upstream-release-1.9

Automated cherry pick of #1212: Rewrite PD CSI error message when encountering diskType
k8s-ci-robot added a commit that referenced this pull request May 23, 2023
…212-upstream-release-1.10

Automated cherry pick of #1212: Rewrite PD CSI error message when encountering diskType
k8s-ci-robot added a commit that referenced this pull request May 23, 2023
…212-upstream-release-1.8

Automated cherry pick of #1212: Rewrite PD CSI error message when encountering diskType
k8s-ci-robot added a commit that referenced this pull request Jun 26, 2023
…212-upstream-release-1.7

Automated cherry pick of #1212: Rewrite PD CSI error message when encountering diskType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants