Step: upi-gcp-nested-post

This step deprovisions the gcloud deployments created by upi-install-gcp-nested.

Container image used for this step: libvirt-installer

libvirt-installer 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
HOME Parameter[?] (default: /tmp/secret)
NSS_WRAPPER_PASSWD Parameter[?] (default: /tmp/secret/passwd)
NSS_WRAPPER_GROUP Parameter[?] (default: /tmp/secret/group)
NSS_USERNAME Parameter[?] (default: packer)
NSS_GROUPNAME Parameter[?] (default: packer)

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
29
30
31
32
33
34
#!/bin/bash

set -eo pipefail

INSTANCE_PREFIX="${NAMESPACE}-${JOB_NAME_HASH}"
GOOGLE_PROJECT_ID="$(< ${CLUSTER_PROFILE_DIR}/openshift_gcp_project)"
GOOGLE_COMPUTE_REGION="${LEASED_RESOURCE}"
GOOGLE_COMPUTE_ZONE="$(< ${SHARED_DIR}/openshift_gcp_compute_zone)"
if [[ -z "${GOOGLE_COMPUTE_ZONE}" ]]; then
  echo "Expected \${SHARED_DIR}/openshift_gcp_compute_zone to contain the GCP zone"
  exit 1
fi

function teardown() {
  # This is for running the gcloud commands
  mock-nss.sh
  gcloud auth activate-service-account \
    --quiet --key-file "${CLUSTER_PROFILE_DIR}/gce.json"
  gcloud --quiet config set project "${GOOGLE_PROJECT_ID}"
  gcloud --quiet config set compute/zone "${GOOGLE_COMPUTE_ZONE}"
  gcloud --quiet config set compute/region "${GOOGLE_COMPUTE_REGION}"

  set -x
  set +e

  echo "Deprovisioning cluster ..."
  gcloud compute instances delete "${INSTANCE_PREFIX}" --quiet
  gcloud compute firewall-rules delete "${INSTANCE_PREFIX}" --quiet
  gcloud compute networks subnets delete "${INSTANCE_PREFIX}" --quiet
  gcloud compute networks delete "${INSTANCE_PREFIX}" --quiet
}

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

Properties

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

GitHub Link:

https://github.com/openshift/release/blob/master/ci-operator/step-registry/upi/gcp/nested/post/upi-gcp-nested-post-ref.yaml

Owners:

Approvers:

Reviewers:

Source code for this page located on GitHub