Conversation
Signed-off-by: 7487 <1042653432@qq.com>
|
|
Author
|
/easycla |
1 similar comment
Author
|
/easycla |
…x-status-only-startup-without-initiali Signed-off-by: 7487 <1042653432@qq.com>
Signed-off-by: 7487 <1042653432@qq.com>
JaydipGabani
requested review from
abhisheksheth28
and
a balanced review from Copilot
September 14, 2026 23:56
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The test does not start the manager or verify the required status aggregation behavior.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Decouples status aggregation from validation initialization so status-only Gatekeeper instances can configure controllers without a constraint client.
Changes:
- Limits validation operations to audit and webhook.
- Registers status aggregators independently with API-backed reads in status-only mode.
- Adds focused predicate and controller-setup tests.
File summaries
| File | Description |
|---|---|
pkg/operations/operations.go |
Excludes status from validation operations. |
pkg/operations/operations_test.go |
Tests operation combinations. |
pkg/controller/constrainttemplate/constrainttemplate_controller.go |
Separates status-controller registration and optional watches. |
pkg/controller/constraintstatus/constraintstatus_controller.go |
Supports API-backed status-only reconciliation. |
main_test.go |
Adds status-only setup coverage. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| setupFinished := make(chan struct{}) | ||
| close(setupFinished) | ||
| if err := setupControllers(context.Background(), mgr, tracker, setupFinished); err != nil { |
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.
What this PR does / why we need it
HasValidationOperationscurrently classifiesstatusas policy validation. A status-only process therefore constructs a constraint client without an audit or webhook enforcement point and fails during startup. It also starts validation ingestion controllers that status aggregation does not need.This change:
auditandwebhook;Verification
TestHasValidationOperations/status_onlyfailed before the predicate fix.go test ./pkg/operations ./pkg/controller/constraintstatus ./pkg/controller/constrainttemplate ./pkg/controller/constrainttemplatestatusgo test . -run TestSetupControllersStatusOnlywith Kubernetes 1.33 envtest assetsmake native-testmake native-race-testgolangci-lint v2.9.0 run . ./pkg/operations/... ./pkg/controller/constraintstatus/... ./pkg/controller/constrainttemplate/...(0 issues)go vet ./...go build ./...Fixes #4770