uselagoon / lagoon-sync

Apache License 2.0
7 stars 5 forks source link

Postgres syncer has incorrect local defaults #99

Closed rocketeerbkw closed 1 year ago

rocketeerbkw commented 1 year ago

Attempting to sync postgres with a config file that doesn't include local will fallback to environment variables that are not valid:

[DEBUG] 2023/09/27 16:42:34 github.com/uselagoon/lagoon-sync/utils.LogDebugInfo:logs.go:62 Config that will be used for sync {
  "Config": {
    "DbHostname": "${POSTGRES_HOST:-postgres}",
    "DbUsername": "${POSTGRES_USERNAME:-drupal}",
    "DbPassword": "${POSTGRES_PASSWORD:-drupal}",
    "DbPort": "${POSTGRES_PORT:-5432}",
    "DbDatabase": "${POSTGRES_DATABASE:-drupal}",
    "ExcludeTable": null,
    "ExcludeTableData": null,
    "OutputDirectory": ""
  },
  "LocalOverrides": {
    "Config": {
      "DbHostname": "$AMAZEEIO_DB_HOST",
      "DbUsername": "$AMAZEEIO_DB_USERNAME",
      "DbPassword": "$AMAZEEIO_DB_PASSWORD",
      "DbPort": "$AMAZEEIO_DB_PORT",
      "DbDatabase": "$POSTGRES_DATABASE",
      "ExcludeTable": null,
      "ExcludeTableData": null,
      "OutputDirectory": ""
    }
  },
  "TransferId": ""
}

This causes the sync to fail on the target environment.