-
Notifications
You must be signed in to change notification settings - Fork 295
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
🐛 Fix watch & log of ProviderServiceAccount controller #2592
🐛 Fix watch & log of ProviderServiceAccount controller #2592
Conversation
Signed-off-by: Stefan Büringer [email protected]
/assign @srm09 @zhanggbj @chrischdi |
Somewhat related to #2284 |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2592 +/- ##
==========================================
+ Coverage 64.61% 64.81% +0.20%
==========================================
Files 118 118
Lines 8574 8578 +4
==========================================
+ Hits 5540 5560 +20
+ Misses 2600 2590 -10
+ Partials 434 428 -6 ☔ View full report in Codecov by Sentry. |
@@ -131,17 +139,10 @@ type ServiceAccountReconciler struct { | |||
func (r *ServiceAccountReconciler) Reconcile(ctx context.Context, req reconcile.Request) (_ reconcile.Result, reterr error) { | |||
log := ctrl.LoggerFrom(ctx) | |||
|
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.
VSphereCluster k/v pair is now added correctly by controller-runtime
@@ -254,9 +261,7 @@ func (r *ServiceAccountReconciler) ensureProviderServiceAccounts(ctx context.Con | |||
|
|||
for i, pSvcAccount := range pSvcAccounts { | |||
// Note: We have to use := here to not overwrite log & ctx outside the for loop. |
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.
Now that the request is properly added as a "VSphereCluster" k/v pair and not as "ProviderServiceAccount" we can simply set "ProviderServiceAccount" as a k/v pair here
/lgtm |
LGTM label has been added. Git tree hash: c95616f9852b863574294d5f088bb96bb4324f67
|
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.
/lgtm
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.
/lgtm
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi 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 |
Signed-off-by: Stefan Büringer [email protected]
What this PR does / why we need it:
The ProviderServiceAccount reconciler is actually reconciling VSphereClusters so the
For
should reflect that to ensure correct logging k/v pairs (For is used the determine the log key that is combined with the log value from the request).To ensure correct controller name (which also ends up in logs and metrics) we have to then set
Named
. Otherwise the controller name is inferred fromFor
.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 #