@@ -34,6 +34,9 @@ const GREETING_COMPONENT_LOCATION =
3434
3535const WORKFLOW_REPO =
3636 "https://github.com/rhdhorchestrator/serverless-workflows.git" ;
37+ const WORKFLOW_REPO_REF =
38+ process . env . SERVERLESS_WORKFLOWS_REF ||
39+ "daeeee8dec16beab6d96a81774ef500081a2c2b0" ;
3740
3841const MANIFEST_DIRS = [
3942 "workflows/greeting/manifests" ,
@@ -370,6 +373,8 @@ export async function deploySonataflow(namespace: string): Promise<void> {
370373 const workflowDir = `/tmp/serverless-workflows-${ process . pid } ` ;
371374 try {
372375 await $ `git clone --depth=1 ${ WORKFLOW_REPO } ${ workflowDir } ` ;
376+ await $ `git -C ${ workflowDir } fetch --depth=1 origin ${ WORKFLOW_REPO_REF } ` ;
377+ await $ `git -C ${ workflowDir } checkout --detach ${ WORKFLOW_REPO_REF } ` ;
373378
374379 for ( const rel of MANIFEST_DIRS ) {
375380 const fullPath = join ( workflowDir , rel ) ;
@@ -381,10 +386,20 @@ export async function deploySonataflow(namespace: string): Promise<void> {
381386
382387 await waitForCRs ( namespace ) ;
383388
389+ // Patch persistence before image alignment so the operator never materializes
390+ // ReplicaSets that still reference upstream `sonataflow-psql-postgresql` (missing).
391+ for ( const workflow of WORKFLOWS ) {
392+ patchWorkflowPostgres ( namespace , workflow ) ;
393+ }
394+
384395 alignWorkflowImages ( namespace , oslMajorMinor ) ;
385396
397+ // Image patch can trigger another reconcile; re-apply persistence for safety.
386398 for ( const workflow of WORKFLOWS ) {
387399 patchWorkflowPostgres ( namespace , workflow ) ;
400+ }
401+
402+ for ( const workflow of WORKFLOWS ) {
388403 await waitForReconciliation ( namespace , workflow , 60 ) ;
389404 runOc (
390405 [
0 commit comments