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

Abierto
#14,638 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@bhouse-nexthop ya está trabajando en esto.

Desde el 9/11/2026.

  • #14641 de @bhouse-nexthop — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
java
Área
api, backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Java
Estrellas
3.1k
Forks
1.4k
Merge medio
7 d 16 h
PR fusionados (30 d)
15

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/cloudstack

Todos los issues de apache/cloudstack

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.