From 1313c56c44ad8b1aae43adf8caa3e5ea99fe8fc8 Mon Sep 17 00:00:00 2001 From: Walter Medvedeo Date: Fri, 6 Sep 2024 12:23:15 +0200 Subject: [PATCH] kie-kogito-serverless-operator-528: Disable partial DB Migrator work --- controllers/platform/services/services.go | 16 ++++++++++------ version/version.go | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/controllers/platform/services/services.go b/controllers/platform/services/services.go index dbba7221d..3636b0f00 100644 --- a/controllers/platform/services/services.go +++ b/controllers/platform/services/services.go @@ -21,7 +21,6 @@ package services import ( "fmt" - "strconv" "github.com/apache/incubator-kie-kogito-serverless-operator/controllers/cfg" "github.com/apache/incubator-kie-kogito-serverless-operator/utils/kubernetes" @@ -225,10 +224,12 @@ func (d DataIndexHandler) ConfigurePersistence(containerSpec *corev1.Container) c := containerSpec.DeepCopy() c.Image = d.GetServiceImageName(constants.PersistenceTypePostgreSQL) c.Env = append(c.Env, persistence.ConfigurePostgreSQLEnv(p.PostgreSQL, d.GetServiceName(), d.platform.Namespace)...) - migrateDBOnStart := strconv.FormatBool(d.platform.Spec.Services.DataIndex.Persistence.MigrateDBOnStartUp) - // specific to DataIndex - c.Env = append(c.Env, corev1.EnvVar{Name: quarkusHibernateORMDatabaseGeneration, Value: "update"}, corev1.EnvVar{Name: quarkusFlywayMigrateAtStart, Value: migrateDBOnStart}) + // TODO upcoming work as part of the DB Migrator incorporation should continue where + // assignments like -> migrateDBOnStart := strconv.FormatBool(d.platform.Spec.Services.DataIndex.Persistence.MigrateDBOnStartUp) introduces nil pointer references, + // 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"}) return c } return containerSpec @@ -391,9 +392,12 @@ func (j JobServiceHandler) ConfigurePersistence(containerSpec *corev1.Container) c.Image = j.GetServiceImageName(constants.PersistenceTypePostgreSQL) p := persistence.RetrievePostgreSQLConfiguration(j.platform.Spec.Services.JobService.Persistence, j.platform.Spec.Persistence, j.GetServiceName()) c.Env = append(c.Env, persistence.ConfigurePostgreSQLEnv(p.PostgreSQL, j.GetServiceName(), j.platform.Namespace)...) + // TODO upcoming work as part of the DB Migrator incorporation should continue where + // assignments like -> migrateDBOnStart := strconv.FormatBool(j.platform.Spec.Services.JobService.Persistence.MigrateDBOnStartUp) introduces nil pointer references, + // since Services, and services Persistence are optional references. + // Specific to Job Service - migrateDBOnStart := strconv.FormatBool(j.platform.Spec.Services.JobService.Persistence.MigrateDBOnStartUp) - c.Env = append(c.Env, corev1.EnvVar{Name: "QUARKUS_FLYWAY_MIGRATE_AT_START", Value: migrateDBOnStart}) + c.Env = append(c.Env, corev1.EnvVar{Name: "QUARKUS_FLYWAY_MIGRATE_AT_START", Value: "true"}) c.Env = append(c.Env, corev1.EnvVar{Name: "KOGITO_JOBS_SERVICE_LOADJOBERRORSTRATEGY", Value: "FAIL_SERVICE"}) return c } diff --git a/version/version.go b/version/version.go index eb0eb353d..349e5d03b 100644 --- a/version/version.go +++ b/version/version.go @@ -31,7 +31,7 @@ const ( // When released, this version should reflect the `major.minor` version in the registry. // For example, docker.io/apache/incubator-kie-sonataflow-operator:10.0 tagVersion = "main" - serviceTagVersion = "weekly-latest" + serviceTagVersion = "main" ) // GetOperatorVersion gets the current binary version of the operator. Do not use it to compose image tags! @@ -45,8 +45,8 @@ func GetTagVersion() string { } // GetServiceTagVersion gets the current tag version for the service images. -// TODO, unify all with tagVersion="main", when "main" tag is produced for DI and JS. -// Right now, Apache community only produces "weekly-latest", and "timestamped tags" for these services. +// TODO, double check Apache community continues producing JS and DI "main" tag images. +// The "weekly-latest" tags are no longer produced. func GetServiceTagVersion() string { return serviceTagVersion }