Skip to content

Commit

Permalink
feat(RELEASE-1283): correct workspace (#688)
Browse files Browse the repository at this point in the history
- since the process-file-updates pipeline runs on the internal
  private cluster, it must have a workspace with the name
  'pipeline' to be bound by the internal services
  controller.

Signed-off-by: Scott Hebert <[email protected]>
  • Loading branch information
scoheb authored Nov 14, 2024
1 parent e453c04 commit a4dcf9b
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ spec:
type: string
default: "file-updates-secret"
description: The credentials used to update the git repo
workspaces:
- name: pipeline
tasks:
- name: process-file-updates
taskRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
- name: fileUpdatesState
description: fileUpdates state
workspaces:
- name: data
- name: pipeline
description: workspace to read and save files
steps:
- name: perform-updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ spec:
tasks:
- name: setup
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
taskSpec:
workspaces:
- name: data
- name: pipeline
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env bash
set -eux
mkdir -p "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
mkdir -p "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
mkdir one-update
cd one-update
git config --global init.defaultBranch main
Expand All @@ -51,9 +51,9 @@ spec:
- name: file_updates_secret
value: "file-updates-secret"
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
runAfter:
- setup
Expand All @@ -66,7 +66,7 @@ spec:
- name: fileUpdatesState
value: $(tasks.run-task.results.fileUpdatesState)
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: fileUpdatesInfo
Expand Down Expand Up @@ -104,13 +104,13 @@ spec:
echo "Testing that file present in working directory is what we expect"
diff -q "$(params.tempDir)/one-update/addons/my-addon2.yaml" "/tmp/my-addon2.yaml"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
finally:
- name: cleanup
params:
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: tempDir
Expand All @@ -124,5 +124,5 @@ spec:
rm -rf "$(params.tempDir)"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ spec:
tasks:
- name: setup
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
taskSpec:
workspaces:
- name: data
- name: pipeline
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env bash
set -eux
mkdir -p "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
mkdir -p "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
mkdir one-update
cd one-update
git config --global init.defaultBranch main
Expand Down Expand Up @@ -58,9 +58,9 @@ spec:
- name: file_updates_secret
value: "file-updates-secret"
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
runAfter:
- setup
Expand All @@ -73,7 +73,7 @@ spec:
- name: fileUpdatesState
value: $(tasks.run-task.results.fileUpdatesState)
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: fileUpdatesInfo
Expand All @@ -99,13 +99,13 @@ spec:
test "$(jq -r .error <<< "${fileUpdatesInfo:?}")" == "\"no replacements were performed\""
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
finally:
- name: cleanup
params:
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: tempDir
Expand All @@ -119,5 +119,5 @@ spec:
rm -rf "$(params.tempDir)"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ spec:
tasks:
- name: setup
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
taskSpec:
workspaces:
- name: data
- name: pipeline
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env bash
set -eux
mkdir -p "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
mkdir -p "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
mkdir one-update
cd one-update
git config --global init.defaultBranch main
Expand Down Expand Up @@ -60,17 +60,17 @@ spec:
- name: file_updates_secret
value: "file-updates-secret"
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
runAfter:
- setup
finally:
- name: cleanup
params:
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: tempDir
Expand All @@ -84,5 +84,5 @@ spec:
rm -rf "$(params.tempDir)"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ spec:
tasks:
- name: setup
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
taskSpec:
workspaces:
- name: data
- name: pipeline
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env bash
set -eux
mkdir -p "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
mkdir -p "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
mkdir one-update
cd one-update
git config --global init.defaultBranch main
Expand Down Expand Up @@ -58,9 +58,9 @@ spec:
- name: file_updates_secret
value: "file-updates-secret"
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
runAfter:
- setup
Expand All @@ -73,7 +73,7 @@ spec:
- name: fileUpdatesState
value: $(tasks.run-task.results.fileUpdatesState)
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: fileUpdatesInfo
Expand All @@ -99,13 +99,13 @@ spec:
test "$(jq -r .error <<< "${fileUpdatesInfo:?}")" == "\"no replacements were performed\""
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
finally:
- name: cleanup
params:
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: tempDir
Expand All @@ -119,5 +119,5 @@ spec:
rm -rf "$(params.tempDir)"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ spec:
tasks:
- name: setup
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
taskSpec:
workspaces:
- name: data
- name: pipeline
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env bash
set -eux
mkdir -p "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
mkdir -p "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
mkdir one-update
cd one-update
git config --global init.defaultBranch main
Expand Down Expand Up @@ -59,9 +59,9 @@ spec:
- name: file_updates_secret
value: "file-updates-secret"
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
runAfter:
- setup
Expand All @@ -74,7 +74,7 @@ spec:
- name: fileUpdatesState
value: $(tasks.run-task.results.fileUpdatesState)
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: fileUpdatesInfo
Expand Down Expand Up @@ -112,13 +112,13 @@ spec:
echo "Testing that file present in working directory is what we expect"
diff -q "$(params.tempDir)/one-update/addons/my-addon2.yaml" "/tmp/my-addon2.yaml"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
finally:
- name: cleanup
params:
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: tempDir
Expand All @@ -132,5 +132,5 @@ spec:
rm -rf "$(params.tempDir)"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ spec:
tasks:
- name: setup
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
taskSpec:
workspaces:
- name: data
- name: pipeline
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env bash
set -eux
mkdir -p "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
mkdir -p "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
cd "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
mkdir one-update
git init .
- name: run-task
Expand All @@ -47,17 +47,17 @@ spec:
- name: file_updates_secret
value: "file-updates-secret"
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
runAfter:
- setup
finally:
- name: cleanup
params:
- name: tempDir
value: "$(workspaces.data.path)/$(context.pipelineRun.uid)/file-updates"
value: "$(workspaces.pipeline.path)/$(context.pipelineRun.uid)/file-updates"
taskSpec:
params:
- name: tempDir
Expand All @@ -71,5 +71,5 @@ spec:
rm -rf "$(params.tempDir)"
workspaces:
- name: data
- name: pipeline
workspace: tests-workspace
Loading

0 comments on commit a4dcf9b

Please sign in to comment.