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

🐛 Accept empty string SSHKeyName in AWSCluster & AWSMachine validation webhooks #2308

Merged

Conversation

dlipovetsky
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:
Makes the AWSCluster & AWSMachine validation webhooks accept an empty string for SSHKeyName. That value is supported by the API.

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 #2306

Special notes for your reviewer:

  • The webhook test files have slightly different sets of SSHKeyName validation tests. The SSHKeyName field is common to both AWSCluster and AWSMachine, so I think there should be one set of tests for the field. I can do this in a follow-up PR. WDYT?
  • The first two commits add tests; they are expected to fail. The third commit adds the fix.

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Fix the AWSCluster & AWSMachine validation webhooks, so that they accept an empty string for the `SSHKeyName` field.

@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 Mar 18, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 18, 2021
@randomvariable
Copy link
Member

/lgtm
/approve

@randomvariable
Copy link
Member

thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 18, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: randomvariable

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 Mar 18, 2021
@dlipovetsky
Copy link
Contributor Author

api/v1alpha3/webhooks.go:35: File is not `gofmt`-ed with `-s` (gofmt)

Sorry, a lint (gofmt) issue. Will fix and force-push. Ironically, it's complaining about a missing newline at the end of the file. Meanwhile, the same commit fixed the imports 😂

@dlipovetsky dlipovetsky force-pushed the ssh-key-name-validation branch from 14dc07b to 92eeda4 Compare March 18, 2021 20:43
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 18, 2021
@dlipovetsky
Copy link
Contributor Author

@randomvariable Thanks for the review! I hope this makes it into the next release 😄

@sedefsavas
Copy link
Contributor

/lgtm

Also @dlipovetsky +1 to have a single set of tests.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 19, 2021
@k8s-ci-robot k8s-ci-robot merged commit 5d3c762 into kubernetes-sigs:master Mar 19, 2021
@dlipovetsky
Copy link
Contributor Author

Thanks for the review @sedefsavas!

@dlipovetsky dlipovetsky deleted the ssh-key-name-validation branch March 19, 2021 20:32
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation webhook forbids empty string SSH key value
4 participants