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

✨ Starting aws registration by spoke by assuming IAM role on startup and adding annotations to ManagedCluster CR #714

Conversation

jaswalkiranavtar
Copy link
Contributor

@jaswalkiranavtar jaswalkiranavtar commented Nov 21, 2024

Summary

This PR contains

  • AWS role assumption on start up by spoke
  • Adding annotations to ManagedCluster CR so that hub can recognize it as a registration request with AWS IAM auth
  • Mounting dot-aws directory needed by aws-cli

Related issue(s)

#514

@openshift-ci openshift-ci bot requested review from haowells and ldpliu November 21, 2024 23:01
@jaswalkiranavtar jaswalkiranavtar force-pushed the feature/start-aws-registration branch from 81fc233 to 259ab9a Compare November 21, 2024 23:11
@jaswalkiranavtar jaswalkiranavtar force-pushed the feature/start-aws-registration branch 2 times, most recently from 67c342a to a41f367 Compare November 21, 2024 23:15
@jaswalkiranavtar jaswalkiranavtar changed the title Starting aws registration by spoke by assuming IAM role on startup and adding annotations to ManagedCluster CR (:sparkles:) Starting aws registration by spoke by assuming IAM role on startup and adding annotations to ManagedCluster CR Nov 21, 2024
@jaswalkiranavtar jaswalkiranavtar changed the title (:sparkles:) Starting aws registration by spoke by assuming IAM role on startup and adding annotations to ManagedCluster CR ✨ Starting aws registration by spoke by assuming IAM role on startup and adding annotations to ManagedCluster CR Nov 21, 2024
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 58.18182% with 23 lines in your changes missing coverage. Please review.

Project coverage is 63.43%. Comparing base (2710e0e) to head (2ab4069).

Files with missing lines Patch % Lines
pkg/common/helpers/aws.go 0.00% 7 Missing ⚠️
pkg/registration/spoke/options.go 0.00% 5 Missing and 1 partial ⚠️
...lers/klusterletcontroller/klusterlet_controller.go 86.48% 4 Missing and 1 partial ⚠️
pkg/registration/spoke/spokeagent.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #714      +/-   ##
==========================================
+ Coverage   63.41%   63.43%   +0.01%     
==========================================
  Files         185      186       +1     
  Lines       17802    17843      +41     
==========================================
+ Hits        11290    11318      +28     
- Misses       5581     5591      +10     
- Partials      931      934       +3     
Flag Coverage Δ
unit 63.43% <58.18%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@mikeshng
Copy link
Member

/assign @qiujian16

@mikeshng
Copy link
Member

Hi @zhujian7 @zhiweiyin318 @dongbeiqing91

Bulk of the changes in this PR is related to the operator. Could you PTAL whenever you have some cycles? Thanks.

…d adding annotations to ManagedCluster CR

Signed-off-by: Erica Jin <132393634+EricaJ6@users.noreply.github.com>
@jaswalkiranavtar jaswalkiranavtar force-pushed the feature/start-aws-registration branch from a41f367 to 430d3ff Compare November 22, 2024 17:34
Signed-off-by: Erica Jin <132393634+EricaJ6@users.noreply.github.com>
Copy link
Member

@mikeshng mikeshng left a comment

Choose a reason for hiding this comment

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

This is great! Thank you for your contribution!

Left some comments. Regarding showing the error on klusterlet condition, maybe wait for the operator maintainers and/or Qiu Jian's feedback.

Signed-off-by: Erica Jin <132393634+EricaJ6@users.noreply.github.com>
@jaswalkiranavtar
Copy link
Contributor Author

This is great! Thank you for your contribution!

Left some comments. Regarding showing the error on klusterlet condition, maybe wait for the operator maintainers and/or Qiu Jian's feedback.

Addressed comments other than adding failure conditions. Please show us a sample on how to add failure condition.

Signed-off-by: Erica Jin <132393634+EricaJ6@users.noreply.github.com>
@jaswalkiranavtar
Copy link
Contributor Author

jaswalkiranavtar commented Nov 26, 2024

Thanks for approving api repo PR. Do you have any further comments on this one?

Copy link
Member

@mikeshng mikeshng left a comment

Choose a reason for hiding this comment

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

Great work on this PR!

Huge thank you to all the code reviewers for taking the time to provide valuable feedback. I’ve ensured that all your comments have been addressed. If there are any additional concerns, @jaswalkiranavtar and his team will address them in another PR quickly.

Typically, I am not the one to approve PRs involving this area of the codebase. However, I’m making an exception here as, based on my review, all changes are contained within the hub on EKS associated flags. This containment minimizes the risk of regression to the main/latest branch. To accommodate the contributors' schedules and planning, I’m approving this merge based on the prior reviews, comments, and my own assessment.

/approve

/lgtm

Copy link
Member

@jnpacker jnpacker left a comment

Choose a reason for hiding this comment

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

Reviewed the code and comments. /LGTM

Copy link
Contributor

openshift-ci bot commented Nov 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaswalkiranavtar, jnpacker, mikeshng

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

@openshift-merge-bot openshift-merge-bot bot merged commit 93db6de into open-cluster-management-io:main Nov 26, 2024
14 checks passed
@jaswalkiranavtar jaswalkiranavtar deleted the feature/start-aws-registration branch November 29, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants