ammachado opened a new pull request, #23822:
URL: https://github.com/apache/camel/pull/23822

   # Description
   
   `ListVault.doProcessWatchCall()` builds its row list by mutating a single 
shared `Row` object across all vault-type blocks. The `row.copy()` call that 
isolates each row is guarded by `i > 0`, which means it only fires for the 2nd 
and subsequent secrets within a single vault. When a vault has exactly one 
secret, the row is added to the list while `row` still points to the same 
object. Every subsequent vault block then mutates that already-added object 
(`row.vault = "GCP"`, `row.vault = "Azure"`, etc.), so all rendered rows end up 
carrying the label of the last vault type processed. The same corruption 
surfaces in `--output json` mode, because the bug occurs during row collection 
before the `jsonOutput` branch is reached.
   
   Fix: save a `baseRow` (pid + name only) before vault processing begins and 
reset `row = baseRow.copy()` at the start of each vault block. This ensures no 
already-added `Row` object is ever mutated by a subsequent vault block, and 
also prevents stale fields such as `region` from bleeding between vault types.
   
   `ListVaultTest` and `ProcessCommandTestSupport` are ported from the 
companion PR #23812 (CAMEL-23688) to cover the fix. The test class includes 
regression tests for both table and JSON output with multiple vault types each 
having a single secret.
   
   _Claude Code on behalf of Adriano Machado_
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL-23707) 
filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to