Step: osd-delete-delete

Deletes a cluster in an OSD environment using ocm.

Container image used for this step: cli-ocm

cli-ocm resolves to an image built or imported by the ci-operator configuration (documentation).

Environment

In addition to the default environment, the step exposes the following:

Variable Name Type Variable Content
OCM_LOGIN_URL Parameter[?] ocm login URL (default: staging)

Source Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM

SSO_CLIENT_ID=$(cat "${CLUSTER_PROFILE_DIR}/sso-client-id")
SSO_CLIENT_SECRET=$(cat "${CLUSTER_PROFILE_DIR}/sso-client-secret")

# ocm login created files here that we now use to delete the cluster
export HOME=${SHARED_DIR}

echo "Logging into ${OCM_LOGIN_URL} SSO"
ocm login --url "${OCM_LOGIN_URL}" --client-id "${SSO_CLIENT_ID}" --client-secret "${SSO_CLIENT_SECRET}"

CLUSTER_ID=$(cat "${HOME}/cluster-id")
echo "Deleting cluster-id: ${CLUSTER_ID}"

ocm delete "/api/clusters_mgmt/v1/clusters/${CLUSTER_ID}"
echo "Waiting for cluster deletion..."
while ocm get "/api/clusters_mgmt/v1/clusters/${CLUSTER_ID}" ; do
  sleep 60
done

echo "Cluster is no longer accessible; delete successful"
exit 0

Properties

Property Value Description
Step timeout[?] 25m0s Limits the execution time of the step.
Termination grace period[?] 10m0s Period of time until SIGKILL signal is sent to the test pod (after SIGTERM signal is sent).
Resource requests (cpu) 100m Used in .resources.requests of the pod running this step.
Resource requests (memory) 300Mi Used in .resources.requests of the pod running this step.

GitHub Link:

https://github.com/openshift/release/blob/master/ci-operator/step-registry/osd/delete/delete/osd-delete-delete-ref.yaml

Owners:

Approvers:

Reviewers:

Source code for this page located on GitHub