flyway error: Unable to obtain connection from database for user 'null'

flyway error: Unable to obtain connection from database for user 'null'

我正在尝试 运行 flyway docker image 7.3.2 针对 kubernetes 上的 postgres 数据库:

当我 运行 作业时,我的输出是:

Flyway Community Edition 7.3.2 by Redgate
ERROR:
Unable to obtain connection from database (jdbc:postgresql://xxx.eu-west-2.rds.amazonaws.com:5432/xxx flyway.user=postgres flyway.password=****************) for user 'null': The server requested password-based authentication, but no password was provided.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL State  : 08004
Error Code : 0
Message    : The server requested password-based authentication, but no password was provided.

Caused by: org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.

它输出的设置是正确的并且应该启用连接。

我通过 configmap 传入我的 flyway.conf 是:

apiVersion: v1
kind: ConfigMap
metadata:
  name: flyway-configmap
data:
  flyway.conf:
    flyway.url=jdbc:postgresql://xxx.eu-west-2.rds.amazonaws.com:5432/xxx
    flyway.user=postgres
    flyway.password=xxx

任何人都可以帮助我做错什么?

如果这确实是您的 ConfigMap,那么它在 : 之后缺少 | 字符,这将使该 yaml 密钥成为 a newline delimited scalar。该理论也与您的错误消息相吻合,显示 entire thing 被视为 flyway.url

的值

你想要什么:

  flyway.conf: |
    flyway.url=jdbc:postgresql://xxx.eu-west-2.rds.amazonaws.com:5432/xxx
    flyway.user=postgres
    flyway.password=xxx