Step: baremetalds-assisted-operator-setup-before-upgrade

Installing Assisted Service Operator and Hive.

Container image used for this step: assisted-service-scripts

assisted-service-scripts 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
INDEX_IMAGE Dependency[?] Pull specification for ci-index image
ASSISTED_INSTALLER_IMAGE Dependency[?] Pull specification for assisted-installer image
ASSISTED_AGENT_IMAGE Dependency[?] Pull specification for assisted-installer-agent image
ASSISTED_CONTROLLER_IMAGE Dependency[?] Pull specification for assisted-installer-controller image
ASSISTED_UPGRADE_OPERATOR Parameter[?] Determines the ASSISTED_OPENSHIFT_VERSION to be used. Before upgrading the operator, the value is set to "true", which signals that the current operator needs to be updated. The value is derived from the default_ocp_versions.json. When set to "true", ASSISTED_OPENSHIFT_VERSION gets the value 4.8. Otherwise, 4.9. After upgrading the operator, the value of this variable is "false". (default: true)
ASSISTED_STOP_AFTER_AGENT_DISCOVERY Parameter[?] Determines if a full cluster deployment is needed. Before upgrading the operator, the value of this variable is "false", which preserves the existing behavior and completes cluster installation. After upgrading the operator, the value of this variable is true. When set to "true", cluster installation will stop after agents are discovered. (default: false)
CATALOG_SOURCE_NAME Parameter[?] (default: community-operators)
CHANNEL_INSTALL_OVERRIDE Parameter[?] (default: ocm-2.3)

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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash

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

echo "************ baremetalds assisted operator setup before upgrade command ************"

# Fetch packet basic configuration
# shellcheck source=/dev/null
source "${SHARED_DIR}/packet-conf.sh"

tar -czf - . | ssh "${SSHOPTS[@]}" "root@${IP}" "cat > /root/assisted-service.tar.gz"

# shellcheck disable=SC2087
ssh "${SSHOPTS[@]}" "root@${IP}" bash - << EOF

set -xeo pipefail

cd /root/dev-scripts
source common.sh
source utils.sh
source network.sh
export -f wrap_if_ipv6 ipversion

REPO_DIR="/home/assisted-service"
if [ ! -d "\${REPO_DIR}" ]; then
  mkdir -p "\${REPO_DIR}"

  echo "### Untar assisted-service code..."
  tar -xzvf /root/assisted-service.tar.gz -C "\${REPO_DIR}"
fi

cd "\${REPO_DIR}"

echo "### Setup assisted installer..."

images=(${ASSISTED_AGENT_IMAGE} ${ASSISTED_CONTROLLER_IMAGE} ${ASSISTED_INSTALLER_IMAGE})

cat << VARS >> /root/config

export DISCONNECTED="false"
export INDEX_IMAGE="${INDEX_IMAGE}"

export PUBLIC_CONTAINER_REGISTRIES="\$(for image in \${images}; do echo \${image} | cut -d'/' -f1; done | sort -u | paste -sd ',' -)"

export ASSISTED_UPGRADE_OPERATOR="${ASSISTED_UPGRADE_OPERATOR}"
export ASSISTED_STOP_AFTER_AGENT_DISCOVERY="${ASSISTED_STOP_AFTER_AGENT_DISCOVERY}"

# Fix for disconnected Hive
export GO_REQUIRED_MIN_VERSION="1.14.4"
VARS

source /root/config

source deploy/operator/upgrade/before_upgrade.sh

deploy/operator/deploy.sh

EOF

Properties

Property Value Description
Resource requests (cpu) 1000m Used in .resources.requests of the pod running this step.
Resource requests (memory) 500Mi Used in .resources.requests of the pod running this step.

GitHub Link:

https://github.com/openshift/release/blob/master/ci-operator/step-registry/baremetalds/assisted/operator/setup/before-upgrade/baremetalds-assisted-operator-setup-before-upgrade-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub