Skip to content

Commit 96debc4

Browse files
authored
Fixed non-expected warnings on TA webhook. (#2962)
Signed-off-by: Yuri Sa <[email protected]>
1 parent 326314c commit 96debc4

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.chloggen/fix-ta-check-policy.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: 'bug_fix'
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5+
component: target-allocator
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Fixed non-expected warnings on TA webhook.
9+
10+
# One or more tracking issues related to the change
11+
issues: [2685]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:

apis/v1beta1/collector_webhook.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ func (c CollectorWebhook) validateTargetAllocatorConfig(ctx context.Context, r *
344344
}
345345
// if the prometheusCR is enabled, it needs a suite of permissions to function
346346
if r.Spec.TargetAllocator.PrometheusCR.Enabled {
347-
if subjectAccessReviews, err := c.reviewer.CheckPolicyRules(ctx, r.GetNamespace(), r.Spec.TargetAllocator.ServiceAccount, targetAllocatorCRPolicyRules...); err != nil {
347+
if subjectAccessReviews, err := c.reviewer.CheckPolicyRules(ctx, r.Spec.TargetAllocator.ServiceAccount, r.GetNamespace(), targetAllocatorCRPolicyRules...); err != nil {
348348
return nil, fmt.Errorf("unable to check rbac rules %w", err)
349349
} else if allowed, deniedReviews := rbac.AllSubjectAccessReviewsAllowed(subjectAccessReviews); !allowed {
350350
return rbac.WarningsGroupedByResource(deniedReviews), nil

0 commit comments

Comments
 (0)