fix: pass credentials to Flyway when using separate datasource URL
When spring.flyway.url is set independently, Spring Boot does not inherit credentials from spring.datasource. Add explicit user/password to both application.yml and K8s deployment to prevent "no password" failures on feature branch deployments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,8 @@ spring:
|
|||||||
enabled: true
|
enabled: true
|
||||||
locations: classpath:db/migration
|
locations: classpath:db/migration
|
||||||
url: jdbc:postgresql://localhost:5432/cameleer3?currentSchema=${CAMELEER_DB_SCHEMA:public},public
|
url: jdbc:postgresql://localhost:5432/cameleer3?currentSchema=${CAMELEER_DB_SCHEMA:public},public
|
||||||
|
user: ${spring.datasource.username}
|
||||||
|
password: ${spring.datasource.password}
|
||||||
schemas: ${CAMELEER_DB_SCHEMA:public}
|
schemas: ${CAMELEER_DB_SCHEMA:public}
|
||||||
default-schema: ${CAMELEER_DB_SCHEMA:public}
|
default-schema: ${CAMELEER_DB_SCHEMA:public}
|
||||||
mvc:
|
mvc:
|
||||||
|
|||||||
@@ -36,6 +36,16 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: postgres-credentials
|
name: postgres-credentials
|
||||||
key: POSTGRES_PASSWORD
|
key: POSTGRES_PASSWORD
|
||||||
|
- name: SPRING_FLYWAY_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgres-credentials
|
||||||
|
key: POSTGRES_USER
|
||||||
|
- name: SPRING_FLYWAY_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgres-credentials
|
||||||
|
key: POSTGRES_PASSWORD
|
||||||
- name: OPENSEARCH_URL
|
- name: OPENSEARCH_URL
|
||||||
value: "http://opensearch.cameleer.svc.cluster.local:9200"
|
value: "http://opensearch.cameleer.svc.cluster.local:9200"
|
||||||
- name: CAMELEER_OPENSEARCH_INDEX_PREFIX
|
- name: CAMELEER_OPENSEARCH_INDEX_PREFIX
|
||||||
|
|||||||
Reference in New Issue
Block a user