Step: ocm-e2e-clusterpool-checkin

This step checks clusters back in to the cluster pool. The cluster claims to check in are listed in the file specified by CLUSTER_CLAIM_FILE the SHARED_DIR. If this file is missing no clusters will be checked in. If a cluster claim is removed from the file, it will not be checked in.

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
MAKEFILE Parameter[?] Location of the build harness Makefile for use on OSCI. (default: /opt/build-harness/Makefile.prow)
CLUSTERPOOL_HOST_API Parameter[?] API URL of the cluster running the target clusterpool, used in oc login, so port :6443 is required (default: https://api.collective.aws.red-chesterfield.com:6443)
CLUSTERPOOL_HOST_NAMESPACE Parameter[?] Namespace on the cluster pool host to use.
CLUSTERPOOL_HOST_PROW_KUBE_SECRET Parameter[?] The name of the kube secret with the kube API user and token.
CLUSTER_CLAIM_FILE Parameter[?] File name that stores the cluster claim names. (default: cluster-claims)

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

temp=$(mktemp -d -t ocm-XXXXX)
cd $temp || exit 1

cp "$MAKEFILE" ./Makefile

cluster_claims="${SHARED_DIR}/${CLUSTER_CLAIM_FILE}"

if [[ ! -r "$cluster_claims" ]]; then
    echo "The cluster claim file does not exist. Not checking in any clusters."
    exit 0
fi

for claim in $(cat "$cluster_claims"); do
    make clusterpool/checkin CLUSTERPOOL_CLUSTER_CLAIM="$claim"

    if [[ "$?" == 0 ]]; then
        echo "Cluster checked in: $claim"
    else
        echo "Error checking in cluster for claim $claim"
    fi
done

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/clusterpool/checkin/ocm-e2e-clusterpool-checkin-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub