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

オープン
#14,638 コメント 1 件 リアクション 0 件 担当者 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時間
マージ済み PR(30日)
15

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/cloudstack のほかの issue

apache/cloudstack の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。