Skip to content

Commit

Permalink
add doc and test for running operators locally
Browse files Browse the repository at this point in the history
- add code documentation for environment variables
- add test to check that the operators are running locally
- add user example
  • Loading branch information
maelk committed Aug 14, 2019
1 parent 569475a commit be7a5e8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 03_launch_mgmt_cluster.sh
Expand Up @@ -9,6 +9,20 @@ source lib/common.sh
eval "$(go env)"
export GOPATH

# Environment variables
# M3PATH : Path to clone the metal3 dev env repo
# BMOPATH : Path to clone the baremetal operator repo
# CAPBMPATH: Path to clone the CAPI operator repo
#
# BMOREPO : Baremetal operator repository URL
# BMOBRANCH : Baremetal operator repository branch to checkout
# CAPBMREPO : CAPI operator repository URL
# CAPBMBRANCH : CAPI repository branch to checkout
# FORCE_REPO_UPDATE : discard existing directories
#
# BMO_RUN_LOCAL : run the baremetal operator locally (not in Kubernetes cluster)
# CAPBM_RUN_LOCAL : run the CAPI operator locally

M3PATH="${GOPATH}/src/github.com/metal3-io"
BMOPATH="${M3PATH}/baremetal-operator"
CAPBMPATH="${M3PATH}/cluster-api-provider-baremetal"
Expand Down
8 changes: 8 additions & 0 deletions 04_verify.sh
Expand Up @@ -194,6 +194,14 @@ FAILS=$(check_k8s_entity deployments "${EXPTD_DEPLOYMENTS}")
# Verify the Operators, Replica sets
FAILS=$(check_k8s_rs "${EXPTD_DEPLOYMENTS}")

if [[ "${BMO_RUN_LOCAL}" == true ]]; then
pgrep "operator-sdk" > /dev/null 2> /dev/null
FAILS=$(process_status $? "Baremetal operator locally running")
fi
if [[ "${CAPBM_RUN_LOCAL}" == true ]]; then
pgrep -f "go run ./cmd/manager/main.go" > /dev/null 2> /dev/null
FAILS=$(process_status $? "CAPI operator locally running")
fi

#Verify Ironic containers are running
for name in ironic ironic-inspector dnsmasq httpd mariadb; do
Expand Down
10 changes: 10 additions & 0 deletions config_example.sh
Expand Up @@ -46,3 +46,13 @@
# Force deletion of the BMO and CAPBM repositories before cloning them again
#
#export FORCE_REPO_UPDATE="${FORCE_REPO_UPDATE:-false}"

#
# Run a local baremetal operator instead of deploying in Kubernetes
#
#export BMO_RUN_LOCAL=true

#
# Run a local CAPI operator instead of deploying in Kubernetes
#
#export CAPBM_RUN_LOCAL=true

0 comments on commit be7a5e8

Please sign in to comment.