updateConfiguration with a scope id returns the global value in its response

未關閉
#14,638 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@bhouse-nexthop 已經在處理了。

開始於 2026年11月9日。

  • #14641 來自 @bhouse-nexthop —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
java
領域
api, backend

研究方向

Read ConfigurationManagerImpl.updateConfiguration(UpdateCfgCmd) and UpdateCfgCmd.setResponseValue(), then compare the scoped update path with the global findByName(name) return. The issue says the inner update already returns the normalized scoped value; trace how that reaches the API response. Done when the response reports the value set for the requested scope, including implicit scopes. Pull request #14641 is already open.

由索引模型根據 Issue 內容生成。

描述

problem

On main, updateConfiguration with a scope id (zoneid, clusterid, storageid, accountid, domainid, imagestoreuuid or managementserverid) returns the global value of the setting in its response, not the value that was just set. The scoped value is stored correctly. listConfigurations with the same scope id shows it, and it takes effect.

$ cmk update configuration name=drs.algorithm value=condensed clusterid=<cluster>
{"name": "drs.algorithm", "value": "balanced", "scope": "cluster", ...}   <- global value
$ cmk list configurations name=drs.algorithm clusterid=<cluster>
... "value": "condensed"                                                   <- the value that was set

A script or UI that checks the response sees the wrong value.

Cause:

  • ConfigurationManagerImpl.updateConfiguration(UpdateCfgCmd) ends with return _configDao.findByName(name);. That is the global configuration row, whatever the scope.
  • Since #11770, UpdateCfgCmd.setResponseValue() copies cfg.getValue() into the response. Before that change, it echoed the value from the request. So for a scoped update, the response now has the global value.

The same applies to the implicit scope a domain admin or a user gets when they call the API without a scope id.

versions

main (24.0.0-SNAPSHOT), since #11770. 4.22 and earlier echo the value from the request and are not affected.

The steps to reproduce the bug
  1. Note the global value of a cluster-scoped setting, for example drs.algorithm (balanced by default).
  2. updateConfiguration name=drs.algorithm value=condensed clusterid=<cluster>.
  3. The response's value is balanced.
  4. listConfigurations name=drs.algorithm clusterid=<cluster> returns condensed.
What to do about it?

Have updateConfiguration return the value that was set in the requested scope when a scope is given. The inner updateConfiguration(...) already returns that value, after normalization (for example, lowercased booleans).

主要語言
Java
星號
3.1k
分支
1.4k
平均合併
7 天 16 小時
30 天內合併 PR
15

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

apache/cloudstack 的其他 Issue

查看 apache/cloudstack 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。