diff --git a/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_services_types.go b/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_services_types.go index 2949244537b..a098d3a8f26 100644 --- a/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_services_types.go +++ b/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_services_types.go @@ -23,11 +23,6 @@ import ( // ServicesPlatformSpec describes the desired service configuration for workflows without the `sonataflow.org/profile: dev` annotation. type ServicesPlatformSpec struct { - // true = Use DB Migration Job with DB Migrator tool image - // false = Use built-in DB migration capability within services e.g. DI/JS - // +optional - // +default: false - JobBasedDbMigration bool `json:"jobBasedDbMigration,omitempty"` // Deploys the Data Index service for use by workflows without the `sonataflow.org/profile: dev` annotation. // +optional DataIndex *DataIndexServiceSpec `json:"dataIndex,omitempty"` diff --git a/packages/sonataflow-operator/api/v1alpha08/zz_generated.deepcopy.go b/packages/sonataflow-operator/api/v1alpha08/zz_generated.deepcopy.go index 2468c5a57fd..7072f848c15 100644 --- a/packages/sonataflow-operator/api/v1alpha08/zz_generated.deepcopy.go +++ b/packages/sonataflow-operator/api/v1alpha08/zz_generated.deepcopy.go @@ -25,7 +25,7 @@ package v1alpha08 import ( "github.com/serverlessworkflow/sdk-go/v2/model" - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "knative.dev/pkg/apis" diff --git a/packages/sonataflow-operator/api/zz_generated.deepcopy.go b/packages/sonataflow-operator/api/zz_generated.deepcopy.go index 3a64d22da01..ee63408d62e 100644 --- a/packages/sonataflow-operator/api/zz_generated.deepcopy.go +++ b/packages/sonataflow-operator/api/zz_generated.deepcopy.go @@ -23,6 +23,8 @@ package api +import () + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Condition) DeepCopyInto(out *Condition) { *out = *in diff --git a/packages/sonataflow-operator/container-builder/api/zz_generated.deepcopy.go b/packages/sonataflow-operator/container-builder/api/zz_generated.deepcopy.go index 8bb6d5d01a7..ef063d033b4 100644 --- a/packages/sonataflow-operator/container-builder/api/zz_generated.deepcopy.go +++ b/packages/sonataflow-operator/container-builder/api/zz_generated.deepcopy.go @@ -24,7 +24,7 @@ package api import ( - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go b/packages/sonataflow-operator/internal/controller/platform/db_migrator_Job.go similarity index 95% rename from packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go rename to packages/sonataflow-operator/internal/controller/platform/db_migrator_Job.go index c08105d3c09..324fe1690e6 100644 --- a/packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go +++ b/packages/sonataflow-operator/internal/controller/platform/db_migrator_Job.go @@ -54,7 +54,7 @@ type DBMigratorJob struct { const ( dbMigrationJobName = "sonataflow-db-migrator-job" dbMigrationContainerName = "db-migration-container" - dbMigratorToolImage = "quay.io/rhkp/incubator-kie-kogito-service-db-migration-postgresql:latest" + dbMigratorToolImage = "docker.io/apache/incubator-kie-kogito-db-migrator-tool:latest" dbMigrationCmd = "./migration.sh" ) @@ -89,17 +89,8 @@ func getDBSchemaName(persistencePostgreSQL *operatorapi.PersistencePostgreSQL, d return defaultSchemaName } -func getNewQuarkusDataSource(jdbcURL string, userName string, password string, schema string) *QuarkusDataSource { - return &QuarkusDataSource{ - JdbcUrl: jdbcURL, - Username: userName, - Password: password, - Schema: schema, - } -} - func getQuarkusDataSourceFromPersistence(ctx context.Context, platform *operatorapi.SonataFlowPlatform, persistence *operatorapi.PersistenceOptionsSpec, defaultSchemaName string) *QuarkusDataSource { - quarkusDataSource := getNewQuarkusDataSource("", "", "", "") + quarkusDataSource := &QuarkusDataSource{} if persistence != nil && persistence.PostgreSQL != nil { quarkusDataSource.JdbcUrl = persistence.PostgreSQL.JdbcUrl quarkusDataSource.Username, _ = services.GetSecretKeyValueString(ctx, persistence.PostgreSQL.SecretRef.Name, persistence.PostgreSQL.SecretRef.UserKey, platform.Namespace) @@ -122,8 +113,8 @@ func NewDBMigratorJobData(ctx context.Context, client client.Client, platform *o } if (pshDI.IsServiceSetInSpec() && diJobsBasedDBMigration) || (pshJS.IsServiceSetInSpec() && jsJobsBasedDBMigration) { - quarkusDataSourceDataIndex := getNewQuarkusDataSource("", "", "", "") - quarkusDataSourceJobService := getNewQuarkusDataSource("", "", "", "") + quarkusDataSourceDataIndex := &QuarkusDataSource{} + quarkusDataSourceJobService := &QuarkusDataSource{} if diJobsBasedDBMigration { quarkusDataSourceDataIndex = getQuarkusDataSourceFromPersistence(ctx, platform, platform.Spec.Services.DataIndex.Persistence, "defaultDi") diff --git a/packages/sonataflow-operator/internal/controller/platform/services/secrets.go b/packages/sonataflow-operator/internal/controller/platform/services/secrets.go index 886634be701..e5c9b9bf8a9 100644 --- a/packages/sonataflow-operator/internal/controller/platform/services/secrets.go +++ b/packages/sonataflow-operator/internal/controller/platform/services/secrets.go @@ -28,10 +28,7 @@ import ( func GetSecretKeyValueString(ctx context.Context, secretName string, secretKey string, nameSpace string) (string, error) { secret := corev1.Secret{} err := utils.GetClient().Get(ctx, ctrl.ObjectKey{Namespace: nameSpace, Name: secretName}, &secret) - if err != nil { - panic(err.Error()) - } - + if err != nil { klog.V(log.E).InfoS("Error extracting secret: ", "namespace", nameSpace, "error", err) return "", err diff --git a/packages/sonataflow-operator/operator.yaml b/packages/sonataflow-operator/operator.yaml index c24d0b1ddf0..216a3b1e6a3 100644 --- a/packages/sonataflow-operator/operator.yaml +++ b/packages/sonataflow-operator/operator.yaml @@ -9239,11 +9239,6 @@ spec: type: string type: object type: object - jobBasedDbMigration: - description: |- - true = Use DB Migration Job with DB Migrator tool image - false = Use built-in DB migration capability within services e.g. DI/JS - type: boolean jobService: description: "Deploys the Job service for use by workflows without the `sonataflow.org/profile: dev` annotation." diff --git a/packages/sonataflow-operator/test/e2e/testdata/platform/persistence/service_based_db_migration/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/e2e/testdata/platform/persistence/service_based_db_migration/02-sonataflow_platform.yaml index 978c16cfb34..50d797561a2 100644 --- a/packages/sonataflow-operator/test/e2e/testdata/platform/persistence/service_based_db_migration/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/e2e/testdata/platform/persistence/service_based_db_migration/02-sonataflow_platform.yaml @@ -21,7 +21,6 @@ spec: strategyOptions: KanikoBuildCacheEnabled: "true" services: - # jobBasedDbMigration: false dataIndex: enabled: true persistence: