Skip to content

SPIRE-617, OCPBUGS-90556: fix gcInterval to 10s to prevent spire-controller-manager high CPU usage - #150

Draft
sujkini wants to merge 3 commits into
openshift:mainfrom
sujkini:spire-617/fix-gcinterval-high-cpu
Draft

SPIRE-617, OCPBUGS-90556: fix gcInterval to 10s to prevent spire-controller-manager high CPU usage#150
sujkini wants to merge 3 commits into
openshift:mainfrom
sujkini:spire-617/fix-gcinterval-high-cpu

Conversation

@sujkini

@sujkini sujkini commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • Bug: GCInterval was not set in generateControllerManagerConfig(), defaulting to 0s (Go zero value), causing continuous garbage collection and ~2300m CPU usage at idle.
  • Fix: Set GCInterval: 10 * time.Second in the ControllerManagerConfig struct literal in pkg/controller/spire-server/configmap.go.
  • Tests: Added unit test assertions in configmaps_test.go verifying the struct field value and YAML serialization.

Test plan

  • go build ./pkg/controller/spire-server/... passes
  • go test ./pkg/controller/spire-server/... passes (all existing + new tests)
  • New TestGenerateControllerManagerConfig_GCInterval validates struct value = 10*time.Second and YAML contains gcInterval: 10000000000
  • Existing TestGenerateSpireControllerManagerConfigYaml/Valid_config now asserts gcInterval presence
  • CI jobs pass

Fixes: SPIRE-617
Duplicate of: OCPBUGS-90556

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes

    • Configured the SPIRE controller manager to run garbage collection every 10 seconds.
    • Prevented an unset or zero garbage-collection interval from causing incorrect behavior.
    • Automatically restores the expected configuration if it is modified or deleted.
    • Improved recovery so the SPIRE Server remains ready while the controller-manager configuration is repaired or recreated.
  • Tests

    • Added coverage validating configuration generation and recovery scenarios.

…high CPU usage

The GCInterval field in ControllerManagerConfig was not being set,
defaulting to Go's zero value (0s). This caused the spire-controller-manager
to run garbage collection continuously without pause, consuming ~2300m CPU
at idle. Set GCInterval to 10 * time.Second (the intended default) and add
unit test coverage for the field.

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 29, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 29, 2026

Copy link
Copy Markdown

@sujkini: This pull request references SPIRE-617 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

This pull request references Jira Issue OCPBUGS-90556, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • Bug: GCInterval was not set in generateControllerManagerConfig(), defaulting to 0s (Go zero value), causing continuous garbage collection and ~2300m CPU usage at idle.
  • Fix: Set GCInterval: 10 * time.Second in the ControllerManagerConfig struct literal in pkg/controller/spire-server/configmap.go.
  • Tests: Added unit test assertions in configmaps_test.go verifying the struct field value and YAML serialization.

Test plan

  • go build ./pkg/controller/spire-server/... passes
  • go test ./pkg/controller/spire-server/... passes (all existing + new tests)
  • New TestGenerateControllerManagerConfig_GCInterval validates struct value = 10*time.Second and YAML contains gcInterval: 10000000000
  • Existing TestGenerateSpireControllerManagerConfigYaml/Valid_config now asserts gcInterval presence
  • CI jobs pass

Fixes: SPIRE-617
Duplicate of: OCPBUGS-90556

Made with Cursor

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Walkthrough

The controller-manager configuration now sets GCInterval to 10 seconds. Unit tests verify its typed and YAML representations, while e2e tests validate correction of invalid values, ConfigMap recreation, and SPIRE Server readiness.

Changes

SPIRE controller-manager GC interval

Layer / File(s) Summary
Generate and validate GCInterval
pkg/controller/spire-server/configmap.go, pkg/controller/spire-server/configmaps_test.go
The generated controller-manager configuration sets GCInterval to 10 seconds, and tests verify the corresponding YAML value.
Reconcile and recover the ConfigMap
test/e2e/utils/constants.go, test/e2e/e2e_test.go
E2E tests identify the controller-manager ConfigMap, validate its interval, patch invalid configuration, and verify reconciliation, recreation, and SPIRE Server readiness.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: swghosh, trilokgeer, sayak-redhat

Sequence Diagram(s)

sequenceDiagram
  participant E2ETest
  participant ControllerManagerConfigMap
  participant Operator
  participant SPIREServer
  E2ETest->>ControllerManagerConfigMap: patch gcInterval to 0
  ControllerManagerConfigMap->>Operator: expose invalid configuration
  Operator->>ControllerManagerConfigMap: restore gcInterval to 10 seconds
  E2ETest->>ControllerManagerConfigMap: delete ConfigMap
  Operator->>ControllerManagerConfigMap: recreate ConfigMap with gcInterval 10 seconds
  E2ETest->>SPIREServer: verify Ready=True
Loading
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: setting gcInterval to 10s to reduce spire-controller-manager CPU usage.
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.
Stable And Deterministic Test Names ✅ Passed Added Ginkgo titles are static strings; no dynamic names, generated IDs, timestamps, or runtime-derived values appear in test titles.
Test Structure And Quality ✅ Passed PASS: the new unit and e2e tests are focused, use explicit timeouts, include helpful assertion messages, and follow existing Ginkgo/cleanup patterns.
Microshift Test Compatibility ✅ Passed gcInterval tests only touch core ConfigMaps and Spire CR conditions in a regular namespace; no MicroShift-excluded APIs or namespaces are used.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The new gcInterval e2e tests only read/patch a ConfigMap and verify SpireServer readiness; they don’t count nodes, require HA, or schedule across hosts.
Topology-Aware Scheduling Compatibility ✅ Passed PR only sets GCInterval and adds tests/E2E checks; no nodeSelector, affinity, topology spread, replica, or PDB scheduling constraints were introduced.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes were added; new output is confined to It blocks via GinkgoWriter, and suite entrypoints remain unchanged.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed New e2e tests only read/patch a cluster ConfigMap and wait on cluster conditions; no IPv4 literals, IP parsing, or external hosts were added.
No-Weak-Crypto ✅ Passed Touched files only use sha256/x509/rand; no MD5/SHA1/DES/RC4/3DES/Blowfish, custom crypto, or secret comparisons were added.
Container-Privileges ✅ Passed No changed manifest or workload spec sets privileged/host* or allowPrivilegeEscalation; PR only updates controller config and tests.
No-Sensitive-Data-In-Logs ✅ Passed The PR only sets gcInterval and adds assertions; I found no new logs exposing secrets, tokens, PII, hostnames, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
openshift-ci Bot requested review from TrilokGeer and swghosh July 29, 2026 12:19
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sujkini
Once this PR has been reviewed and has the lgtm label, please assign trilokgeer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Journey 1: Verify controller-manager ConfigMap contains gcInterval=10s
and SpireServer reaches Ready=True.

Journey 2: Validate operator restores gcInterval after ConfigMap drift
(gcInterval set to 0) and full ConfigMap deletion.

Generated by OpenSpec /opsx-e2e pipeline.

Co-authored-by: Cursor <cursoragent@cursor.com>

@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: 3

🤖 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/e2e/gc_interval_fix_test.go`:
- Around line 80-85: Update the spec containing the drift injection to capture
the original ConfigMap data before modifying it and register DeferCleanup before
the drift update and subsequent deletion. Cleanup must restore the original
ConfigMap data when it still exists, or recreate the ConfigMap with its original
metadata and data when deleted, so failures cannot leak shared state to later
specs.
- Around line 38-40: Update the BeforeAll setup for testCtx to derive it with
context.WithTimeout using an appropriate test deadline, retain the cancel
function, and invoke that cancel function during cleanup so blocked Kubernetes
Get, Update, or Delete calls terminate promptly.
- Around line 98-101: Replace the direct SpireServer fetch assertion in the
drift-recovery verification with a call to utils.WaitForSpireServerConditions,
matching the existing readiness assertion after ConfigMap recreation. Ensure the
check validates the expected Ready and ControllerManagerConfigAvailable
conditions rather than only confirming the CR exists.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d02e89f-3b2b-4785-9d87-3097a952d67c

📥 Commits

Reviewing files that changed from the base of the PR and between cfa0f52 and a79323c.

📒 Files selected for processing (2)
  • test/e2e/gc_interval_fix_test.go
  • test/e2e/utils/constants.go

Comment thread test/e2e/gc_interval_fix_test.go Outdated
Comment on lines +38 to +40
BeforeAll(func() {
testCtx = context.Background()
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
fd -a 'gc_interval_fix_test.go' . | sed 's#^\./##'

echo "== file outline/size =="
file="$(fd 'gc_interval_fix_test.go' . | head -n1)"
wc -l "$file"
ast-grep outline "$file" --view expanded || true

echo "== relevant slices =="
sed -n '1,140p' "$file" | nl -ba

echo "== contexts/verbs/readiness mentions =="
rg -n "context\.Background|context\.WithTimeout|Eventually|Eventuallyf|Get\(|Update\(|Delete\(|Expect\(IsReady\(|Readiness|readiness|DefaultTimeout|AfterEach|BeforeAll|BeforeEach" "$file"

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 535


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== repository-wide Ginkgo setup patterns for context timeouts =="
rg -n "WithTimeout|context\.Background\(\)|cancel\(\)|AfterEach|BeforeEach|utils\.DefaultTimeout" --glob '*_test.go' --glob '*.go' | head -n 200

echo "== inspect likely helper definitions/usages =="
rg -n "DefaultTimeout|SetContext|SetDeadline|context\.WithTimeout\(" -t go . | head -n 200

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 342


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="./test/e2e/gc_interval_fix_test.go"

echo "== full target file =="
awk '{printf "%3d\t%s\n", NR, $0}' "$file"

echo "== imports/lines with context/client calls =="
sed -n '1,120p' "$file"

echo "== helper definitions for api clients =="
rg -n "ClientFor|set up|kubernetesClient|spireclient|New.*Client|ForNamespace" test/e2e test -g '*.go' | head -n 120

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 12840


Use a deadline-bound test context.

context.Background() cannot cancel a blocked Kubernetes request, so a stuck Get, Update, or Delete inside Eventually can run past Ginkgo timeouts. Derive testCtx from context.WithTimeout(...) and cancel it in cleanup.

🤖 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/e2e/gc_interval_fix_test.go` around lines 38 - 40, Update the BeforeAll
setup for testCtx to derive it with context.WithTimeout using an appropriate
test deadline, retain the cancel function, and invoke that cancel function
during cleanup so blocked Kubernetes Get, Update, or Delete calls terminate
promptly.

Source: Path instructions

Comment thread test/e2e/gc_interval_fix_test.go Outdated
Comment on lines +80 to +85
By("Drift injection: patching ConfigMap to set gcInterval to 0")
driftedData := strings.Replace(configData, "gcInterval: 10000000000", "gcInterval: 0", 1)
Expect(driftedData).NotTo(Equal(configData), "drift patch should have changed the data")
cm.Data[utils.SpireControllerManagerConfigKey] = driftedData
_, err = clientset.CoreV1().ConfigMaps(utils.OperatorNamespace).Update(testCtx, cm, metav1.UpdateOptions{})
Expect(err).NotTo(HaveOccurred(), "failed to patch ConfigMap with drifted gcInterval")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Files matching gc_interval_fix_test.go:"
fd -a 'gc_interval_fix_test.go' . || true

file=$(fd 'gc_interval_fix_test.go' . | head -n1)
if [ -n "${file:-}" ]; then
  echo
  echo "Outline for $file:"
  ast-grep outline "$file" --view expanded || true
  echo
  echo "Relevant source lines:"
  sed -n '1,150p' "$file" | nl -ba
fi

echo
echo "Search for ConfigMap setup/cleanup patterns around operator namespace/config key:"
rg -n "SpireControllerManagerConfigKey|OperatorNamespace|ConfigMaps\\(|DeferCleanup|BeforeEach|AfterEach|Drift injection|gcInterval" test/e2e -S || true

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 545


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="test/e2e/gc_interval_fix_test.go"

echo "Relevant source lines:"
awk '{printf "%4d  %s\n", NR, $0}' "$file" | sed -n '1,140p'

echo
echo "Search for ConfigMap setup/cleanup patterns around operator namespace/config key:"
rg -n "SpireControllerManagerConfigKey|OperatorNamespace|ConfigMaps\\(|DeferCleanup|BeforeEach|AfterEach|Drift injection|gcInterval" test/e2e -S || true

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 38424


Restore shared ConfigMap state even when the spec fails.

The drift update and ConfigMap deletion mutate shared state, and this spec has no DeferCleanup/AfterEach restoration. If either mutation or later assertions fail, later specs can run with gcInterval: 0 or without the operator ConfigMap. Save the original config before the drift update and register cleanup logic before both mutations to restore/recreate it.

🤖 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/e2e/gc_interval_fix_test.go` around lines 80 - 85, Update the spec
containing the drift injection to capture the original ConfigMap data before
modifying it and register DeferCleanup before the drift update and subsequent
deletion. Cleanup must restore the original ConfigMap data when it still exists,
or recreate the ConfigMap with its original metadata and data when deleted, so
failures cannot leak shared state to later specs.

Source: Coding guidelines

Comment thread test/e2e/gc_interval_fix_test.go Outdated
Comment on lines +98 to +101
By("Verifying SpireServer remains Ready after drift recovery")
spireServer := &operatorv1alpha1.SpireServer{}
err = k8sClient.Get(testCtx, client.ObjectKey{Name: "cluster"}, spireServer)
Expect(err).NotTo(HaveOccurred(), "failed to get SpireServer CR")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
fd -a 'gc_interval_fix_test.go|.*spire.*' . | sed 's#^\./##' | head -100

echo
echo "== relevant lines in target file =="
if [ -f test/e2e/gc_interval_fix_test.go ]; then
  nl -ba test/e2e/gc_interval_fix_test.go | sed -n '60,125p'
fi

echo
echo "== WaitForSpireServerConditions definitions/usages =="
rg -n "WaitForSpireServerConditions|ControllerManagerConfigAvailable|Ready" -S . --glob '**/*.go' | head -200

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 4531


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== list files =="
find . -type f \( -name gc_interval_fix_test.go -o -path '*/e2e/*' \) 2>/dev/null | sed 's#^\./##' | head -120

echo
echo "== target file slice =="
python3 - <<'PY'
from pathlib import Path
p = Path('test/e2e/gc_interval_fix_test.go')
lines = p.read_text().splitlines()
for i in range(60, 130):
    print(f"{i+1:4}: {lines[i]}")
PY

echo
echo "== WaitForSpireServerConditions definitions/usages =="
rg -n "WaitForSpireServerConditions|ControllerManagerConfigAvailable|Ready|Expect\\(err\\)\\.NotTo\\(HaveOccurred\\)" test/e2e -S --glob '**/*.go' || true

echo
echo "== candidate utility files mentioning SpireServer/wait helpers =="
rg -n "func WaitFor.*Spire|SpireServerConditions|k8sClient\\.Get\\(|Get\\(testCtx" -S --glob '**/*.go' | head -250

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 4781


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== WaitForSpireServerConditions implementation =="
python3 - <<'PY'
from pathlib import Path
p = Path('test/e2e/utils/utils.go')
txt = p.read_text()
idx = txt.find('func WaitForSpireServerConditions')
if idx == -1:
    print('WaitForSpireServerConditions not found in test/e2e/utils/utils.go')
else:
    start = txt.rfind('\nfunc ', 0, idx) + 1
    end = txt.find('\n', txt.find('\n', txt.find('\n', start) + 1) + 1)
    print(txt[start:end])
PY

echo
echo "== nearby usage after configmap recreation =="
python3 - <<'PY'
from pathlib import Path
p = Path('test/e2e/gc_interval_fix_test.go')
lines = p.read_text().splitlines()
for i in range(122, 128):
    print(f"{i+1:4}: {lines[i]}")
PY

echo
echo "== imports for operatorv1alpha1 in target file =="
python3 - <<'PY'
from pathlib import Path
p = Path('test/e2e/gc_interval_fix_test.go')
lines = p.read_text().splitlines()
for i in range(1, 45):
    print(f"{i:4}: {lines[i-1]}")
PY

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 2487


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('test/e2e/utils/utils.go')
txt = p.read_text().splitlines()
for i, line in enumerate(txt, 1):
    if 'func WaitForSpireServerConditions' in line or 'func checkConditionsMatch' in line:
        for j in range(max(1, i-5), min(len(txt), i+70)+1):
            print(f"{j:4}: {txt[j-1]}")
        print("---")
PY

Repository: openshift/zero-trust-workload-identity-manager

Length of output: 9042


Assert SpireServer readiness after drift recovery.

The lines at 98-101 only confirm the CR can be fetched; a recovered ConfigMap with Ready=False/missing ControllerManagerConfigAvailable still passes. Reuse utils.WaitForSpireServerConditions here, matching the assertion after ConfigMap recreation.

Proposed fix
-    spireServer := &operatorv1alpha1.SpireServer{}
-    err = k8sClient.Get(testCtx, client.ObjectKey{Name: "cluster"}, spireServer)
-    Expect(err).NotTo(HaveOccurred(), "failed to get SpireServer CR")
+    utils.WaitForSpireServerConditions(testCtx, k8sClient, "cluster", map[string]metav1.ConditionStatus{
+        "ControllerManagerConfigAvailable": metav1.ConditionTrue,
+        "Ready":                            metav1.ConditionTrue,
+    }, utils.DefaultTimeout)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
By("Verifying SpireServer remains Ready after drift recovery")
spireServer := &operatorv1alpha1.SpireServer{}
err = k8sClient.Get(testCtx, client.ObjectKey{Name: "cluster"}, spireServer)
Expect(err).NotTo(HaveOccurred(), "failed to get SpireServer CR")
By("Verifying SpireServer remains Ready after drift recovery")
utils.WaitForSpireServerConditions(testCtx, k8sClient, "cluster", map[string]metav1.ConditionStatus{
"ControllerManagerConfigAvailable": metav1.ConditionTrue,
"Ready": metav1.ConditionTrue,
}, utils.DefaultTimeout)
🤖 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/e2e/gc_interval_fix_test.go` around lines 98 - 101, Replace the direct
SpireServer fetch assertion in the drift-recovery verification with a call to
utils.WaitForSpireServerConditions, matching the existing readiness assertion
after ConfigMap recreation. Ensure the check validates the expected Ready and
ControllerManagerConfigAvailable conditions rather than only confirming the CR
exists.

Source: Coding guidelines

@sujkini

sujkini commented Jul 30, 2026

Copy link
Copy Markdown
Author

/retest

The separate gc_interval_fix_test.go file created an independent
Ordered Describe block that ran after the CreateOnlyMode tests,
causing state pollution (CreateOnlyMode=True not yet cleared).

Move both gcInterval journey tests into the main e2e_test.go
Describe block as a new Context before CreateOnlyMode, where
the cluster state is known to be healthy.

Co-authored-by: Cursor <cursoragent@cursor.com>

@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.

🧹 Nitpick comments (1)
test/e2e/e2e_test.go (1)

1850-1906: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Split drift and deletion recovery into separate specs.

Line 1850 tests two destructive recovery mechanisms in one It; a drift failure prevents deletion coverage and can leave shared suite state mutated. Isolate each scenario and register cleanup for an early-failure path.

As per coding guidelines, “Single responsibility — each test should test one behavior; Setup and cleanup using BeforeEach/AfterEach.”

🤖 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/e2e/e2e_test.go` around lines 1850 - 1906, The spec currently combines
ConfigMap drift recovery and deletion recovery, so one failure can skip the
other scenario and leave mutated state. Split the test around the existing
“Drift injection” and “Destructive action” flows into separate It specs, each
independently verifying recovery; add appropriate cleanup registration (such as
DeferCleanup/AfterEach) to restore or recreate the controller-manager ConfigMap
when either spec exits early.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@test/e2e/e2e_test.go`:
- Around line 1850-1906: The spec currently combines ConfigMap drift recovery
and deletion recovery, so one failure can skip the other scenario and leave
mutated state. Split the test around the existing “Drift injection” and
“Destructive action” flows into separate It specs, each independently verifying
recovery; add appropriate cleanup registration (such as DeferCleanup/AfterEach)
to restore or recreate the controller-manager ConfigMap when either spec exits
early.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 58b0e7eb-2dbc-4786-84f1-e6b05453034e

📥 Commits

Reviewing files that changed from the base of the PR and between a79323c and 276d2e3.

📒 Files selected for processing (1)
  • test/e2e/e2e_test.go

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

@sujkini: all tests passed!

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.

@sujkini
sujkini marked this pull request as draft July 30, 2026 14:08
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants