From 954d1d48a8af6e888da14afd484dc09cf013c872 Mon Sep 17 00:00:00 2001 From: rhkp <87712456+rhkp@users.noreply.github.com> Date: Fri, 6 Sep 2024 05:53:47 -0400 Subject: [PATCH] Make migrateDBOnStartUp property optional (#526) --- api/v1alpha08/sonataflow_persistence_types.go | 2 ++ bundle/manifests/sonataflow.org_sonataflowplatforms.yaml | 4 ---- bundle/manifests/sonataflow.org_sonataflows.yaml | 2 -- config/crd/bases/sonataflow.org_sonataflowplatforms.yaml | 4 ---- config/crd/bases/sonataflow.org_sonataflows.yaml | 2 -- controllers/sonataflowplatform_controller_test.go | 8 ++------ operator.yaml | 6 ------ .../04-sonataflow_callbackstatetimeouts.sw.yaml | 1 - .../03-sonataflow_callbackstatetimeouts.sw.yaml | 1 - 9 files changed, 4 insertions(+), 26 deletions(-) diff --git a/api/v1alpha08/sonataflow_persistence_types.go b/api/v1alpha08/sonataflow_persistence_types.go index e32e027c9..53a5b15e5 100644 --- a/api/v1alpha08/sonataflow_persistence_types.go +++ b/api/v1alpha08/sonataflow_persistence_types.go @@ -52,6 +52,8 @@ type PersistenceOptionsSpec struct { PostgreSQL *PersistencePostgreSQL `json:"postgresql,omitempty"` // Whether to migrate database on service startup? + // +optional + // +default: false MigrateDBOnStartUp bool `json:"migrateDBOnStartUp"` } diff --git a/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml b/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml index f9d772261..ccc538c82 100644 --- a/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml +++ b/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml @@ -628,8 +628,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details @@ -8505,8 +8503,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details diff --git a/bundle/manifests/sonataflow.org_sonataflows.yaml b/bundle/manifests/sonataflow.org_sonataflows.yaml index effa0cd83..4dc1ae28b 100644 --- a/bundle/manifests/sonataflow.org_sonataflows.yaml +++ b/bundle/manifests/sonataflow.org_sonataflows.yaml @@ -2163,8 +2163,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details of this diff --git a/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml b/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml index c4587db75..a824a336a 100644 --- a/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml +++ b/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml @@ -629,8 +629,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details @@ -8506,8 +8504,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details diff --git a/config/crd/bases/sonataflow.org_sonataflows.yaml b/config/crd/bases/sonataflow.org_sonataflows.yaml index fffbbbb17..fa24f8dfc 100644 --- a/config/crd/bases/sonataflow.org_sonataflows.yaml +++ b/config/crd/bases/sonataflow.org_sonataflows.yaml @@ -2164,8 +2164,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details of this diff --git a/controllers/sonataflowplatform_controller_test.go b/controllers/sonataflowplatform_controller_test.go index 23230d8fc..90b66a8d9 100644 --- a/controllers/sonataflowplatform_controller_test.go +++ b/controllers/sonataflowplatform_controller_test.go @@ -261,14 +261,10 @@ func TestSonataFlowPlatformController(t *testing.T) { ksp.Spec = v1alpha08.SonataFlowPlatformSpec{ Services: &v1alpha08.ServicesPlatformSpec{ DataIndex: &v1alpha08.ServiceSpec{ - Persistence: &v1alpha08.PersistenceOptionsSpec{ - MigrateDBOnStartUp: false, - }, + Persistence: &v1alpha08.PersistenceOptionsSpec{}, }, JobService: &v1alpha08.ServiceSpec{ - Persistence: &v1alpha08.PersistenceOptionsSpec{ - MigrateDBOnStartUp: false, - }, + Persistence: &v1alpha08.PersistenceOptionsSpec{}, }, }, Persistence: &v1alpha08.PlatformPersistenceOptionsSpec{ diff --git a/operator.yaml b/operator.yaml index a1b679ac6..6cb2ae5fc 100644 --- a/operator.yaml +++ b/operator.yaml @@ -1120,8 +1120,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details @@ -8997,8 +8995,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details @@ -19070,8 +19066,6 @@ spec: required: - secretRef type: object - required: - - migrateDBOnStartUp type: object podTemplate: description: PodTemplate describes the deployment details of this diff --git a/test/testdata/workflow/persistence/by_service/04-sonataflow_callbackstatetimeouts.sw.yaml b/test/testdata/workflow/persistence/by_service/04-sonataflow_callbackstatetimeouts.sw.yaml index 58c8ce4c7..ec738e946 100644 --- a/test/testdata/workflow/persistence/by_service/04-sonataflow_callbackstatetimeouts.sw.yaml +++ b/test/testdata/workflow/persistence/by_service/04-sonataflow_callbackstatetimeouts.sw.yaml @@ -21,7 +21,6 @@ metadata: sonataflow.org/version: 0.0.1 spec: persistence: - migrateDBOnStartUp: false postgresql: secretRef: name: postgres-secrets 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 d39a521ed..fb696bff4 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 @@ -21,7 +21,6 @@ metadata: sonataflow.org/version: 0.0.1 spec: persistence: - migrateDBOnStartUp: false postgresql: secretRef: name: postgres-secrets