vmware-archive / operator-builder

A Kubebuilder plugin to accelerate the development of Kubernetes operators
MIT License
41 stars 6 forks source link

feat: Implement byop #217

Closed JefeDavis closed 2 years ago

JefeDavis commented 2 years ago

testing instructions:

  1. Clone down operator-builder-tools
  2. Checkout the add-phases branch from my fork of operator-builder-tools
  3. Run Operator-Builder Init
  4. add a replace statement into your go mod file to point to your local operator-builder-tools repo
  5. run operator-builder create
lander2k2 commented 2 years ago

@JefeDavis You seem to be missing the operator-builder-tools entry in go.mod. Needs to be added in internal/plugins/workload/v1/scaffolds/templates/gomod.go

Also, won't I need to use your add-phases branch of operator-builder-tools?

lander2k2 commented 2 years ago

Here's what I did:

  1. clone github.com/JefeDavis/operator-builder-tools and check out add-phases branch
  2. Run make func-test on JefeDavis:implement-byop (which fails as expected)
  3. Add the go.mod replace statement to point to local JefeDavis/operator-builder-tools:add-phases
  4. Re-run make

Here's the error I get:

❯ make
/home/lander2k2/Projects/src/github.com/lander2k2/acme-webstore-mgr/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
# github.com/acme/acme-cnp-mgr/controllers/apps
controllers/apps/webstore_controller.go:209:3: r.InitializePhases undefined (type *WebStoreReconciler has no field or method InitializePhases)
# github.com/acme/acme-cnp-mgr/controllers/apps
vet: controllers/apps/webstore_controller.go:209:4: r.InitializePhases undefined (type *WebStoreReconciler has no field or method InitializePhases)
make: *** [Makefile:50: vet] Error 2
lander2k2 commented 2 years ago

OK working now. LGTM