-
Notifications
You must be signed in to change notification settings - Fork 50
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
new resource ec2launch template and test caes #151
base: main
Are you sure you want to change the base?
new resource ec2launch template and test caes #151
Conversation
Hi @rkurduka. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff, thank you @rkurduka ! I left few comments in-line
# Validate LaunchTemplate | ||
launch_template = ec2_validator.get_launch_template(resource_id) | ||
assert launch_template["LaunchTemplateId"] == resource_id | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also add an update test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To update launch template only one parameter is supported in "ModifyLaunchTemplate" SDK API call.
- DefaultVersionNumber -- for this to test , there has to be multiple "launchtemplateversions" must be available and "launchtemplateversion" is separate resource in EC2. So once we have that , so we can add update test case here for it.
Note:
update tags is not supported "ModifyLaunchTemplate" SDK API call , which is used in SDKUPDATE function, hence not added update test case yet .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the clearance! We could support add some hooks to call CreateTags
/UpdateTags
for the Spec.Tags
field?
If i understand well, this funciton can be used with any ec2 resource? https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes , looking into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added tags -creation/update logic , including test cases for it as well .
29f48f7
to
dc920e9
Compare
fixed - conflicts |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rkurduka 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 |
1 similar comment
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rkurduka 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!! Thank you @rkurduka !
I have few comments/questions bellow.
func (rm *resourceManager) setDefaultTemplateVersion(r *resource, input *svcsdk.ModifyLaunchTemplateInput) error { | ||
|
||
if r.ko.Spec.DefaultVersionNumber != nil { | ||
input.SetDefaultVersion(strconv.Itoa(int(*r.ko.Spec.DefaultVersionNumber))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the API accept an int the create but a string in the update... wow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In "CreateLaunchTemplate" we dont need to provide "DefaultTemplateVersion" - but once it is created. In "DescribeLaunchTemplateOutput" Its *int64 , So while modifying same attribute in ModifyLaunchTemplate its *string , hence conversion is require
# Validate LaunchTemplate | ||
launch_template = ec2_validator.get_launch_template(resource_id) | ||
assert launch_template["LaunchTemplateId"] == resource_id | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the clearance! We could support add some hooks to call CreateTags
/UpdateTags
for the Spec.Tags
field?
If i understand well, this funciton can be used with any ec2 resource? https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html
# Check LaunchTemplate no longer exists in AWS | ||
ec2_validator.assert_launch_template(resource_id, exists=False) | ||
|
||
def test_terminal_condition_invalid_parameter_value(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
# Validate LaunchTemplate | ||
launch_template = ec2_validator.get_launch_template(resource_id) | ||
assert launch_template["LaunchTemplateId"] == resource_id | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issues go stale after 180d of inactivity. |
Is there anything particular blocking this PR from being merged, other than having a merge conflict after having been stale for 6m? |
@rkurduka ok if i cherry pick your changes to keep working on the changes you started so we can get this functionality in? |
@kejne please go for it :) |
@rkurduka: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
@kejne are you still thinking of picking up this PR? |
I'm afraid other projects fit our use case better, so haven't looked further into it. |
@kejne no worries :) may I ask what projects are you using to workaround this and manage launch templates? |
It wasn't really just about Launch Templates, but more of the whole. For example, since we will be leveraging multiple cloud providers we are leaning more towards Crossplane atm. |
Hi everyone. This is a rather critical feature of ACK imo as it's a showstopper for customizing managed EKS nodes. Any chance we could revisit this PR? |
My comment from related PR #155 (comment) |
Issue #, if available:
1841
Description of changes:
New resource added - LaunchTemplate
Test cases added.
Features:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.