From e63b1f21c5508e66630b9a36b5835fbe26c5257d Mon Sep 17 00:00:00 2001 From: Scott Hebert Date: Wed, 18 Dec 2024 17:39:15 -0500 Subject: [PATCH] fix(RELEASE-1087): fix linting issues (#753) - fix linting issues in run-file-updates Signed-off-by: Scott Hebert --- tasks/run-file-updates/README.md | 2 ++ tasks/run-file-updates/run-file-updates.yaml | 10 +++++----- .../tests/test-run-file-updates-addons.yaml | 4 +--- .../run-file-updates/tests/test-run-file-updates.yaml | 4 +--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tasks/run-file-updates/README.md b/tasks/run-file-updates/README.md index e4cda024d..4045e0c5d 100644 --- a/tasks/run-file-updates/README.md +++ b/tasks/run-file-updates/README.md @@ -15,6 +15,8 @@ the field `spec.data.fileUpdates` in the ReleasePlanAdmission resource. | pipelineRunUid | The uid of the current pipelineRun. Used as a label value when creating internal requests | No | - | | resultsDirPath | Path to results directory in the data workspace | No | - | +## Changes in 2.0.2 +* fix linting issues ## Changes in 2.0.1 * fix typo in default value for `jq` diff --git a/tasks/run-file-updates/run-file-updates.yaml b/tasks/run-file-updates/run-file-updates.yaml index c526e534b..70d97ec5e 100644 --- a/tasks/run-file-updates/run-file-updates.yaml +++ b/tasks/run-file-updates/run-file-updates.yaml @@ -4,7 +4,7 @@ kind: Task metadata: name: run-file-updates labels: - app.kubernetes.io/version: "2.0.1" + app.kubernetes.io/version: "2.0.2" annotations: tekton.dev/pipelines.minVersion: "0.12.1" tekton.dev/tags: release @@ -52,10 +52,10 @@ spec: set -ex # Obtain application from snapshot - application=$(jq -rc .application $(workspaces.data.path)/$(params.snapshotPath)) + application=$(jq -rc .application "$(workspaces.data.path)/$(params.snapshotPath)") # Extract the key from the JSON file - fileUpdates=$(jq -rc "$(params.jsonKey)" $(workspaces.data.path)/$(params.fileUpdatesPath)) + fileUpdates=$(jq -rc "$(params.jsonKey)" "$(workspaces.data.path)/$(params.fileUpdatesPath)") TASK_LABEL="internal-services.appstudio.openshift.io/group-id" REQUEST_LABEL="internal-services.appstudio.openshift.io/request-id" @@ -82,7 +82,7 @@ spec: echo "=== Updates for repo: ${repo} ===" echo -en " Evaluating '{{ }}' expressions..." - updatedPaths=$(update-paths -p "${paths}" -f $(workspaces.data.path)/$(params.snapshotPath)) + updatedPaths=$(update-paths -p "${paths}" -f "$(workspaces.data.path)/$(params.snapshotPath)") echo "done" echo -en " Creating InternalRequest to produce file-updates..." @@ -92,7 +92,7 @@ spec: -p repo="${repo}" \ -p ref="${ref}" \ -p paths="${updatedPaths}" \ - -p application=${application} \ + -p application="${application}" \ -p file_updates_secret="${file_updates_secret}" \ -s "$(params.synchronously)" \ -l ${TASK_LABEL}="${TASK_ID}" \ diff --git a/tasks/run-file-updates/tests/test-run-file-updates-addons.yaml b/tasks/run-file-updates/tests/test-run-file-updates-addons.yaml index d74952694..80cd57b83 100644 --- a/tasks/run-file-updates/tests/test-run-file-updates-addons.yaml +++ b/tasks/run-file-updates/tests/test-run-file-updates-addons.yaml @@ -103,7 +103,7 @@ spec: set -ex # Get application - application=$(jq -r '.application' $(workspaces.data.path)/snapshot_spec.json) + application=$(jq -r '.application' "$(workspaces.data.path)/snapshot_spec.json") # Parse the input json file fileUpdates=$(jq -r '.spec.data.fileUpdates | length' "$(workspaces.data.path)/rpa.json") @@ -126,8 +126,6 @@ spec: do repo=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].repo' \ "$(workspaces.data.path)/rpa.json") - paths=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].paths' \ - "$(workspaces.data.path)/rpa.json") file_updates_secret=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].file_updates_secret' \ "$(workspaces.data.path)/rpa.json") diff --git a/tasks/run-file-updates/tests/test-run-file-updates.yaml b/tasks/run-file-updates/tests/test-run-file-updates.yaml index 77f1f7432..03296ffa2 100644 --- a/tasks/run-file-updates/tests/test-run-file-updates.yaml +++ b/tasks/run-file-updates/tests/test-run-file-updates.yaml @@ -111,7 +111,7 @@ spec: set -ex # Get application - application=$(jq -r '.application' $(workspaces.data.path)/snapshot_spec.json) + application=$(jq -r '.application' "$(workspaces.data.path)/snapshot_spec.json") # Parse the input json file fileUpdates=$(jq -r '.spec.data.fileUpdates | length' "$(workspaces.data.path)/rpa.json") @@ -143,8 +143,6 @@ spec: repo=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].repo' \ "$(workspaces.data.path)/rpa.json") - paths=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].paths' \ - "$(workspaces.data.path)/rpa.json") # Check if ref is present in the input file. If not, set it to 'main' ref=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].ref // "main"' \