Skip to content

fix: webhook should use non cached client for reading certificates CM - #1704

Open
tolusha wants to merge 1 commit into
mainfrom
webhookusenoncachedclient
Open

fix: webhook should use non cached client for reading certificates CM#1704
tolusha wants to merge 1 commit into
mainfrom
webhookusenoncachedclient

Conversation

@tolusha

@tolusha tolusha commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Webhook should use non cached client for reading certificates CM

What issues does this PR fix or reference?

Webhook memory issue

Is it tested? How?

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Summary by CodeRabbit

  • Bug Fixes
    • Updated HTTP client setup to use the non-cached client, improving consistency for webhook-related requests.

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci

openshift-ci Bot commented Sep 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tolusha
Once this PR has been reviewed and has the lgtm label, please assign dkwon17 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

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1c373749-73a1-4858-8691-ee4e21b09ffc

📥 Commits

Reviewing files that changed from the base of the PR and between ca957f2 and 89680e0.

📒 Files selected for processing (1)
  • webhook/main.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The webhook HTTP clients factory now receives the previously created non-cached client instead of the manager's cached client.

Changes

HTTP client factory initialization

Layer / File(s) Summary
Select the factory client
webhook/main.go
SetupHttpClientsFactory now uses nonCachedClient instead of mgr.GetClient().

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 89680

Webhook initialization now uses the non-cached client for certificate ConfigMap reads, avoiding stale cached data and addressing the reported memory issue. The focused change has no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: the webhook uses a non-cached client to read the certificates ConfigMap.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch webhookusenoncachedclient

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.

@tolusha

tolusha commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi! I'm che-ai-assistant — I help with your pull requests.

I check for new comments every 10m0s, so there may be a short delay before I respond.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant ok-pr-readiness — Ensure PR has validation steps
  • /che-ai-assistant check-pr-test-failures — Analyze failing CI checks, identify root causes, and suggest fixes
  • /che-ai-assistant update-che-e2e-tests — Update Eclipse Che e2e tests
  • /che-ai-assistant claude — Run a free-form instruction on this PR
  • /che-ai-assistant help — Show this help message

@tolusha

tolusha commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@tolusha

tolusha commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@tolusha

tolusha commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Tested with 1,500 CM and 1 MB of content.

Before the fix: A 2 GiB memory limit was not sufficient (OOM).
After the fix: Memory usage returned to normal levels, at around 20 MiB.

@tolusha

tolusha commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Additionally, creating 5,000 DevWorkspaceTemplate objects, each approximately 3 KiB in size, increased memory usage to around 120 MiB.

@tolusha

tolusha commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

To be on the safe side, I suggest increasing the default memory limit from 300 MiB to 500 MiB.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant