wmedvede commented on PR #2790:
URL:
https://github.com/apache/incubator-kie-tools/pull/2790#issuecomment-2692124114
@rhkp
**Wrong default schema calculation when not set in the persistence config.**
When we configure a SPF like below, see that we are not providing the schema
name.
```
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
services:
dataIndex:
enabled: true
persistence:
postgresql:
serviceRef:
name: postgres
databaseName: sonataflow
secretRef:
name: postgres-secrets
userKey: POSTGRESQL_USER
passwordKey: POSTGRESQL_PASSWORD
podTemplate:
initContainers:
- name: init-postgres
image: registry.access.redhat.com/ubi9/ubi-minimal:latest
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ]
jobService:
enabled: true
persistence:
postgresql:
serviceRef:
name: postgres
databaseName: sonataflow
secretRef:
name: postgres-secrets
userKey: POSTGRESQL_USER
passwordKey: POSTGRESQL_PASSWORD
podTemplate:
initContainers:
- name: init-postgres
image: registry.access.redhat.com/ubi9/ubi-minimal:latest
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ]
```
The operator produces the following default schema name calculations for DI
and JS

But, if we enable the DB migrator on the same SFP:
```
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
services:
dataIndex:
enabled: true
persistence:
dbMigrationStrategy: job
postgresql:
serviceRef:
name: postgres
databaseName: sonataflow
secretRef:
name: postgres-secrets
userKey: POSTGRESQL_USER
passwordKey: POSTGRESQL_PASSWORD
podTemplate:
initContainers:
- name: init-postgres
image: registry.access.redhat.com/ubi9/ubi-minimal:latest
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ]
jobService:
enabled: true
persistence:
dbMigrationStrategy: job
postgresql:
serviceRef:
name: postgres
databaseName: sonataflow
secretRef:
name: postgres-secrets
userKey: POSTGRESQL_USER
passwordKey: POSTGRESQL_PASSWORD
podTemplate:
initContainers:
- name: init-postgres
image: registry.access.redhat.com/ubi9/ubi-minimal:latest
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ]
```
We get the following results:
Migrator job generated these by default wrong schema names:

DI deployment was generated with the correct by default schema name:

JS deployment was generated with the correct by default schema name:

Migrator job must generate the correct by default schema names
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]