feat(manager): show the WAF management UI when the WAF extension is on - #5272
Open
electricjesus wants to merge 1 commit into
Open
feat(manager): show the WAF management UI when the WAF extension is on#5272electricjesus wants to merge 1 commit into
electricjesus wants to merge 1 commit into
Conversation
Turning on GatewayAPI.spec.extensions.waf now gives you the WAF management UI, instead of leaving a second switch to find. The manager controller reads the extension state and projects it onto WAF_UI_ENABLED, which is the variable ui-apis already reads at startup. Nothing new is watched. The manager controller has watched GatewayAPI since it started resolving the ingress gateway class, so flipping the extension already re-reconciles the manager. The read mirrors isGatewayWAFEnabled in the applicationlayer controller: a missing GatewayAPI CR means no gateways, so no WAF and no UI, and that is not an error. Enterprise-only and off on multi-tenant, matching RBACManagementEnabled. EV-6793
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the Manager UI automatically surface the WAF management UI when the GatewayAPI WAF extension is enabled, by having the manager controller project the extension state into the ui-apis container via the WAF_UI_ENABLED env var.
Changes:
- Add a manager-controller read of the
GatewayAPICR’s WAF extension state and plumb it intorender.ManagerConfiguration. - Render
WAF_UI_ENABLEDonto the ui-apis container env based on the computed flag. - Add controller and render tests to cover the new projection behavior across enabled/disabled and guard conditions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/controller/manager/manager_controller.go | Computes WAF UI enablement from GatewayAPI and passes it into manager rendering. |
| pkg/controller/manager/manager_controller_test.go | Adds unit tests for wafManagementEnabled behavior (no CR, enabled/disabled, legacy name, variant/tenancy guards). |
| pkg/render/manager.go | Adds WAFManagementEnabled to render config and sets WAF_UI_ENABLED on the ui-apis container. |
| pkg/render/manager_test.go | Updates baseline env var expectations and adds a render test asserting WAF_UI_ENABLED tracks the flag. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: https://tigera.atlassian.net/browse/EV-6793
Turning on
GatewayAPI.spec.extensions.wafnow gives you the WAF management UI. There is no second switch to find.The manager controller reads the WAF extension state and sets
WAF_UI_ENABLEDon the ui-apis container. That is the variable ui-apis already reads at startup, so this is the whole change. No new API field and no ConfigMap.Nothing new gets watched. The manager controller has watched
GatewayAPIsince it started resolving the ingress gateway class (manager_controller.go:172), so flipping the extension already re-reconciles the manager.The read mirrors
isGatewayWAFEnabledin the applicationlayer controller. A missingGatewayAPICR means no gateways, so no WAF and no UI, and that is not an error. Any other read error degrades so the controller requeues instead of reporting the feature off. Enterprise only, and off on multi-tenant, matchingutils.RBACManagementEnabled.Flipping
waf.staterolls the manager Deployment. That happens on enable or disable, not during normal use.Affected component: operator (manager controller, manager render).
Testing
go test ./pkg/controller/manager/ ./pkg/render/pass. New controller specs cover no CR, extensions unset,Disabled,Enabled, the legacytigera-secureCR, the Calico variant, and multi-tenant. New render spec assertsWAF_UI_ENABLEDtracks the flag both ways.Also run on a cluster, swapping only the operator image. One master hashrelease cluster, one
GatewayAPICR, nothing else changed:waf.stateWAF_UI_ENABLEDfalseEnabledtrueEnabledEnabledtrueRow 4 is the bug: stock reconciles, bumps the Deployment generation, and strips the variable back out while WAF is on.
Release Note
For PR author
make gen-filesmake gen-versionsFor PR reviewers
A note for code reviewers - all pull requests must have the following:
kind/bugif this is a bugfix.kind/enhancementif this is a a new feature.enterpriseif this PR applies to Calico Enterprise only.