-
Notifications
You must be signed in to change notification settings - Fork 2k
adding a cleanup to the evaluation tests #68951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: andrej1991 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
dcafdbe to
ef7e2a2
Compare
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
| set -o errexit | ||
| set -o pipefail | ||
|
|
||
| OC_URL="https://api.stage.openshift.com/api/assisted-install/v2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this is called OC_URL, it's the assisted service url...
|
|
||
| if ! command -v ocm >/dev/null 2>&1; then \ | ||
| mkdir -p "${HOME}/.local/bin" && \ | ||
| curl -sSL -o "${HOME}/.local/bin/ocm" "https://github.com/openshift-online/ocm-cli/releases/latest/download/ocm-linux-amd64" && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the API directly (curl) with the secret and id elsewhere, right? Let's just do the same here and not have to download this binary.
|
|
||
| curl -H "Authorization: Bearer $(ocm token)" "${OC_URL}/clusters" > ${ARTIFACT_DIR}/available_clusters.json | ||
| cat ${ARTIFACT_DIR}/available_clusters.json | jq '[.[] |{id, name, created_at}]' > ${ARTIFACT_DIR}/relevant_cluster_data.json | ||
| cat ${ARTIFACT_DIR}/relevant_cluster_data.json | jq -r ".[] | select(.created_at < \"${past_time}\") | .id" > ${ARTIFACT_DIR}/clusters_to_delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we don't expect to have too many of these, right? Maybe 100 at most?
Seems like we could do something a bit more well defined (that doesn't rely on string comparing dates) if we first convert the date we're interested in and created_at to unix timestamps then compare those.
adding a cleanup to the evaluation tests