Step: openstack-deprovision-deletednsrecords

This steps deletes the dns records created by the test. Expects ${SHARED_DIR}/api-record.json and ${SHARED_DIR}/ingress-record.json to exists.

Container image used for this step: openstack-installer

openstack-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
BASE_DOMAIN Parameter[?] Base comain name to use for deletion records.

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
#!/usr/bin/env bash

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

export AWS_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"
export AWS_DEFAULT_REGION=us-east-1
export AWS_DEFAULT_OUTPUT=json
export AWS_PROFILE=profile

HOSTED_ZONE_ID=$(aws route53 list-hosted-zones-by-name --dns-name "${BASE_DOMAIN}" | python -c '
import json,sys
print(json.load(sys.stdin)["HostedZones"][0]["Id"].split("/")[-1])'
)

for RECORD_FILE in api-record.json ingress-record.json
do
    if [[ -f "${SHARED_DIR}/${RECORD_FILE}" ]]; then
        echo Deleting ${RECORD_FILE}
        sed '
            s/UPSERT/DELETE/;
            s/Create/Delete/;
            ' "${SHARED_DIR}/${RECORD_FILE}" > "${SHARED_DIR}/delete-${RECORD_FILE}"
        aws route53 change-resource-record-sets --hosted-zone-id "$HOSTED_ZONE_ID" --change-batch "file://${SHARED_DIR}/delete-${RECORD_FILE}" || echo "Failed deleting ${RECORD_FILE}"
    else
        echo ${RECORD_FILE} NOT found. DNS record not deleted.
    fi
done

Properties

Property Value Description
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/openstack/deprovision/deletednsrecords/openstack-deprovision-deletednsrecords-ref.yaml

Owners:

Approvers:

Reviewers:

Source code for this page located on GitHub