cluster-api-provider-aws
cluster-api-provider-aws copied to clipboard
More nil checks for Version
What type of PR is this? /kind bug
What this PR does / why we need it: Safer nil pointer checking on a string pointer so we attempt to parse an empty string if nil
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #3768
Special notes for your reviewer:
Checklist:
- [ ] squashed commits
- [ ] includes documentation
- [ ] adds unit tests
- [ ] adds or updates e2e tests
Hi @luthermonson. Thanks for your PR.
I'm waiting for a kubernetes-sigs 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. Regular contributors should join the org to skip this step.
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.
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/test-infra repository.
@luthermonson Hi! 👋 Would you mind covering that with a unit test please? :)
/ok-to-test
@Skarlso after re-reading the code i found that there was a nil check in validateEKSClusterNameSame and not in validateEKSVersion. ive updated the PR to just add a nil check in validateEKSVersion and i also for good measure added a nil check to old.Spec.Version in validateEKSClusterNameSame
/lgtm /approve
/hold
@luthermonson Actually, would you mind writing a unit test around this if possible?
@Skarlso I'd like to propose we don't gate this on a test as there are no tests for any of the validators and it's not just adding a couple lines to a test to get that tested. I would counter that we should merge this as is and standardize the validators with a type and write complete tests for all of them.
Yeah fair, I'll fix the validation of ipv6 in another pr. :) thanks!
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Skarlso
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [Skarlso]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/test pull-cluster-api-provider-aws-e2e-blocking
/unhold