Skip to content

Commit

Permalink
fix: general adjusts
Browse files Browse the repository at this point in the history
- text comment
- parameter default
- using jq -n
- README

Signed-off-by: Leandro Mendes <[email protected]>
  • Loading branch information
theflockers committed Jan 30, 2025
1 parent de948f3 commit 450e423
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
22 changes: 11 additions & 11 deletions pipelines/internal/update-fbc-catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Tekton pipeline add/update FBC fragments to the FBC catalog by interacting with

## Parameters

| Name | Description | Optional | Default value |
|-------------------------|-----------------------------------------------------------------------------|----------|---------------------|
| iibServiceAccountSecret | Secret containing the credentials for IIB service | yes | iib-service-account |
| publishingCredentials | Publishing credentials used to fetch the image config | yes | catalog-publishing-credentials |
| fbcFragment | FBC fragment built by HACBS | no | - |
| fromIndex | Index image (catalog of catalogs) the FBC fragment will be added to | no | - |
| buildTags | List of additional tags the internal index image copy should be tagged with | yes | '[]' |
| addArches | List of arches the index image should be built for | yes | '[]' |
| hotfix | Whether this build is a hotfix build | yes | false |
| stagedIndex | Whether this build is a staged index build | yes | false |
| buildTimeoutSeconds | IIB Build Service timeout seconds | no | - |
| Name | Description | Optional | Default value |
|-------------------------|-----------------------------------------------------------------------------|----------|---------------------------|
| iibServiceAccountSecret | Secret containing the credentials for IIB service | yes | iib-service-account |
| publishingCredentials | Secret containing the publishing credentials used to fetch the image config | yes | catalog-publishing-secret |
| fbcFragment | FBC fragment built by HACBS | no | - |
| fromIndex | Index image (catalog of catalogs) the FBC fragment will be added to | no | - |
| buildTags | List of additional tags the internal index image copy should be tagged with | yes | '[]' |
| addArches | List of arches the index image should be built for | yes | '[]' |
| hotfix | Whether this build is a hotfix build | yes | false |
| stagedIndex | Whether this build is a staged index build | yes | false |
| buildTimeoutSeconds | IIB Build Service timeout seconds | no | - |

## Changes in 1.1.0
* adds `publishingCredentials` parameter
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- name: publishingCredentials
type: string
default: "catalog-publishing-secret"
description: Publishing credential used to fetch the image config
description: Secret containing the publishing credentials used to fetch the image config
- name: fbcFragment
type: string
description: FBC fragment built by HACBS
Expand Down
2 changes: 1 addition & 1 deletion tasks/internal/update-fbc-catalog-task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Tekton task to submit a IIB build request to add/update a fbc-fragment to an ind
| addArches | List of arches the index image should be built for. | No | - |
| buildTimeoutSeconds | Timeout seconds to receive the build state | Yes | "300" |
| iibServiceAccountSecret | Secret with IIB credentials to be used | No | - |
| publishingCredentials | Publishing credentials used to fetch the image config | No | |
| publishingCredentials | Secret containing the publishing credentials used to fetch the image config | No | - |
| hotfix | Whether this build is a hotfix build | Yes | "false" |
| stagedIndex | Whether this build is for a staged index build | Yes | "false" |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
description: Secret with IIB credentials to be used
- name: publishingCredentials
type: string
description: Publishing credentials used to fetch the image config
description: Secret containing the publishing credentials used to fetch the image config
- name: hotfix
type: string
default: "false"
Expand Down Expand Up @@ -134,9 +134,10 @@ spec:
# authentication is only required for the targetIndex
create_auth_file
targetIndexCreated="$(skopeo inspect --config "docker://$(params.targetIndex)" | jq -r .created)"
# an empty targetdIndexCreated will cause `date` to use an arbitrary date that could allow
# resuming of a image that requires a new build.
if [ -z "${targetIndexCreated}" ]; then
# we cannot determine the target index created date, stop here. This causes the task to trigger
# a new build.
return 0
fi
Expand All @@ -159,9 +160,9 @@ spec:
# disabling debug to not leak the token
set +x
jq --arg authName "${authName}" \
--arg token "$(base64 -w 0 < <(printf %s "${TARGET_INDEX_CREDENTIAL}"))" \
'.auths[$authName].auth = $token' <<< '{}' > "${HOME}/.config/containers/auth.json"
jq -n --arg authName "${authName}" \
--arg token "$(base64 -w 0 < <(printf %s "${TARGET_INDEX_CREDENTIAL}"))" \
'.auths[$authName].auth = $token' > "${HOME}/.config/containers/auth.json"
set -x
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
else
iib_service_account_secret="iib-service-account-prod"
fi
publishing_credentials=$(jq -r '.fbc.publishingCredentials' "$DATA_FILE")
publishing_credentials=$(jq -r '.fbc.publishingCredentials' // "catalog-publishing-secret" "$DATA_FILE")
timestamp_format=$(jq -r '.fbc.timestampFormat // "%s"' "${DATA_FILE}")
timestamp=$(date "+${timestamp_format}")
Expand Down

0 comments on commit 450e423

Please sign in to comment.