Skip to content

proposal for supporting resource references #1057

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

Merged
merged 5 commits into from
Nov 17, 2021

Conversation

vijtrip2
Copy link
Contributor

@vijtrip2 vijtrip2 commented Nov 7, 2021

Issue #545

Description of changes:

  • Proposal for handling resource relationship in ACK custom resources.
  • View the rendered proposal here

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

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.

Great start on this @vijtrip2 ! i left few comments and questions to understand more the design aspects - didn't review the implementation part yet.

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.

I'm super happy with the overall formula for this proposal. It's a shame we have to create a separate reference field, rather than overriding the existing ones, but I understand the limitation.

I have some concerns regarding the format of the generator - I would like to reduce complexity for the service teams as much as possible and I think we can simplify it greatly. See the inline comments for more details.

@vijtrip2 vijtrip2 force-pushed the res-rel-proposal branch 2 times, most recently from 2222e6f to ef755f9 Compare November 9, 2021 04:19
Copy link
Collaborator

@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.

great start @vijtrip2! Some comments and suggestions inline for you!

Comment on lines 230 to 226
gt := "*ackv1alpha1.AWSResourceReference"
gtp := "*ackv1alpha1.AWSResourceReference"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jaypipes , can you please elaborate on this?

I am assuming that you are pointing towards taking the reference type as input(option/env variable) from user who performs make build-controller? The default will be ackv1alpha1.AWSResourceReference .
This will allow crossplane to generate CRDs compatible with their reference type.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe he's referring to the fact that crossplane has a separate set of config defaults that are used exclusively when running the ackgenerate crossplane verb - https://github.com/aws-controllers-k8s/code-generator/blob/main/pkg/generate/crossplane/config.go#L19

@ack-bot
Copy link
Collaborator

ack-bot commented Nov 9, 2021

@jaypipes: GitHub didn't allow me to request PR reviews from the following users: muvaf.

Note that only aws-controllers-k8s members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

We may want to make this configurable, since Crossplane has its own referencer type:

https://github.com/crossplane/crossplane-runtime/blob/5141d0bb35f4a42d23366d49b2a1d9fed9806c6c/apis/common/v1/resource.go#L89

/cc @muvaf

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.

Copy link
Contributor

@brycahta brycahta left a comment

Choose a reason for hiding this comment

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

Nice proposal; love the feature

Copy link
Collaborator

@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.

I still believe the is_list attribute can be removed...

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.

Looks essentially ready to me. I had 2 small nits.

Copy link
Collaborator

@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.

I think we've got a layering problem. See inline for a suggestion in how to rework the interface abstraction.

@vijtrip2
Copy link
Contributor Author

@jaypipes , do you think this is good enough to be merged now?

Copy link
Collaborator

@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.

Yeah, I'm good with this proposal as-is. I have some nits about code cleanup but will add those as review comments in the code PR. :)

@jaypipes
Copy link
Collaborator

/lgtm

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

ack-bot commented Nov 17, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaypipes, RedbackThomson, vijtrip2

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,vijtrip2]

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 3d0b232 into aws-controllers-k8s:main Nov 17, 2021
@Leweyy
Copy link

Leweyy commented Nov 18, 2021

Will this support getting fields from a service in the future? i.e getting a loadbalancer dns name to be used in an intergration as a url?

@vijtrip2 vijtrip2 deleted the res-rel-proposal branch November 18, 2021 15:27
@vijtrip2
Copy link
Contributor Author

Will this support getting fields from a service in the future? i.e getting a loadbalancer dns name to be used in an intergration as a url?

If you mean will the controller make AWS ELB Describe API call, and find LB dns name then No.
However we will extend the support for different api-groups, which will enable you to create a Load balancer using ACK ELB controller and then refer that resource to find LB dns name.

@Leweyy
Copy link

Leweyy commented Nov 18, 2021

Not quite, we currently use the k8s service to create load balancers and it would be nice if we could reference that service in an intergration to get the dns name. Other wise it’s a copy and paste job

@vijtrip2
Copy link
Contributor Author

@Leweyy, Can you please create a GH issue for the same so that in future ACK team can circle back on implementing such functionality.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants