Step: ocm-e2e-kind-destroy

This step destroys the AWS VM created to run KinD based tests.

Container image used for this step: open-cluster-management/builder:go1.16-linux

open-cluster-management/builder:go1.16-linux resolves to an image imported from the specified imagestream tag on the build farm (documentation).

Environment

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

Variable Name Type Variable Content
AWS_CREDENTIALS_SECRET Parameter[?] The name of the kube secret with the AWS credentials.

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

# Switch to the shared directory which is used as the TF work directory
cd "$SHARED_DIR" || exit 1

# Create a temporary plugin cache directory
tf_dir=$(mktemp -d -t tf-XXXXX)
export TF_PLUGIN_CACHE_DIR="$tf_dir"

# TF settings
export TF_IN_AUTOMATION=true
export TF_LOG=DEBUG
export TF_INPUT=false

# Variables needed for destroy
export TF_VAR_aws_secret="$AWS_CREDENTIALS_SECRET"

# Rerun init because plugin cache is not preserved between steps
export TF_LOG_PATH="$ARTIFACT_DIR/terraform_destroy_init.logs"
terraform init

# Destroy resources
export TF_LOG_PATH="$ARTIFACT_DIR/terraform_destroy.logs"
terraform destroy -auto-approve

Properties

Property Value Description
Resource requests (cpu) 100m 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/ocm/e2e/kind/destroy/ocm-e2e-kind-destroy-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub