Skip to content

Commit f03b9ed

Browse files
authored
fix(get_catalog_entity_count): change the api endpoint to provide accurate entity counts (#305)
Signed-off-by: Pavel Macík <pavel.macik@gmail.com>
1 parent 50a495d commit f03b9ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ci-scripts/rhdh-setup/deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
66
source "$(python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$SCRIPT_DIR"/../../test.env)"
77

88
# shellcheck disable=SC1091
9-
source ./create_resource.sh
9+
source "${SCRIPT_DIR}/create_resource.sh"
1010

1111
[ -n "${QUAY_TOKEN}" ]
1212
[ -n "${GITHUB_TOKEN}" ]
@@ -317,7 +317,7 @@ create_objs() {
317317
get_catalog_entity_count() {
318318
entity_type=$1
319319
ACCESS_TOKEN=$(get_token "rhdh")
320-
curl -s -k "$(backstage_url)/api/catalog/entity-facets?facet=kind" --cookie "$COOKIE" --cookie-jar "$COOKIE" -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$ACCESS_TOKEN" | tee -a "$TMP_DIR/get_$(echo "$entity_type" | tr '[:upper:]' '[:lower:]')_count.log" | jq -r '.facets.kind[] | select(.value == "'"$entity_type"'")| .count'
320+
curl -s -k "$(backstage_url)/api/catalog/entities/by-query?limit=0&filter=kind%3D${entity_type}" --cookie "$COOKIE" --cookie-jar "$COOKIE" -H 'Content-Type: application/json' -H 'Authorization: Bearer '"$ACCESS_TOKEN" | tee -a "$TMP_DIR/get_$(echo "$entity_type" | tr '[:upper:]' '[:lower:]')_count.log" | jq -r '.totalItems'
321321
}
322322

323323
backstage_install() {

0 commit comments

Comments
 (0)