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

Offen
#14,638 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@bhouse-nexthop arbeitet bereits daran.

Seit 09.11.2026.

  • #14641 von @bhouse-nexthop — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
api, backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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).

Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.4k
Ø Merge
7 T. 16 Std.
Gemergte PRs (30 T.)
15

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/cloudstack

Alle Issues in apache/cloudstack

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.