Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.63 KB

HACKING.md

File metadata and controls

66 lines (45 loc) · 1.63 KB

Hacking on forklift-controller

Building and running forklift-controller with make run

1. Install prerequisites

  • golang compiler (tested @ 1.11.5)
  • dep (tested @ v0.5.0)

2. Clone the project to your $GOPATH

Clone forklift-controller to your $GOPATH so that dependencies in vendor will be found at build time.

# Sample of setting $GOPATH
mkdir -p $HOME/go
export GOPATH="$HOME/go"

# Running 'go get -d' will clone the forklift-controller repo into the proper
# location on your $GOPATH
go get -d github.com/konveyor/forklift-controller

# Take a peek at the newly cloned files
ls -Fal $GOPATH/src/github.com/konveyor/forklift-controller

__5. Login __

$ oc login

__4. Create required CRDs __

TBD


5. Use make run to start the controller.

$ make run

go generate ./pkg/... ./cmd/...
go fmt ./pkg/... ./cmd/...
go vet ./pkg/... ./cmd/...
go run ./cmd/forklift-controller/main.go
{"level":"info","ts":1555619492,"logger":"entrypoint","msg":"setting up client for manager"}
{"level":"info","ts":1555619492,"logger":"entrypoint","msg":"setting up manager"}
{"level":"info","ts":1555619493,"logger":"entrypoint","msg":"Registering Components."}

[...]

Useful make targets

There are several useful Makefile targets for forklift-controller that developers should be aware of.

Command Description
run Build a controller manager binary and run the controller against the active cluster
install Install generated CRDs onto the active cluster
manifests Generate updated CRDs from types.go files, RBAC from annotations in controller, deploy manifest YAML