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

Capacity reservations feature implementation #235

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

fizashaikh
Copy link

Issue: aws-controllers-k8s/community#2234

Description of changes:
This change implements capacity reservations feature in ec2 operator.
It adds e2e tests for the capacity reservations CRUD functionality.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

ack-prow bot commented Jan 29, 2025

Hi @fizashaikh. 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 /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.

@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 29, 2025
@ack-prow ack-prow bot requested review from a-hilaly and jlbutler January 29, 2025 01:26
Copy link

ack-prow bot commented Jan 29, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fizashaikh
Once this PR has been reviewed and has the lgtm label, please assign a-hilaly for approval by writing /assign @a-hilaly in a comment. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fizashaikh fizashaikh changed the title Capacity reservations feature Capacity reservations feature implementation Jan 29, 2025
@a-hilaly
Copy link
Member

a-hilaly commented Feb 4, 2025

/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 4, 2025
@a-hilaly
Copy link
Member

a-hilaly commented Feb 4, 2025

at first glance, this LGTM, @michaelhtm can you PTAL

@fizashaikh
Copy link
Author

/test ec2-verify-attribution

Copy link
Member

@michaelhtm michaelhtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @fizashaikh, thanks for contributing!
Everything lgtm, can you please resolve the conflict?
Thanks

@fizashaikh
Copy link
Author

Hey @fizashaikh, thanks for contributing! Everything lgtm, can you please resolve the conflict? Thanks

Thanks for reviewing @michaelhtm ! All conflicts are resolved now 👍
Thanks!

Copy link
Member

@michaelhtm michaelhtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fizashaikh. apologies for the back and forth. I have a couple more comments about this PR. Thanks!

AvailabilityZoneID *string `json:"availabilityZoneID,omitempty"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
// of the request. For more information, see Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `json:"clientToken,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we ignore clientToken? it might lead to some issues..if it's required we can randomly generate the value using custom code

// actually making the request, and provides an error response. If you have
// the required permissions, the error response is DryRunOperation. Otherwise,
// it is UnauthorizedOperation.
DryRun *bool `json:"dryRun,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also ignore DryRun?

Comment on lines +84 to +94
EndDate *metav1.Time `json:"endDate,omitempty"`
// Indicates the way in which the Capacity Reservation ends. A Capacity Reservation
// can have one of the following end types:
//
// - unlimited - The Capacity Reservation remains active until you explicitly
// cancel it. Do not provide an EndDate if the EndDateType is unlimited.
//
// - limited - The Capacity Reservation expires automatically at a specified
// date and time. You must provide an EndDate value if the EndDateType value
// is limited.
EndDateType *string `json:"endDateType,omitempty"`
Copy link
Member

@michaelhtm michaelhtm Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not sure if this should be required, but can we have custom code validating the assignment of these fields?

//
// You can request a future-dated Capacity Reservation between 5 and 120 days
// in advance.
StartDate *metav1.Time `json:"startDate,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

î same for this one? with end-date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants