Skip to content

test(metrics): add functional tests verifying component_sent_bytes_total carries component_id labels - #3379

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
Clee2691:LOG-9671-master
Jul 30, 2026
Merged

test(metrics): add functional tests verifying component_sent_bytes_total carries component_id labels#3379
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
Clee2691:LOG-9671-master

Conversation

@Clee2691

@Clee2691 Clee2691 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

This PR is a manual cherry-pick of #3348.

This PR also adds a test for AWS S3 along with setup for metrics auth.

/cc @vparfonov
/assign @jcantrill

Links

Summary by CodeRabbit

  • Tests
    • Added functional-test helpers to set up access to the collector in-cluster /metrics endpoint and poll until expected metrics appear.
    • Added/extended regression coverage for CloudWatch, S3, and HTTP outputs to verify component_id labeling and ensure region is present where expected.
  • Bug Fixes
    • Strengthened metric validations to catch duplicate or incomplete label sets in output sent-byte metrics.

@Clee2691

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-6.6

@openshift-cherrypick-robot

Copy link
Copy Markdown

@Clee2691: once the present PR merges, I will cherry-pick it on top of release-6.6 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-6.6

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.

@qodo-for-rh-openshift

qodo-for-rh-openshift Bot commented Jul 29, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Add functional metrics tests for component_sent_bytes_total label integrity

🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Add a framework helper to poll collector /metrics over authenticated HTTPS.
• Add regression tests for CloudWatch and S3 outputs to verify component_id/region labels.
• Add an HTTP output “positive control” test ensuring component_id labeling remains present.
Diagram

graph TD
  T["Ginkgo functional tests"] --> R["RBAC: /metrics access"] --> H["CollectMetricLines()"] --> P["Collector pod"] --> E["/metrics HTTPS endpoint"]
  H --> C["curl + SA token"] --> E
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Factor RBAC + metrics polling into shared test utilities
  • ➕ Removes repeated ClusterRole/Binding setup across output tests
  • ➕ Centralizes timeouts/polling behavior to reduce flakiness and ease tuning
  • ➕ Makes it easier to add new output metric-label tests consistently
  • ➖ Small upfront refactor cost and churn in multiple test files
  • ➖ May need careful naming/lifecycle handling to avoid resource collisions in parallel runs
2. Query metrics via Kubernetes API proxy instead of in-pod curl
  • ➕ Avoids relying on curl availability and shell invocation in the collector container
  • ➕ Uses a single access path that can be reused across tests
  • ➖ More complex client-side setup and permissions (proxy, TLS, auth)
  • ➖ May behave differently than in-pod access, reducing fidelity to current scrape path

Recommendation: The current approach (in-pod curl with explicit RBAC and polling) is pragmatic and close to how the endpoint is secured. Consider a follow-up to extract the repeated RBAC setup and metric polling into a shared helper to reduce duplication across output suites and make future metric assertions easier to add.

Files changed (4) +267 / -17

Tests (4) +267 / -17
metrics.goAdd authenticated /metrics polling helper for functional tests +41/-0

Add authenticated /metrics polling helper for functional tests

• Introduces CollectMetricLines on CollectorFunctionalFramework to repeatedly curl the collector’s HTTPS /metrics endpoint using the pod’s serviceaccount token. Filters and returns metric lines matching a given name once a required substring is observed or timeout occurs.

test/framework/functional/metrics.go

forward_to_cloudwatch_test.goAdd [LOG-7893](https://redhat.atlassian.net/browse/LOG-7893) regression test for CloudWatch bytes-sent metric labels +77/-0

Add LOG-7893 regression test for CloudWatch bytes-sent metric labels

• Adds RBAC setup/teardown to allow functional tests to read /metrics and perform token reviews. Adds a regression test asserting component_sent_bytes_total includes component_id and that CloudWatch lines also include region, while flagging any unlabeled duplicates.

test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go

forward_to_s3_test.goAdd [LOG-7893](https://redhat.atlassian.net/browse/LOG-7893) regression test for S3 bytes-sent metric labels +78/-0

Add LOG-7893 regression test for S3 bytes-sent metric labels

• Imports strings/RBAC and adds RBAC setup/teardown for authenticated metric reads. Adds a regression test asserting component_sent_bytes_total includes component_id and that S3 lines include region, while detecting any unlabeled duplicates.

test/functional/outputs/aws/s3/forward_to_s3_test.go

forward_to_http_test.goAdd HTTP output metric-label control test and simplify tuning visitor +71/-17

Add HTTP output metric-label control test and simplify tuning visitor

• Refactors the compression tuning table to avoid per-test framework re-initialization and inlines the destination container visitor. Adds RBAC setup plus a positive-control test that polls for component_sent_bytes_total with component_id="output_http" to validate expected labeling behavior.

test/functional/outputs/http/forward_to_http_test.go

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Changes

Adds shared RBAC and Prometheus metric scraping helpers, then uses them in CloudWatch, S3, and HTTP functional tests to validate output metric labels. The HTTP test also refactors compression setup and destination wiring.

Collector metrics

Layer / File(s) Summary
Metrics RBAC and scraping helpers
test/framework/functional/metrics.go
Adds cluster-scoped RBAC setup and polling of the collector’s /metrics endpoint with metric filtering and completion matching.
AWS output metric assertions
test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go, test/functional/outputs/aws/s3/forward_to_s3_test.go
Adds CloudWatch and S3 regression tests that validate component_sent_bytes_total component and region labels.
HTTP output metric coverage and test wiring
test/functional/outputs/http/forward_to_http_test.go
Adds HTTP metric validation and refactors compression configuration and destination visitor setup.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: vparfonov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: functional tests around component_sent_bytes_total labels.
Description check ✅ Passed The description includes the required summary, /cc, /assign, and a Links section with the related JIRA issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
test/functional/outputs/http/forward_to_http_test.go (1)

245-259: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert on the collected lines instead of only logging them.

The only real gate here is the waitFor timeout; unlike the CloudWatch/S3 tests, unlabeled duplicates of component_sent_bytes_total would pass silently. Add the same per-line component_id assertion so this positive control is meaningful.

♻️ Proposed change
 			lines, err := framework.CollectMetricLines("component_sent_bytes_total", `component_id="output_http"`, 30*time.Second)
 			Expect(err).To(BeNil(), "Timed out waiting for component_sent_bytes_total with component_id label")
 
-			log.V(2).Info("matched metric lines", "lines", lines)
+			for _, line := range lines {
+				log.V(2).Info("component_sent_bytes_total line", "line", line)
+				Expect(line).To(ContainSubstring(`component_id=`),
+					"component_sent_bytes_total without component_id label (transport-layer duplicate): %s", line)
+			}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/functional/outputs/http/forward_to_http_test.go` around lines 245 - 259,
Update the test around CollectMetricLines in the component_sent_bytes_total case
to assert each collected line contains the expected component_id="output_http"
label, rather than only logging lines. Match the per-line label assertion
pattern used by the CloudWatch/S3 tests while preserving the existing timeout
and metric collection behavior.
test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go (1)

253-293: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the duplicated metrics-reader RBAC lifecycle into the functional framework. The same ~40-line ClusterRole/ClusterRoleBinding setup and teardown is copy-pasted in three tests; a single helper (e.g. framework.SetupMetricsRBAC() returning a cleanup func, next to CollectMetricLines in test/framework/functional/metrics.go) removes the drift risk.

  • test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go#L253-L293: replace the local vars plus BeforeEach/AfterEach with the shared helper and DeferCleanup.
  • test/functional/outputs/aws/s3/forward_to_s3_test.go#L200-L240: same replacement.
  • test/functional/outputs/http/forward_to_http_test.go#L203-L243: same replacement.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go` around
lines 253 - 293, Extract the duplicated metrics-reader RBAC setup and teardown
into a shared framework helper, such as SetupMetricsRBAC next to
CollectMetricLines, returning a cleanup function. In
test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go:253-293,
test/functional/outputs/aws/s3/forward_to_s3_test.go:200-240, and
test/functional/outputs/http/forward_to_http_test.go:203-243, remove the local
RBAC variables and BeforeEach/AfterEach lifecycle, invoke the helper, and
register its cleanup with DeferCleanup.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/framework/functional/metrics.go`:
- Around line 19-23: Update the metrics polling flow around f.RunCommand to
propagate ctx and add curl’s --max-time bounded by the poll timeout, while
retaining the most recent execution or scrape error in lastErr. On return, wrap
the final error with the last scrape error when both are present, preserving the
matched result and existing success behavior.

---

Nitpick comments:
In `@test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go`:
- Around line 253-293: Extract the duplicated metrics-reader RBAC setup and
teardown into a shared framework helper, such as SetupMetricsRBAC next to
CollectMetricLines, returning a cleanup function. In
test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go:253-293,
test/functional/outputs/aws/s3/forward_to_s3_test.go:200-240, and
test/functional/outputs/http/forward_to_http_test.go:203-243, remove the local
RBAC variables and BeforeEach/AfterEach lifecycle, invoke the helper, and
register its cleanup with DeferCleanup.

In `@test/functional/outputs/http/forward_to_http_test.go`:
- Around line 245-259: Update the test around CollectMetricLines in the
component_sent_bytes_total case to assert each collected line contains the
expected component_id="output_http" label, rather than only logging lines. Match
the per-line label assertion pattern used by the CloudWatch/S3 tests while
preserving the existing timeout and metric collection behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: fa9f1766-6902-403d-af8c-756dd3c5e451

📥 Commits

Reviewing files that changed from the base of the PR and between d3b6f7a and 384e5d6.

📒 Files selected for processing (4)
  • test/framework/functional/metrics.go
  • test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go
  • test/functional/outputs/aws/s3/forward_to_s3_test.go
  • test/functional/outputs/http/forward_to_http_test.go

Comment thread test/framework/functional/metrics.go
@qodo-for-rh-openshift

qodo-for-rh-openshift Bot commented Jul 29, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
⚠️ Tickets: not configured — ticket URL found in PR but could not be fetched — check ticket provider credentials
✅ Compliance rules (platform): 9 rules

Grey Divider


Action required

1. RBAC name collisions ✓ Resolved 🐞 Bug ☼ Reliability
Description
The new metrics tests create cluster-scoped ClusterRole/ClusterRoleBinding objects with names
derived only from framework.Name ("functional"), so parallel execution of ./test/functional/...
packages can intermittently fail with AlreadyExists and break unrelated tests. This PR adds multiple
new occurrences of the pattern, increasing the collision probability in CI.
Code

test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go[R261-280]

+			roleName := fmt.Sprintf("%s-metrics-reader", framework.Name)
+			metricsReaderRole = runtime.NewClusterRole(
+				roleName,
+				runtime.NewNonResourceURLPolicyRule([]string{"/metrics"}, []string{"get"}),
+			)
+			Expect(framework.Test.Create(metricsReaderRole)).To(Succeed())
+
+			metricsReaderBinding = runtime.NewClusterRoleBinding(
+				roleName,
+				runtime.NewClusterRoleRef(roleName),
+				runtime.NewServiceAccountSubject("default", framework.Namespace),
+			)
+			Expect(framework.Test.Create(metricsReaderBinding)).To(Succeed())
+
+			tokenReviewBinding = runtime.NewClusterRoleBinding(
+				fmt.Sprintf("%s-token-reviewer", framework.Name),
+				runtime.NewClusterRoleRef("system:auth-delegator"),
+				runtime.NewServiceAccountSubject("default", framework.Namespace),
+			)
+			Expect(framework.Test.Create(tokenReviewBinding)).To(Succeed())
Relevance

●● Moderate

Name-collision risk in parallel functional runs is plausible, but acceptance depends on their CI
parallelism assumptions.

PR-#3246
PR-#3329

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The RBAC objects are cluster-scoped and named using only framework.Name; framework.Name is
hard-coded to "functional", and the functional test target runs all test/functional packages (which
Go may execute in parallel), so separate packages can race to create the same ClusterRole/Binding
names and fail.

test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go[260-280]
test/functional/outputs/aws/s3/forward_to_s3_test.go[207-228]
test/functional/outputs/http/forward_to_http_test.go[210-230]
test/framework/functional/framework.go[107-123]
Makefile[236-243]
test/functional/metrics/metrics_test.go[44-73]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Functional metrics tests create **cluster-scoped** RBAC resources (ClusterRole/ClusterRoleBinding) with fixed names based only on `framework.Name`. Since `framework.Name` is constant (`"functional"`) and `make test-functional` runs `go test ./test/functional/...` (packages can run in parallel), multiple packages can attempt to create the same cluster-scoped objects and fail with `AlreadyExists`.

### Issue Context
- ClusterRoles/ClusterRoleBindings are not namespaced; names must be unique cluster-wide.
- `framework.Name` is set to a constant `"functional"`.
- This PR adds new test contexts that create `functional-metrics-reader` and `functional-token-reviewer`.

### Fix Focus Areas
- test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go[260-280]
- test/functional/outputs/aws/s3/forward_to_s3_test.go[207-228]
- test/functional/outputs/http/forward_to_http_test.go[210-230]
- test/framework/functional/framework.go[107-123]
- Makefile[236-243]

### Suggested fix
- Include the namespace (or a generated unique suffix) in **all** cluster-scoped RBAC object names, e.g.:
 - `roleName := fmt.Sprintf("%s-%s-metrics-reader", framework.Namespace, framework.Name)`
 - `tokenReviewName := fmt.Sprintf("%s-%s-token-reviewer", framework.Namespace, framework.Name)`
- Consider centralizing RBAC setup in a helper that derives unique names and returns cleanup functions, to ensure consistent naming across packages (including existing metrics tests).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Loose metric matching 🐞 Bug ≡ Correctness
Description
CollectMetricLines uses strings.Contains(line, metricName) instead of matching the metric name token
at the start of the sample, which can capture unintended metrics and either satisfy waitFor
prematurely or pollute the returned set. In these new tests, any extra matched lines are then
asserted to contain component_id=, which can cause false failures (or false passes if waitFor is met
by a different series).
Code

test/framework/functional/metrics.go[R25-32]

+		for _, line := range strings.Split(raw, "\n") {
+			if strings.HasPrefix(line, "#") {
+				continue
+			}
+			if strings.Contains(line, metricName) {
+				matched = append(matched, line)
+			}
+		}
Relevance

●●● Strong

Local correctness fix to avoid unintended metric matches; important for stable assertions in new
tests.

PR-#3329
PR-#3256

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The helper currently selects lines by substring containment, while the metric of interest is
explicitly named vector_component_sent_bytes_total elsewhere; the new tests then iterate over all
returned lines and assert label presence, making the selection precision important for test
correctness.

test/framework/functional/metrics.go[25-37]
internal/metrics/relabel.go[31-37]
test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go[307-318]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The metric line selection logic matches any sample line containing the substring `metricName`. Prometheus exposition samples begin with the metric name token; substring matching can select unrelated series and make the tests flaky or misleading.

### Issue Context
- The canonical metric name used in dashboards/rules is `vector_component_sent_bytes_total`.
- Tests call `CollectMetricLines("component_sent_bytes_total", ...)` and then assert labels on all returned lines.

### Fix Focus Areas
- test/framework/functional/metrics.go[25-37]
- internal/metrics/relabel.go[31-37]
- test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go[307-318]

### Suggested fix
- Parse each non-comment sample line to extract the metric name token (split on `{` or whitespace), and compare it to the expected name.
 - If you want to keep accepting unprefixed inputs, normalize by expanding `component_sent_bytes_total` -> `vector_component_sent_bytes_total` before comparing.
- Only include lines where the metric name token matches exactly; then apply the `waitFor` check over those lines.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Metric poll swallows errors ✓ Resolved 🐞 Bug ☼ Reliability
Description
CollectMetricLines ignores RunCommand/curl failures by returning (false, nil), so callers only see a
timeout and lose the underlying error cause. Because matched is only cleared after a successful
command, the function can also return stale metric lines from an earlier successful poll iteration.
Code

test/framework/functional/metrics.go[R18-24]

+	err := wait.PollUntilContextTimeout(context.TODO(), 3*time.Second, timeout, true, func(ctx context.Context) (bool, error) {
+		raw, err := f.RunCommand(constants.CollectorName, "bash", "-c",
+			fmt.Sprintf("curl -ks -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" https://%s.%s:24231/metrics", f.Name, f.Namespace))
+		if err != nil {
+			return false, nil
+		}
+		matched = nil
Relevance

●●● Strong

Deterministic test-helper reliability fix; team often accepts changes that reduce flakes and
preserve root-cause errors.

PR-#3256
PR-#3329

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The helper returns (false,nil) on RunCommand error and only resets matched after a successful curl,
so a timeout hides the true failure and may return data from a previous iteration.

test/framework/functional/metrics.go[16-40]
test/framework/functional/framework.go[172-177]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`CollectMetricLines` retries on command failure but discards the error (`return false, nil`). This makes debugging failures much harder (timeouts instead of the real cause), and can return stale `matched` lines because `matched` is not cleared on the error path.

### Issue Context
- `RunCommand(...)` returns the exec output and an error.
- The poll loop currently treats any error as retryable without surfacing it.

### Fix Focus Areas
- test/framework/functional/metrics.go[16-40]
- test/framework/functional/framework.go[172-177]

### Suggested fix
- Clear `matched` at the start of each poll attempt (before running curl).
- Track `lastErr` from `RunCommand` and:
 - either return it from the condition function to stop polling immediately when appropriate, or
 - if you want to keep retrying, return `context deadline exceeded: last error: ...` when the timeout expires.
- Optionally use the `ctx` provided by `PollUntilContextTimeout` (instead of `context.TODO()`) for better cancellation semantics.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go Outdated
Comment thread test/framework/functional/metrics.go
Comment thread test/framework/functional/metrics.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/framework/functional/metrics.go`:
- Around line 37-48: Update the setup flow around metricsReaderBinding and
tokenReviewBinding so that if a later f.Test.Create call fails, all previously
created RBAC resources are deleted before returning the error. Add cleanup for
metricsReaderBinding when tokenReviewBinding creation fails, and preserve the
existing error return behavior while ensuring each successfully created resource
is removed on partial setup failure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 56a1b946-4525-450f-871a-cdc569ca6b22

📥 Commits

Reviewing files that changed from the base of the PR and between 384e5d6 and 6ae03b2.

📒 Files selected for processing (4)
  • test/framework/functional/metrics.go
  • test/functional/outputs/aws/cloudwatch/forward_to_cloudwatch_test.go
  • test/functional/outputs/aws/s3/forward_to_s3_test.go
  • test/functional/outputs/http/forward_to_http_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/functional/outputs/http/forward_to_http_test.go

Comment thread test/framework/functional/metrics.go
@Clee2691

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@Clee2691: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-using-bundle 6ae03b2 link false /test e2e-using-bundle

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

runtime.NewClusterRoleRef(roleName),
runtime.NewServiceAccountSubject("default", f.Namespace),
)
if err = f.Test.Create(metricsReaderBinding); err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't recall if we have a cleanup function for functional tests but do we need to be concerned about cleaning up these clusterrolbinding in a test cluster because of potentially "false positives" due to essentially "name" collision?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not a concern because the name of the binding and other rbac resources is derived like this:

roleName := fmt.Sprintf("%s-%s-metrics-reader", f.Test.NS.Name, f.Name)

The test's namespace name is unique for every tests so there shouldn't be any collision especially since the NS name is generated from UniqueNameForTest()

@jcantrill

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Clee2691, jcantrill

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 30, 2026
@jcantrill

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 4820fd0 into openshift:master Jul 30, 2026
9 of 10 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown

@Clee2691: new pull request created: #3382

Details

In response to this:

/cherry-pick release-6.6

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release/6.6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants