support removal of files by the ./hack/update-openapi-spec.sh

This commit is contained in:
Sergey Kanzhelev 2021-12-11 05:43:59 +00:00
parent 747f3c8fd9
commit 0d79a5f20c

View File

@ -103,6 +103,10 @@ curl -w "\n" -kfsS -H 'Authorization: Bearer dummy_token' "https://${API_HOST}:$
kube::log::status "Updating " "${OPENAPI_ROOT_DIR}/v3 for OpenAPI v3"
mkdir -p "${OPENAPI_ROOT_DIR}/v3"
# clean up folder, note that some files start with dot like
# ".well-known__openid-configuration_openapi.json"
rm -r "${OPENAPI_ROOT_DIR}"/v3/{*,.*} || true
curl -w "\n" -kfsS -H 'Authorization: Bearer dummy_token' "https://${API_HOST}:${API_PORT}/openapi/v3" | jq '.Paths' | jq -r '.[]' | while read -r group; do
kube::log::status "Updating OpenAPI spec for group ${group}"
OPENAPI_FILENAME="${group}_openapi.json"