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 kubectl get all -n baremetal-operator-system
15 # This may be used to update the in-place Bare Metal Operator YAML
16 # files from the upstream project
17 function build_source {
18 clone_baremetal_operator_repository
19 KUSTOMIZATION_FILES=$(find ${BMOPATH}/config/kustomization.yaml ${BMOPATH}/config/{namespace,default,crd,rbac,manager,webhook,certmanager} -type f)
20 for src in ${KUSTOMIZATION_FILES}; do
21 dst=${src/${BMOPATH}\/config/${SCRIPTDIR}\/base}
22 mkdir -p $(dirname ${dst})
28 kustomize build ${SCRIPTDIR}/icn | kubectl apply -f -
29 kubectl wait --for=condition=Available --timeout=600s deployment/baremetal-operator-controller-manager -n baremetal-operator-system
33 kustomize build ${SCRIPTDIR}/icn | kubectl delete -f -
37 "build-source") build_source ;;
41 Usage: $(basename $0) COMMAND
44 build-source - Rebuild the in-tree Bare Metal Operator YAML files
45 clean - Remove the Bare Metal Operator
46 deploy - Deploy the Bare Metal Operator