4 SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
5 LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib"
7 source $LIBDIR/logging.sh
8 source $LIBDIR/common.sh
12 if command -v kubectl; then
13 kubectl get all -n baremetal-operator-system
17 # This may be used to update the in-place Bare Metal Operator YAML
18 # files from the upstream project
19 function build_source {
20 clone_baremetal_operator_repository
21 KUSTOMIZATION_FILES=$(find ${BMOPATH}/config/kustomization.yaml ${BMOPATH}/config/{namespace,default,crd,rbac,manager,webhook,certmanager} -type f)
22 for src in ${KUSTOMIZATION_FILES}; do
23 dst=${src/${BMOPATH}\/config/${SCRIPTDIR}\/base}
24 mkdir -p $(dirname ${dst})
30 kustomize build ${SCRIPTDIR}/icn | kubectl apply -f -
31 kubectl wait --for=condition=Available --timeout=600s deployment/baremetal-operator-controller-manager -n baremetal-operator-system
35 kustomize build ${SCRIPTDIR}/icn | kubectl delete --ignore-not-found=true -f -
39 "build-source") build_source ;;
43 Usage: $(basename $0) COMMAND
46 build-source - Rebuild the in-tree Bare Metal Operator YAML files
47 clean - Remove the Bare Metal Operator
48 deploy - Deploy the Bare Metal Operator