cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

More nil checks for Version

Open luthermonson opened this issue 3 years ago • 4 comments
trafficstars

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

luthermonson avatar Oct 11 '22 18:10 luthermonson

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.

k8s-ci-robot avatar Oct 11 '22 18:10 k8s-ci-robot

@luthermonson Hi! 👋 Would you mind covering that with a unit test please? :)

/ok-to-test

Skarlso avatar Oct 11 '22 18:10 Skarlso

@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

luthermonson avatar Oct 15 '22 14:10 luthermonson

/lgtm /approve

Skarlso avatar Oct 20 '22 18:10 Skarlso

/hold

Skarlso avatar Oct 20 '22 18:10 Skarlso

@luthermonson Actually, would you mind writing a unit test around this if possible?

Skarlso avatar Oct 20 '22 18:10 Skarlso

@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.

luthermonson avatar Nov 07 '22 20:11 luthermonson

Yeah fair, I'll fix the validation of ipv6 in another pr. :) thanks!

/lgtm /approve

Skarlso avatar Nov 07 '22 20:11 Skarlso

[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

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 avatar Nov 07 '22 20:11 k8s-ci-robot

/test pull-cluster-api-provider-aws-e2e-blocking

Ankitasw avatar Nov 08 '22 16:11 Ankitasw

/unhold

Ankitasw avatar Nov 08 '22 17:11 Ankitasw