Don't count reserved partitions (gpt) when checking if any exist#145
Conversation
|
Hi @wongma7. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with 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/test-infra repository. |
|
/ok-to-test |
|
/lgtm |
28dec51 to
85daba4
Compare
|
rebased (took a few tries xd) |
|
Please update the comment at csi-proxy/internal/os/disk/api.go Line 36 in 2b7dc43 Windows allows you to create Reserved partitions as well for GPT: https://docs.microsoft.com/en-us/powershell/module/storage/new-partition?view=windowsserver2019-ps [Microsoft Reserved - "{e3c9e316-0b5c-4db8-817d-f92df00215ae}"] Instead of the change in the PR, how about listing partitions and skipping a single reserved partition if disk is GPT in csi-proxy/internal/server/disk/server.go Line 70 in 2b7dc43 |
|
What about making it just check for Basic partitions? (Type -eq Basic). since this is an internal function only used by |
I just pushed a change for what this looks like |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ddebroy, wongma7 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 |
| func (DiskAPI) PartitionsExist(diskNumber uint32) (bool, error) { | ||
| cmd := fmt.Sprintf("Get-Partition | Where DiskNumber -eq %d", diskNumber) | ||
| func (DiskAPI) BasicPartitionsExist(diskNumber uint32) (bool, error) { | ||
| cmd := fmt.Sprintf("Get-Partition | Where DiskNumber -eq %d | Where Type -eq Basic", diskNumber) |
There was a problem hiding this comment.
@wongma7 if it's a MBR disk, Type would be IFS, so this change would break existing MBR disk, and before 1.22, default windows disk type would be MBR disk, that's a breaking and incompatible change.
What type of PR is this?
/kind bug
What this PR does / why we need it: see #144: with gpt being default, there is some 128MB reserved partition at beginning of disk. LIke
Don't count it when checking if partition exists.
Which issue(s) this PR fixes:
Fixes #144
Special notes for your reviewer:
Does this PR introduce a user-facing change?: