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

Add Subnet resource #4

Merged
merged 10 commits into from
Aug 23, 2021
Merged

Add Subnet resource #4

merged 10 commits into from
Aug 23, 2021

Conversation

brycahta
Copy link
Contributor

Issue: #489

Changes

  • Adds create/delete Subnet functionality with smoke tests
  • Adds terminal_codes for Subnet. Triggered when users try to create Subnet with malformed or invalid VpcId
    • related: attempting to delete VPC with Subnet attached will result in DependencyViolation which will requeue the delete with backoff (default behavior) until user resolves
  • Adds helm artifacts

Testing

  • Tested controller locally with go run
  • make kind-test
[gw2] [ 33%] PASSED tests/test_subnet.py::TestSubnet::test_terminal_condition
[gw3] [ 66%] PASSED tests/test_vpc.py::TestVpc::test_smoke
[gw0] [100%] PASSED tests/test_subnet.py::TestSubnet::test_crud

======================================================================= 3 passed in 54.60s =======================================================================

@ack-bot
Copy link
Collaborator

ack-bot commented Aug 18, 2021

Hi @brycahta. 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-bot ack-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 18, 2021
return boto3.client("ec2")

@pytest.fixture(scope="module")
def vpc_resource():
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intent is to move this to a helpers.py file once I get more resources implemented. This way I can test VPC separately, then have another VPC (just one) to be used by other tests. Also, this should mitigate concerns with vpc quotas when testing locally.

@RedbackThomson
Copy link
Contributor

Looks straightforward. Do your ReadMany changes in the generator not help here?

apis/v1alpha1/types.go Show resolved Hide resolved
pkg/resource/subnet/hooks.go Outdated Show resolved Hide resolved
test/e2e/tests/test_subnet.py Outdated Show resolved Hide resolved
test/e2e/tests/test_subnet.py Outdated Show resolved Hide resolved
assert k8s.get_resource_exists(ref)

assert k8s.assert_condition_state_message(
ref, "ACK.Terminal", "True", "The vpc ID 'InvalidVpcId' does not exist"
Copy link
Contributor

Choose a reason for hiding this comment

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

++

@RedbackThomson
Copy link
Contributor

/ok-to-test

@ack-bot ack-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 Aug 18, 2021
@brycahta
Copy link
Contributor Author

Looks straightforward. Do your ReadMany changes in the generator not help here?

Yeah, they do but only 1/2 are merged right now (working on revision) and it was unclear to me if I should wait until another release is cut with those features or not. Any suggestions?

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@@ -1138,6 +1182,7 @@ type ImportVolumeTaskDetails struct {

// Describes an instance.
type Instance struct {
AmiLaunchIndex *int64 `json:"amiLaunchIndex,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

not sure, but should this be AMILaunchIndex?

pkg/resource/subnet/hooks.go Outdated Show resolved Hide resolved
Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

/lgtm
Ship it!

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Aug 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, brycahta, RedbackThomson

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:
  • OWNERS [A-Hilaly,RedbackThomson]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit c362e4b into aws-controllers-k8s:main Aug 23, 2021
@brycahta brycahta deleted the subnet-time branch August 23, 2021 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged. 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.

4 participants