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

Replace snow instance type exact match with regex validation #4895

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

jiayiwang7
Copy link
Member

Issue #, if available:

#4889 and #4891 introduced new snow instance type validation where we fetch the instance type metadata dynamically from aws go SDK DescribeInstanceTypes and see if the instance type specified in each SnowMachineConfig is within the supported instance type list and is valid.

Description of changes:

This PR removes the exact match of the snow instance type in API context unaware validation, and replace it with regex, which is more flexible and will support newer instance type in the future.

Testing (if applicable):

Unit tests + manual e2e

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 eks-distro-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 9, 2023
@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Merging #4895 (3e5c367) into main (f7464f3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #4895   +/-   ##
=======================================
  Coverage   71.61%   71.62%           
=======================================
  Files         419      419           
  Lines       34210    34207    -3     
=======================================
  Hits        24501    24501           
+ Misses       8179     8177    -2     
+ Partials     1530     1529    -1     
Impacted Files Coverage Δ
pkg/api/v1alpha1/snowmachineconfig_types.go 52.83% <ø> (ø)
pkg/api/v1alpha1/snowmachineconfig.go 93.68% <100.00%> (-0.20%) ⬇️
pkg/providers/snow/validator.go 95.38% <100.00%> (ø)
pkg/providers/vsphere/vsphere.go 63.00% <0.00%> (+0.42%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jiayiwang7 jiayiwang7 requested a review from d8660091 February 9, 2023 15:07
@d8660091
Copy link
Member

d8660091 commented Feb 9, 2023

/lgtm

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@d8660091
Copy link
Member

d8660091 commented Feb 9, 2023

/lgtm

@eks-distro-bot eks-distro-bot merged commit e0073df into aws:main Feb 9, 2023
@jiayiwang7
Copy link
Member Author

/cherrypick release-0.14

@eks-distro-pr-bot
Copy link
Contributor

@jiayiwang7: #4895 failed to apply on top of branch "release-0.14":

Applying: Replace snow instance type exact match with regex validation
Using index info to reconstruct a base tree...
M	config/manifest/eksa-components.yaml
M	internal/pkg/api/snow.go
M	internal/pkg/api/snowmachines.go
A	test/e2e/snow_test.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): test/e2e/snow_test.go deleted in HEAD and modified in Replace snow instance type exact match with regex validation. Version Replace snow instance type exact match with regex validation of test/e2e/snow_test.go left in tree.
Auto-merging internal/pkg/api/snowmachines.go
Auto-merging internal/pkg/api/snow.go
Auto-merging config/manifest/eksa-components.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Replace snow instance type exact match with regex validation
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-0.14

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved 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.

4 participants