- In developing!
- Summary: Create your dev branch and sent PR to branch
integration-hack-attack
- Clone this repo:
git clone https://github.com/jicahoo/csi-unity.git
- Create your branch:
git checkout -b <your_branch_name> --track origin/integration-hack-attack
- Code changes on your branch. Add and commit your changes
- Push your changes to server to keep your work
git push origin <your_branch_name>
- build&test to make sure your code is OK before PR.
- Login GitHub and send PR to branch
integration-hack-attack
.- Add reviewers if you want.
- There will travis CI build check.
- Resolve conflicting if any.
- Merge it by yourself (after traivs build passed.)
- Any unix-like OS installed with Go can be used to develop this project.
- Below steps are just a possible option using docker to deveop this project.
-
Use git to clone code. You can use vim to edit these code.
cd <your_code_dir>
git clone https://github.com/jicahoo/csi-unity.git
-
Start golang docker and enter into it.
- Get golang image:
docker pull golang
- Start a golang docker container in detached mode and mount your code path to it.
- Create a container with name csi-unity
docker run -dti --name csi-unity -v <your_code_dir>/csi-unity:/go/src/github.com/jicahoo/csi-unity golang
- Note: The target path in container MUST be set as
/go/src/github.com/jicahoo/csi-unity
. Or you CAN'T start compile/run csi-unity successfully. - Enter into the container:
docker exec -ti csi-unity /bin/bash
- Create a container with name csi-unity
- Get golang image:
cd $GOPATH/src/github.com/jicahoo/csi-unity
go install
. This command will generate exe file $GOPATH/bin/csi-unityexport CSI_ENDPOINT=csi.sock
$GOPATH/bin/csi-unity
. The command will start the csi-unity server.
- In command line,
go test ./...
- Test tool: https://github.com/rexray/gocsi/tree/master/csc . csc is client of csi plugin.
- Install the test tool csc.
go get github.com/rexray/gocsi/csc
- You will find binary
csc
at $GOPATH/bin
- Prerequisite:
export CSI_ENDPOINT=csi.sock
- Commands:
./csc controller list-volumes
csc controller list-volumes --max-entries 100
csc controller get-capacity
CSI_ENDPOINT=tcp://127.0.0.1:34555 X_CSI_REQ_LOGGING=true X_CSI_REP_LOGGING=true X_CSI_LOG_LEVEL=debug go run main.go
- Go package dependency tool: https://github.com/golang/dep