Step: storage-obj-save

This step saves existing storage objects (PVs, StorageClasses, CSIDrivers) after cluster installation. These objects are used by storage-obj-check step to tell which of them existed before e2e tests started and which are leftovers of the e2e tests.

Container image used for this step: tests

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

Environment

Step exposes no environmental variables except the defaults.

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
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail

ARTIFACT_DIR=${ARTIFACT_DIR:-/tmp}
SAVE_FILE=${SHARED_DIR}/initial-objects
STORAGE_OBJECTS=pv,csidriver,storageclass

# Try only 10 times, just in case a cluster setup failed.
for i in `seq 10`; do
    echo "Attempt $i"
    if oc get $STORAGE_OBJECTS --no-headers --ignore-not-found -o name > $SAVE_FILE; then
        break;
    fi
    # try until the command succeds
    sleep 5
done

# For debugging
oc get $STORAGE_OBJECTS -o yaml > ${ARTIFACT_DIR}/objects.yaml || :

echo "Saved list of storage objects into $SAVE_FILE"

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/storage/obj/save/storage-obj-save-ref.yaml

Owners:

Approvers:

Reviewers:

Source code for this page located on GitHub