From 994f9082a3cb7e4c535b5e1d87138c3ecb667605 Mon Sep 17 00:00:00 2001 From: Johnny Bieren Date: Fri, 13 Oct 2023 16:01:20 -0400 Subject: [PATCH] fix(RHTAPREL-119): remove lingering extraData references Remove last remaining references to extraData as the field is now called data. Signed-off-by: Johnny Bieren --- tasks/run-file-updates/README.md | 19 +++++++++++-------- tasks/run-file-updates/run-file-updates.yaml | 4 ++-- .../tests/test-run-file-updates.yaml | 10 +++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/tasks/run-file-updates/README.md b/tasks/run-file-updates/README.md index 4fc13fc01..a93031d91 100644 --- a/tasks/run-file-updates/README.md +++ b/tasks/run-file-updates/README.md @@ -1,20 +1,23 @@ # run-file-udpates Tekton task to create InternalRequests for each repository that needs to be updated. This information is extracted from -the field `spec.extraData.fileUpdates` in the ReleasePlanAdmission resource. +the field `spec.data.fileUpdates` in the ReleasePlanAdmission resource. ## Parameters -| Name | Description | Optional | Default value | -|-----------------|---------------------------------------------------------------|----------|-------------------------------| -| jsonKey | JSON key where the information is defined | Yes | .spec.extraData.fileUpdates[] | -| fileUpdatesPath | Path to the JSON file containing the key | No | | -| snapshotPath | Path to the JSON string of the Snapshot spec in the data workspace | No | snapshot_spec.json | -| request | Type of request to be created | Yes | file-updates | -| synchronously | Whether the task should wait for InternalRequests to complete | Yes | true | +| Name | Description | Optional | Default value | +|-----------------|--------------------------------------------------------------------|----------|--------------------------| +| jsonKey | JSON key where the information is defined | Yes | .spec.data.fileUpdates[] | +| fileUpdatesPath | Path to the JSON file containing the key | No | | +| snapshotPath | Path to the JSON string of the Snapshot spec in the data workspace | No | snapshot_spec.json | +| request | Type of request to be created | Yes | file-updates | +| synchronously | Whether the task should wait for InternalRequests to complete | Yes | true | ## Changelog +### Changes since 0.4.1 +- jsonKey default changed to .spec.data.fileUpdates{} due to API changes + ### changes since 0.3 - update Tekton API to v1 diff --git a/tasks/run-file-updates/run-file-updates.yaml b/tasks/run-file-updates/run-file-updates.yaml index 270430913..7ecb0d01a 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: "0.4.1" + app.kubernetes.io/version: "0.5.0" annotations: tekton.dev/pipelines.minVersion: "0.12.1" tekton.dev/tags: release @@ -15,7 +15,7 @@ spec: - name: jsonKey type: string description: The json key containing the file updates - default: ".spec.extraData.fileUpdates" + default: ".spec.data.fileUpdates" - name: fileUpdatesPath type: string description: The path to the file containing the file updates 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 03dc4de84..60c837d21 100644 --- a/tasks/run-file-updates/tests/test-run-file-updates.yaml +++ b/tasks/run-file-updates/tests/test-run-file-updates.yaml @@ -28,7 +28,7 @@ spec: application: foo origin: foo releaseStrategy: foo - extraData: + data: fileUpdates: - repo: https://gitlab.cee.redhat.com/foo paths: @@ -106,7 +106,7 @@ spec: application=$(jq -r '.application' $(workspaces.data.path)/snapshot_spec.json) # Parse the input json file - fileUpdates=$(jq -r '.spec.extraData.fileUpdates | length' "$(workspaces.data.path)/rpa.json") + fileUpdates=$(jq -r '.spec.data.fileUpdates | length' "$(workspaces.data.path)/rpa.json") # Fetch all the InternalRequest resources allRequests=$(kubectl get InternalRequest -o json) @@ -124,13 +124,13 @@ spec: i=0 while [ "$i" -lt "$fileUpdates" ] do - repo=$(jq -r --argjson i "$i" '.spec.extraData.fileUpdates[$i].repo' \ + repo=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].repo' \ "$(workspaces.data.path)/rpa.json") - paths=$(jq -r --argjson i "$i" '.spec.extraData.fileUpdates[$i].paths' \ + 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.extraData.fileUpdates[$i].ref // "main"' \ + ref=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].ref // "main"' \ "$(workspaces.data.path)/rpa.json") # check if requestApplication is correct