-
Notifications
You must be signed in to change notification settings - Fork 917
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
propagate Secret
of type kubernetes.io/service-account-token
#4766
propagate Secret
of type kubernetes.io/service-account-token
#4766
Conversation
8a696f2
to
ae9f508
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #4766 +/- ##
=======================================
Coverage 51.79% 51.79%
=======================================
Files 250 250
Lines 24991 25004 +13
=======================================
+ Hits 12945 12952 +7
- Misses 11337 11339 +2
- Partials 709 713 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, you provided a new perspective.
However, this comment #4752 (comment) also reminded me that is your change backward compatible with k8s versions below v1.24?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
You can add the component name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The retain logic is modified in the current PR. However, retain is used when resources in member clusters are updated. If resources are created, will the UID and token information in the secret on the control plane be carried to the member cluster?
Kindly ping @a7i |
@XiShanYongYe-Chang Yes it will but we observed in our case that the member cluster kube-controller-manager will fix up the values and get ignored by karmada on update. Is there a "global" level ignore for CREATE as well? |
Maybe we can do it in the karmada/pkg/webhook/work/mutating.go Line 61 in eadf919
|
@XiShanYongYe-Chang done, I kept as two separate commits for easier review. Happy to rebase and squash if needed. |
It occurs a lint error:
|
@XiShanYongYe-Chang let me take a stab at refactoring this function in a separate PR and I'll come back to this after that's reviewed/merged |
Hi @a7i, CI errors may prevent PRs from being merged. |
I understand, hence why I'm suggesting to put a hold on this PR, until we refactor this function first (in a separate PR). |
Thanks @a7i, I got it :) |
Hi @a7i , now we can go on this PR. |
a56a8d9
to
81ff0aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice~
/lgtm
@@ -101,10 +102,77 @@ func Test_retainK8sWorkloadReplicas(t *testing.T) { | |||
t.Run(tt.name, func(t *testing.T) { | |||
got, err := retainWorkloadReplicas(tt.args.desired, tt.args.observed) | |||
if (err != nil) != tt.wantErr { | |||
t.Errorf("reflectPodDisruptionBudgetStatus() error = %v, wantErr %v", err, tt.wantErr) | |||
t.Errorf("retainWorkloadReplicas() error = %v, wantErr %v", err, tt.wantErr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch. thanks.
LGTM But would you mind squash commits? |
I do not mind at all! Was keeping them separate for easier review |
Signed-off-by: Amir Alavi <[email protected]>
a12498f
to
7dbfc9f
Compare
haha, your code is so clear that I don't have to review it by commits~ /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
gonna heading home now, good morning to you |
long day! I appreciate the thorough review and all the great feedback 🎉 |
I really really hope people like you join us in maintaining this project, can we get started from the org membership? |
Hi @RainbowMango and @XiShanYongYe-Chang I hope you would consider sponsoring me ❤️ |
perhaps @chaunceyjiang would consider 🙇🏼 |
definitly! |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Prior to kubernetes 1.24, Kubernetes controller-manager automatically created a Secret (with a long-lived token). Starting with 1.24, in order to create a Secret with long-lived token, you have to manually create a Secret and link it to the Service Account. Karmada currently doesn't support propagating this Secret as it is explicitly disabled.
Which issue(s) this PR fixes:
Fixes #4752
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Yes