Skip to content
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

Fix NPE in vSphere etcd machine datastore usage calculation #8245

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

abhay-krishna
Copy link
Member

@abhay-krishna abhay-krishna commented Jun 4, 2024

The vSphere datastore usage logic for etcd machine configs has a bug in the specific scenario where we upgrade from a stacked etcd cluster to an unstacked etcd cluster. In this case, the previous cluster's ExternalEtcdConfiguration object will be nil, but we try to access its Count field without checking for nilness, which causes a panic in the validation phase. This PR adds a nil check to the object so that we can safely dereference it, along with unit tests to cover this logic.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from abhay-krishna. For more information see the Kubernetes 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

@eks-distro-bot eks-distro-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 4, 2024
@eks-distro-bot eks-distro-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 4, 2024
@rahulbabu95
Copy link
Member

/lgtm

@abhay-krishna abhay-krishna merged commit 9919e6c into aws:main Jun 11, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm 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.

3 participants