Skip to content

Commit

Permalink
kie-kogito-serverless-operator-528: Disable partial DB Migrator work (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wmedvede authored Sep 6, 2024
1 parent 954d1d4 commit 6438a23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions controllers/platform/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
}

0 comments on commit 6438a23

Please sign in to comment.