From a18af9a070202506f2552e06aab5baebf7783b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Fern=C3=A1ndez?= Date: Wed, 25 Sep 2024 12:56:10 +0200 Subject: [PATCH 1/3] incubator-kie-issues#1483: Create a common Kie Flyway initializer for Kie Modules --- controllers/platform/services/services.go | 4 ++-- .../03-sonataflow_callbackstatetimeouts.sw.yaml | 2 +- ...03-sonataflow_callbackstatetimeouts-no-persistence.sw.yaml | 2 +- .../03-sonataflow_callbackstatetimeouts.sw.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/platform/services/services.go b/controllers/platform/services/services.go index 5de2c3408..82f0ea05c 100644 --- a/controllers/platform/services/services.go +++ b/controllers/platform/services/services.go @@ -48,7 +48,7 @@ import ( const ( quarkusHibernateORMDatabaseGeneration string = "QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION" - quarkusFlywayMigrateAtStart string = "QUARKUS_FLYWAY_MIGRATE_AT_START" + quarkusFlywayMigrateAtStart string = "KIE_FLYWAY_ENABLED" ) type PlatformServiceHandler interface { @@ -425,7 +425,7 @@ func (j *JobServiceHandler) ConfigurePersistence(containerSpec *corev1.Container // since Services, and services Persistence are optional references. // Specific to Job Service - c.Env = append(c.Env, corev1.EnvVar{Name: "QUARKUS_FLYWAY_MIGRATE_AT_START", Value: "true"}) + c.Env = append(c.Env, corev1.EnvVar{Name: "KIE_FLYWAY_ENABLED", Value: "true"}) c.Env = append(c.Env, corev1.EnvVar{Name: "KOGITO_JOBS_SERVICE_LOADJOBERRORSTRATEGY", Value: "FAIL_SERVICE"}) return c } diff --git a/test/testdata/workflow/persistence/from_platform_overwritten_by_service/03-sonataflow_callbackstatetimeouts.sw.yaml b/test/testdata/workflow/persistence/from_platform_overwritten_by_service/03-sonataflow_callbackstatetimeouts.sw.yaml index fb696bff4..fa9c909c5 100644 --- a/test/testdata/workflow/persistence/from_platform_overwritten_by_service/03-sonataflow_callbackstatetimeouts.sw.yaml +++ b/test/testdata/workflow/persistence/from_platform_overwritten_by_service/03-sonataflow_callbackstatetimeouts.sw.yaml @@ -35,7 +35,7 @@ spec: container: env: # set the flyway initialization in the WF container env - - name: QUARKUS_FLYWAY_MIGRATE_AT_START + - name: KIE_FLYWAY_ENABLED value: "true" initContainers: - name: init-postgres diff --git a/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/03-sonataflow_callbackstatetimeouts-no-persistence.sw.yaml b/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/03-sonataflow_callbackstatetimeouts-no-persistence.sw.yaml index f7f4720fa..b134c0b02 100644 --- a/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/03-sonataflow_callbackstatetimeouts-no-persistence.sw.yaml +++ b/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/03-sonataflow_callbackstatetimeouts-no-persistence.sw.yaml @@ -26,7 +26,7 @@ spec: podTemplate: container: env: - - name: QUARKUS_FLYWAY_MIGRATE_AT_START + - name: KIE_FLYWAY_ENABLED value: "true" flow: start: PrintStartMessage diff --git a/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/03-sonataflow_callbackstatetimeouts.sw.yaml b/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/03-sonataflow_callbackstatetimeouts.sw.yaml index 307f85b61..719a9c7a4 100644 --- a/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/03-sonataflow_callbackstatetimeouts.sw.yaml +++ b/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/03-sonataflow_callbackstatetimeouts.sw.yaml @@ -24,7 +24,7 @@ spec: container: env: # set the flyway initialization in the WF container env - - name: QUARKUS_FLYWAY_MIGRATE_AT_START + - name: KIE_FLYWAY_ENABLED value: "true" flow: start: PrintStartMessage From 17a5ac43b0d0e2364ad398e40e359e262fed19d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Fern=C3=A1ndez?= Date: Wed, 25 Sep 2024 14:44:15 +0200 Subject: [PATCH 2/3] - variable rename --- controllers/platform/services/services.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/platform/services/services.go b/controllers/platform/services/services.go index 82f0ea05c..a74700012 100644 --- a/controllers/platform/services/services.go +++ b/controllers/platform/services/services.go @@ -48,7 +48,7 @@ import ( const ( quarkusHibernateORMDatabaseGeneration string = "QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION" - quarkusFlywayMigrateAtStart string = "KIE_FLYWAY_ENABLED" + kieFlywayEnabled string = "KIE_FLYWAY_ENABLED" ) type PlatformServiceHandler interface { @@ -245,7 +245,7 @@ func (d *DataIndexHandler) ConfigurePersistence(containerSpec *corev1.Container) // since Services, and services Persistence are optional references. // specific to DataIndex - c.Env = append(c.Env, corev1.EnvVar{Name: quarkusHibernateORMDatabaseGeneration, Value: "update"}, corev1.EnvVar{Name: quarkusFlywayMigrateAtStart, Value: "true"}) + c.Env = append(c.Env, corev1.EnvVar{Name: quarkusHibernateORMDatabaseGeneration, Value: "update"}, corev1.EnvVar{Name: kieFlywayEnabled, Value: "true"}) return c } return containerSpec From 4bd63a1c2315f43ed2fed8b255bc8f60129e17db Mon Sep 17 00:00:00 2001 From: Pere Fernandez Date: Wed, 25 Sep 2024 18:14:28 +0200 Subject: [PATCH 3/3] - make --- controllers/platform/services/services.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/platform/services/services.go b/controllers/platform/services/services.go index a74700012..68bee320f 100644 --- a/controllers/platform/services/services.go +++ b/controllers/platform/services/services.go @@ -48,7 +48,7 @@ import ( const ( quarkusHibernateORMDatabaseGeneration string = "QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION" - kieFlywayEnabled string = "KIE_FLYWAY_ENABLED" + kieFlywayEnabled string = "KIE_FLYWAY_ENABLED" ) type PlatformServiceHandler interface {