test/api.sh: filter repos by image type
Filter the list of repositories passed in compose request based on the `image_type_tags` object member. This is the same approach used by the Weldr API. If the `image_type_tags` does not exist, the repo is added to the list. If the `image_type_tags` exists, the repo is added to the list only if the image type name is in the tags array. Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
parent
46e15794f0
commit
ea3e6f072e
1 changed files with 4 additions and 4 deletions
|
|
@ -592,7 +592,7 @@ function createReqFileAWS() {
|
|||
"image_request": {
|
||||
"architecture": "$ARCH",
|
||||
"image_type": "${IMAGE_TYPE}",
|
||||
"repositories": $(jq ".\"$ARCH\"" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json),
|
||||
"repositories": $(jq ".\"$ARCH\" | .[] | select((has(\"image_type_tags\") | not) or (.\"image_type_tags\" | index(\"${IMAGE_TYPE}\")))" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json | jq -s .),
|
||||
"upload_options": {
|
||||
"region": "${AWS_REGION}",
|
||||
"snapshot_name": "${AWS_SNAPSHOT_NAME}",
|
||||
|
|
@ -637,7 +637,7 @@ function createReqFileAWSS3() {
|
|||
"image_request": {
|
||||
"architecture": "$ARCH",
|
||||
"image_type": "${IMAGE_TYPE}",
|
||||
"repositories": $(jq ".\"$ARCH\"" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json),
|
||||
"repositories": $(jq ".\"$ARCH\" | .[] | select((has(\"image_type_tags\") | not) or (.\"image_type_tags\" | index(\"${IMAGE_TYPE}\")))" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json | jq -s .),
|
||||
"ostree": {
|
||||
"ref": "${OSTREE_REF}"
|
||||
},
|
||||
|
|
@ -711,7 +711,7 @@ function createReqFileGCP() {
|
|||
"image_request": {
|
||||
"architecture": "$ARCH",
|
||||
"image_type": "${IMAGE_TYPE}",
|
||||
"repositories": $(jq ".\"$ARCH\"" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json),
|
||||
"repositories": $(jq ".\"$ARCH\" | .[] | select((has(\"image_type_tags\") | not) or (.\"image_type_tags\" | index(\"${IMAGE_TYPE}\")))" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json | jq -s .),
|
||||
"upload_options": {
|
||||
"bucket": "${GCP_BUCKET}",
|
||||
"region": "${GCP_REGION}",
|
||||
|
|
@ -749,7 +749,7 @@ function createReqFileAzure() {
|
|||
"image_request": {
|
||||
"architecture": "$ARCH",
|
||||
"image_type": "${IMAGE_TYPE}",
|
||||
"repositories": $(jq ".\"$ARCH\"" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json),
|
||||
"repositories": $(jq ".\"$ARCH\" | .[] | select((has(\"image_type_tags\") | not) or (.\"image_type_tags\" | index(\"${IMAGE_TYPE}\")))" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json | jq -s .),
|
||||
"upload_options": {
|
||||
"tenant_id": "${AZURE_TENANT_ID}",
|
||||
"subscription_id": "${AZURE_SUBSCRIPTION_ID}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue