Security scan fixes - gosec#1846
Merged
limak9182 merged 1 commit intofeature/database-controllersfrom Apr 15, 2026
Merged
Conversation
Contributor
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
mploski
approved these changes
Apr 15, 2026
M4KIF
approved these changes
Apr 15, 2026
M4KIF
left a comment
There was a problem hiding this comment.
Important, nice to see static analysis related fixes.
6f83dfb
into
feature/database-controllers
11 of 15 checks passed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Handle previously ignored error return values from ctrl.SetControllerReference in the PostgreSQL cluster builder functions, flagged by gosec (G104 / CWE-703).
Key Changes
pkg/postgresql/cluster/core/cluster.go:buildCNPGClusterandbuildCNPGPoolernow return error, propagatingSetControllerReferencefailures to callers. Updated call sites at the reconciler level (Reconcile) andcreateConnectionPoolerto handle the new error.pkg/postgresql/cluster/core/cluster_unit_test.go: Updated tests forTestBuildCNPGCluster,TestBuildCNPGPooler/rw_pooler, andTestBuildCNPGPooler/ro_poolerto assert no error on the new return signature.Testing and Verification
Related Issues
CPI-1859
PR Checklist