Clone and Build¶
Clone¶
Warning
This repository needs to be accessible in your GOPATH
. The examples use the root
user and GOPATH=/root/go
Warning
Due to current constraints in golang, relative paths are not supported. You must clone this repository under your GOPATH
. If not, the operator-sdk
build operation may fail.
1 2 3 4 5 6 7 8 | # Set up some helpful variables
export GOPATH="/root/go"
export IBM_DIR="$GOPATH/src/github.com/IBM"
# Ensure the dir is present then clone.
mkdir -p ${IBM_DIR}
cd ${IBM_DIR}
git clone https://github.com/IBM/ibm-spectrum-scale-csi-operator.git
|
Build¶
Environment¶
To assist in proper configuration of the build environment, a playbook is provided:
ansible-playbook $GOPATH/src/github.com/IBM/ibm-spectrum-scale-csi-operator/ansible/dev-env-playbook.yaml
Create the the Image¶
Navigate to the operator directory and use operator-sdk
to build the container image.
# IBM_DIR is defined in the previous step
export OPERATOR_DIR="$IBM_DIR/ibm-spectrum-scale-csi-operator"
cd ${OPERATOR_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator
export GO111MODULE="on"
operator-sdk build csi-scale-operator
Note
This requires docker