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

🐛 Refresh external managed token secret if service account is deleted #504

Conversation

zhujian7
Copy link
Member

@zhujian7 zhujian7 commented Jun 6, 2024

Summary

Compare the uid of the service account to check if the service account is recreated.

Related issue(s)

similar PR: #458

Fixes #503

@@ -78,30 +79,6 @@ func SATokenGetter(ctx context.Context, saName, saNamespace string, saClient kub
}
}

// SATokenCreater create the saToken of target sa.
func SATokenCreater(ctx context.Context, saName, saNamespace string, saClient kubernetes.Interface) TokenGetterFunc {
Copy link
Member Author

Choose a reason for hiding this comment

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

The SATokenGetter func contains logic in the SATokenCreater func, seems this is not necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

/cc @zhiweiyin318 @xuezhaojun please take a look here

Copy link
Contributor

openshift-ci bot commented Jun 6, 2024

@zhujian7: GitHub didn't allow me to request PR reviews from the following users: please, take, a, look, here.

Note that only open-cluster-management-io members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @zhiweiyin318 @xuezhaojun please take a look 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-sigs/prow repository.

@zhujian7 zhujian7 changed the title Refresh external managed token secret if service account is deleted 🐛 Refresh external managed token secret if service account is deleted Jun 6, 2024
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.

Project coverage is 62.19%. Comparing base (84ec2b2) to head (d06d29e).
Report is 1 commits behind head on main.

Files Patch % Lines
...stermanagercontroller/clustermanager_controller.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #504      +/-   ##
==========================================
+ Coverage   62.15%   62.19%   +0.03%     
==========================================
  Files         140      140              
  Lines       11770    11758      -12     
==========================================
- Hits         7316     7313       -3     
+ Misses       3683     3673      -10     
- Partials      771      772       +1     
Flag Coverage Δ
unit 62.19% <11.11%> (+0.03%) ⬆️

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.

@zhujian7
Copy link
Member Author

zhujian7 commented Jun 6, 2024

/assign @elgnay
/cc @qiujian16

@openshift-ci openshift-ci bot requested a review from qiujian16 June 6, 2024 03:49
@zhujian7 zhujian7 force-pushed the refresh-token-uid branch from 8115497 to 3f0f3ae Compare June 6, 2024 07:21
@openshift-ci openshift-ci bot removed the approved label Jun 6, 2024
Signed-off-by: zhujian <jiazhu@redhat.com>
@zhujian7 zhujian7 force-pushed the refresh-token-uid branch from 3f0f3ae to d06d29e Compare June 6, 2024 08:03
@xuezhaojun
Copy link
Member

lgtm

@qiujian16
Copy link
Member

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Jun 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16, zhujian7

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-ci openshift-ci bot added the approved label Jun 6, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 00c39e2 into open-cluster-management-io:main Jun 6, 2024
14 checks passed
zhujian7 added a commit to zhujian7/ocm that referenced this pull request Jun 6, 2024
…open-cluster-management-io#504)

* Refresh external managed token secret if service account is deleted

Signed-off-by: zhujian <jiazhu@redhat.com>

* Debug e2e

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
openshift-merge-bot bot pushed a commit to stolostron/ocm that referenced this pull request Jun 7, 2024
…open-cluster-management-io#504) (#78)

* Refresh external managed token secret if service account is deleted



* Debug e2e



---------

Signed-off-by: zhujian <jiazhu@redhat.com>
zhujian7 added a commit to zhujian7/ocm that referenced this pull request Aug 30, 2024
…open-cluster-management-io#504) (open-cluster-management-io#78)

* Refresh external managed token secret if service account is deleted



* Debug e2e



---------

Signed-off-by: zhujian <jiazhu@redhat.com>
openshift-merge-bot bot pushed a commit to stolostron/ocm that referenced this pull request Sep 4, 2024
…s deleted (#117)

* Refresh external managed token secret if service account ns changes (open-cluster-management-io#458)

Signed-off-by: zhujian <jiazhu@redhat.com>

* 🐛 Refresh external managed token secret if service account is deleted (open-cluster-management-io#504) (#78)

* Refresh external managed token secret if service account is deleted



* Debug e2e



---------

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/ocm that referenced this pull request Sep 9, 2024
…open-cluster-management-io#504) (stolostron#78)

* Refresh external managed token secret if service account is deleted

* Debug e2e

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
openshift-merge-bot bot pushed a commit to stolostron/ocm that referenced this pull request Sep 10, 2024
…s deleted (#123)

* Refresh external managed token secret if service account ns changes (open-cluster-management-io#458)

Signed-off-by: zhujian <jiazhu@redhat.com>

* 🐛 Refresh external managed token secret if service account is deleted (open-cluster-management-io#504) (#78)

* Refresh external managed token secret if service account is deleted

* Debug e2e

---------

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
Co-authored-by: Jian Zhu <jiazhu@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants