Skip to content

fix: restore config management support for mapproxinator - #93

Open
roicohen326 wants to merge 1 commit into
masterfrom
fix/restore-mapproxinator-config-management
Open

fix: restore config management support for mapproxinator#93
roicohen326 wants to merge 1 commit into
masterfrom
fix/restore-mapproxinator-config-management

Conversation

@roicohen326

Copy link
Copy Markdown
Contributor

Problem

mapproxinator:v1.3.0 adopted @map-colonies/config, which fetches configuration over HTTP at startup. The chart sets no CONFIG_* variables, so the library falls back to its default server URL and the container exits immediately:

ConfigError [httpGeneralError]: An error occurred while making the request
  at async initConfig (/usr/src/app/common/config.js:14:22)
  code: 'ECONNREFUSED', address: '127.0.0.1', port: 8080

This is currently crashlooping in qa and integration after the 2.3.1 version alignment bumped mapproxinator to v1.3.0. Neither environment is down — the previous v1.2.5 pods stay up because the new ones never pass readiness.

Cause

This support existed once. #85 added it on 25 Jun. #86 — the v2.0.0 MapProxy 6 rewrite — removed it one day later:

git log --oneline -- helm/templates/mapproxinator/mapproxinator-configmap.yaml
e9376a0 feat!: rewrite as MapProxy 6 image, v2.0.0 (supersedes mc-mapproxy) (#86)   <- removed
07f4b21 chore: helm config management (#85)                                        <- added

So 2.0.0, 2.1.0 and 2.1.1 all shipped without it. Chart 6.0.1 in mc-mapproxy is missing it too.

Change

Restores the #85 implementation in both configmaps — the init container and mapproxinator use separate ones, and both run the same image, so both need it.

One deliberate deviation from #85: version defaults to 'latest', not ''. Verified against the real image — an empty value fails schema validation:

'version' property must be equal to the allowed value
path: '{base}.version', context: { errorType: 'const', allowedValue: 'latest' }

serverUrl now matches the exporter-trigger convention (http://localhost:8080/api) rather than ''.

Defaults are unchanged in effect (offlineMode: false); consumers opt in.

Verification

Rendered env applied to mapproxinator:v1.3.0 running in-cluster:

{"level":"info","msg":"starting initMode"}
{"level":"info","msg":"initializing configuration"}     <- passes, previously threw ECONNREFUSED
...
ENOENT: no such file or directory, stat '/path/to/source/mapproxy.yaml'

Config init succeeds; the process proceeds to its normal FS provider step and stops only because the throwaway test pod had no mapproxy.yaml mounted. The chart mounts it in a real deployment.

Also verified:

  • helm lint — 0 failed
  • helm template renders all four keys in both configmaps
  • both override paths work — per-service and global.configManagement.offlineMode=true (one value covering both containers)

Consumer follow-up

helm-charts then sets global.configManagement.offlineMode: true under mapproxy in serving-values.yaml and bumps the chart, across master / qa / integration.

mapproxinator v1.3.0 adopted @map-colonies/config, which fetches config
over HTTP at startup. The chart sets no CONFIG_* variables, so the library
falls back to its default server URL and the container exits:

  ConfigError [httpGeneralError]: connect ECONNREFUSED 127.0.0.1:8080
    at async initConfig (/usr/src/app/common/config.js:14:22)

This support existed once. #85 added it on 25 Jun; #86 (the v2.0.0 MapProxy 6
rewrite) removed it a day later, so 2.0.0, 2.1.0 and 2.1.1 all shipped without
it. This restores it in both configmaps - the init container and mapproxinator
use separate ones, and both containers run the same image.

Deviation from #85: version defaults to 'latest', not ''. Verified against
the real image - an empty value fails schema validation:

  'version' property must be equal to the allowed value
  path: '{base}.version', allowedValue: 'latest'

serverUrl now matches the exporter-trigger convention.

Verified by running mapproxinator:v1.3.0 in-cluster with the rendered env:
config initialization succeeds ("initializing configuration") and the process
proceeds to its normal FS provider step.

Consumers set global.configManagement.offlineMode=true to cover both
containers with one value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant