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

Added lookup for fields of type AWSResourcesReference #3257

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

Ankitasw
Copy link
Member

@Ankitasw Ankitasw commented Feb 25, 2022

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR does following:

  • Remove unused conversion functions in APIs.
  • Deprecate ARN field from AWSResourceReference.
  • Add lookup for AdditionalSecurityGroups with filters.
  • Refactored code for GetAdditionalSecurityGroupIDs so as to use common function in AWSMachine controller and launchtemplate.go.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2087

Special notes for your reviewer:
Subset PR that handles the same for Subnet fields in AWSMachinePool

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

- Remove unused conversion functions in APIs.
- Deprecate `ARN` field from `AWSResourceReference`.
- Add lookup for `AdditionalSecurityGroups` with filters.
- Code refactor for  `GetAdditionalSecurityGroupIDs` to use common function in `AWSMachine` controller and `launchtemplate.go`.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 25, 2022
@k8s-ci-robot
Copy link
Contributor

@Ankitasw: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 25, 2022
@Ankitasw
Copy link
Member Author

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

@Ankitasw
Copy link
Member Author

/test pull-cluster-api-provider-aws-e2e

@Ankitasw Ankitasw changed the title [WIP] Added lookup for fields of type AWSResourcesReference Added lookup for fields of type AWSResourcesReference Feb 28, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 28, 2022
@sedefsavas
Copy link
Contributor

This PR has contradicting changes with #3255
We need to consolidate two and use a common approach as both touching the same methods.

For example, filters are used in SDK calls here: https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3255/files

pkg/cloud/services/ec2/instances.go Outdated Show resolved Hide resolved
exp/controllers/awsmachinepool_controller.go Outdated Show resolved Hide resolved
@Ankitasw
Copy link
Member Author

Ankitasw commented Mar 2, 2022

This PR has contradicting changes with #3255
We need to consolidate two and use a common approach as both touching the same methods.
For example, filters are used in SDK calls here: https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3255/files

We already have one existing PR for this which is not concluded yet, so it also conflicts with #3255.
What I can do is add one of them as coauthor and add all instances in this PR only.
Difference between two existing PR:
#2634 : handles usage of subnet with filters based on criteria like subnet state and AZ and then use DescribeSubnet to lookup for the resources.
#3255: handles usage of subnet with input filters.

Also, I am ok to hold this PR, till the above discussion is concluded.

@Ankitasw Ankitasw requested a review from sedefsavas March 2, 2022 08:13
@sedefsavas
Copy link
Contributor

Also, I think we can remove ARN from AWSResourceReference given that Describe SDK call inputs do not have this option so writing a search using ARNs will be difficult.

Currently, that field is no-op if users set it, so we should not allow that being set at all.

@Ankitasw
Copy link
Member Author

Ankitasw commented Mar 2, 2022

Also, I think we can remove ARN from AWSResourceReference given that Describe SDK call inputs do not have this option so writing a search using ARNs will be difficult.
Currently, that field is no-op if users set it, so we should not allow that being set at all.

Will take care of that in this PR itself.

@Ankitasw Ankitasw changed the title Added lookup for fields of type AWSResourcesReference [WIP] Added lookup for fields of type AWSResourcesReference Mar 2, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 7, 2022
@Ankitasw Ankitasw force-pushed the resource-ref-lookup branch 2 times, most recently from daefb52 to 1d0e7e9 Compare March 8, 2022 11:21
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 8, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 30, 2022
@Ankitasw
Copy link
Member Author

@richardcase rebased the PR.

@Ankitasw
Copy link
Member Author

/retest

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-test

@Ankitasw
Copy link
Member Author

Ankitasw commented Apr 1, 2022

Fixed the unit tests failing due to rebase.

@Ankitasw
Copy link
Member Author

Ankitasw commented Apr 1, 2022

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-e2e-eks

@Ankitasw
Copy link
Member Author

Ankitasw commented Apr 1, 2022

@richardcase i think eks tests are failing continuously for some reason(which I didn't check) https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api-provider-aws#periodic-eks-e2e-main

@Ankitasw
Copy link
Member Author

Ankitasw commented Apr 4, 2022

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 4, 2022

@Ankitasw: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-aws-apidiff-main 369bb69 link false /test pull-cluster-api-provider-aws-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@Ankitasw
Copy link
Member Author

Ankitasw commented Apr 4, 2022

@richardcase @sedefsavas Rebased the PR and now tests are passing.

@Ankitasw
Copy link
Member Author

Ankitasw commented Apr 5, 2022

@sedefsavas now that we have a CAPA release, can we take this PR ahead for closure?

@Ankitasw
Copy link
Member Author

Ankitasw commented Apr 7, 2022

Reminder for PR review.

@richardcase
Copy link
Member

Seems good to me:

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 11, 2022
@Ankitasw
Copy link
Member Author

cc @sedefsavas for approval.

@Ankitasw
Copy link
Member Author

@sedefsavas I think this PR is ready to merge but feel free to review again.

@sedefsavas
Copy link
Contributor

/approve

@sedefsavas sedefsavas merged commit 5b22802 into kubernetes-sigs:main Apr 18, 2022
@k8s-ci-robot k8s-ci-robot modified the milestones: v1.5.0, v1.x Apr 18, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

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:

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 18, 2022
@Ankitasw Ankitasw deleted the resource-ref-lookup branch November 9, 2022 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWSResourceReference unimplemented logic
6 participants