Redeploy overview always shows a config as (new) when its name doesn't match its compose key #903

Open
opened 2026-08-08 17:58:01 +00:00 by dannygroenewegen · 0 comments

When deploying Nextcloud I noticed the redeploy overview always showed one config incorrectly as new, even though it was already deployed and unchanged. It turns out GatherConfigsForDeploy (pkg/deploy/utils.go) reports a config as (new) whenever its compose-file key differs from the base name embedded in its live Docker object name. The config already exists and works fine, but redeploy overview incorrectly shows this as a new config.

Example

coop-cloud/nextcloud compose.yml

configs:
  nginx_conf:
    name: ${STACK_NAME}_nginx_${NGINX_CONF_VERSION}
  fpm_tune:
    name: ${STACK_NAME}_fpm_tune_${FPM_TUNE_VERSION}
  entrypoint:
    name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
  crontab:
    name: ${STACK_NAME}_crontab_${CRONTAB_VERSION}

fpm_tune, entrypoint, and crontab all name their Docker object with the same word as their compose key, so they resolve correctly. nginx_conf doesn't; its object is named ..._nginx_..., missing the _conf suffix. As a result, nginx_conf shows as (new) on every single deploy of every app using this recipe, whether or not anything actually changed.

Cause and fix

GetEntityNameAndVersion() is used by GetConfigsForStack() to figure out what's deployed. It reads the live Docker config names off running services and derives a base name by stripping the stack prefix and splitting at the last underscore. For ${STACK_NAME}_nginx_v8 this becomes nginx. Then GatherConfigsForDeploy() takes the compose file's top-level config keys (nginx_conf, fpm_tune, ...) and matches those to decide new/unchanged/updated.

The first resolves as nginx and the second as nginx_conf, so they don't match.

To fix, GatherConfigsForDeploy() should use the name: field from the configs in the compose file template and use that to verify if the config exists on the server.

(I've also solved this in the recipe by making sure the names match, but fixing this in abra would prevent this confusing behaviour)

When deploying Nextcloud I noticed the redeploy overview always showed one config incorrectly as new, even though it was already deployed and unchanged. It turns out `GatherConfigsForDeploy` (`pkg/deploy/utils.go`) reports a config as `(new)` whenever its compose-file key differs from the base name embedded in its live Docker object name. The config already exists and works fine, but redeploy overview incorrectly shows this as a new config. ### Example `coop-cloud/nextcloud compose.yml` ```yaml configs: nginx_conf: name: ${STACK_NAME}_nginx_${NGINX_CONF_VERSION} fpm_tune: name: ${STACK_NAME}_fpm_tune_${FPM_TUNE_VERSION} entrypoint: name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION} crontab: name: ${STACK_NAME}_crontab_${CRONTAB_VERSION} ``` `fpm_tune`, `entrypoint`, and `crontab` all name their Docker object with the same word as their compose key, so they resolve correctly. `nginx_conf` doesn't; its object is named `..._nginx_...`, missing the `_conf` suffix. As a result, `nginx_conf` shows as `(new)` on every single deploy of every app using this recipe, whether or not anything actually changed. ### Cause and fix `GetEntityNameAndVersion()` is used by `GetConfigsForStack()` to figure out what's deployed. It reads the live Docker config names off running services and derives a base name by stripping the stack prefix and splitting at the last underscore. For `${STACK_NAME}_nginx_v8` this becomes `nginx`. Then `GatherConfigsForDeploy()` takes the compose file's top-level config keys (`nginx_conf`, `fpm_tune`, ...) and matches those to decide new/unchanged/updated. The first resolves as `nginx` and the second as `nginx_conf`, so they don't match. To fix, `GatherConfigsForDeploy()` should use the `name:` field from the configs in the compose file template and use that to verify if the config exists on the server. (I've also solved this in the recipe by making sure the names match, but fixing this in abra would prevent this confusing behaviour)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#903