#!/bin/bash set -euo pipefail # Restart the named component by stopping its base container. if [[ -z "${1-}" ]]; then echo "A component name like 'api', 'etcd', or 'controllers' must be specified." 1>&2 exit 1 fi container=$(docker ps -l -q --filter "label=openshift.io/component=${1}" --filter "label=io.kubernetes.container.name=POD") if [[ -z "${container}" ]]; then echo "Component ${1} is already stopped" 1>&2 exit 0 fi exec docker stop "${container}" --time 30 >/dev/null