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 Vpc resource #1

Merged
merged 6 commits into from
Aug 6, 2021
Merged

Add Vpc resource #1

merged 6 commits into from
Aug 6, 2021

Conversation

brycahta
Copy link
Contributor

@brycahta brycahta commented Aug 3, 2021

Issue: #489

  • Adding create/delete VPC functionality with smoke tests
  • Adding Makefile
  • Adding metadata file

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.

Super clean. Seems fairly straightforward and I hope will be a good basis for a lot of the other resources.

Biggest thing is just to remove the DryRun field from spec - add to list of ignored fields.

I've left some minor nits about code style, but nothing major from me otherwise.

apis/v1alpha1/vpc.go Outdated Show resolved Hide resolved
pkg/resource/vpc/hooks.go Outdated Show resolved Hide resolved
pkg/resource/vpc/hooks.go Outdated Show resolved Hide resolved
test/e2e/tests/test_vpc.py Outdated Show resolved Hide resolved
@vijtrip2
Copy link

vijtrip2 commented Aug 3, 2021

Looks solid beside incorporating Nick's comments.

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.

Great! Will let someone else check it out, but looks solid to me.

@a-hilaly
Copy link
Member

a-hilaly commented Aug 4, 2021

Neat 👍
/ok-to-test

@ack-bot ack-bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 4, 2021
@a-hilaly
Copy link
Member

a-hilaly commented Aug 4, 2021

holding until we add pre-submit jobs for ec2-controller (aws-controllers-k8s/test-infra#82)
/hold

@ack-bot ack-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 4, 2021
@jaypipes
Copy link
Contributor

jaypipes commented Aug 4, 2021

/unhold

@ack-bot ack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 4, 2021
Copy link
Contributor

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Nice work on this, @brycahta! Left some comments inline that are mostly to the ACK core team (/cc @vijtrip2 @RedbackThomson @a-hilaly) for things we need to do to the code-generator to avoid the need for some of the custom code you've had to place in here.


// The VPN tunnel options.
type TunnelOption struct {
DpdTimeoutAction *string `json:"dpdTimeoutAction,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

@brycahta "Dpd" here should be normalized to "DPD". If you'd like to submit a patch to the code-generator repo correcting this, @RedbackThomson or @a-hilaly can walk you through the process (it's a relatively simple change to https://github.com/aws-controllers-k8s/code-generator/blob/main/pkg/names/names.go)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when you say normalized does that mean it should be aligned with go styling?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, initialisms should be capitalized fully when exported and lowercases fully when not exported according to Go style guidelines: https://github.com/golang/go/wiki/CodeReviewComments#initialisms

// Information about the instances to which the volume is attached.
type VolumeStatusAttachmentStatus struct {
InstanceID *string `json:"instanceID,omitempty"`
IoPerformance *string `json:"ioPerformance,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise this should be normalized to "IOPerformance" (in a future PR to the code-generator, nothing to do for this PR)

@@ -1,4 +1,6 @@
ignore:
field_paths:
- CreateVpcInput.DryRun
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

pkg/resource/vpc/hooks.go Outdated Show resolved Hide resolved

// addIDToListRequest adds requested-resource VpcId to ListRequest. Return error to indicate to callers that the
// resource is not yet created.
func addIDToListRequest(r *resource, input *svcsdk.DescribeVpcsInput) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

And this function should not be necessary if the code-generator's pkg/generate/code.SetSDK generator function understood that for ReadMany operations, if it finds a field on the input shape that is the plural of an identifier field (in this case, VPCID -> VpcIds) then it should populate the input shape for the ReadMany operation with a slice of one element containing the resource's identifier field.

We can work on adding this functionality (we need it for S3 as well)

@aws-controllers-k8s aws-controllers-k8s deleted a comment from ack-bot Aug 4, 2021
@RedbackThomson
Copy link
Contributor

/retest

@RedbackThomson
Copy link
Contributor

Added the EC2 test role
/retest

Copy link
Contributor

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Nice. 👍

@jaypipes
Copy link
Contributor

jaypipes commented Aug 6, 2021

/lgtm

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

ack-bot commented Aug 6, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brycahta, jaypipes, 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 [RedbackThomson,jaypipes]

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 dcd55e0 into aws-controllers-k8s:main Aug 6, 2021
@brycahta brycahta deleted the vpc-dev branch July 5, 2022 15:49
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
6 participants