kubernetes-sigs / kubebuilder-declarative-pattern

A toolkit for building declarative operators with kubebuilder
Apache License 2.0
254 stars 84 forks source link

error getting apply options: must specify one of -f and -k #224

Closed jcanseco closed 2 years ago

jcanseco commented 2 years ago

What happened: Our operator started failing to apply manifests and logging the following error:

{"severity":"error","timestamp":"2022-06-09T21:00:50.772Z","msg":"applying manifest","error":"error getting apply options: must specify one of -f and -k"}

This started happening after we bumped our kubebuilder-declarative-pattern dependency to commit fe5be9431eae158f86f9de23000a9a2ec06745fc.

What you expected to happen: For our operator to continue to be able to apply manifests successfully.

How to reproduce it (as minimally and precisely as possible): You can reproduce the same error by going through the guestbook operator example.

Make sure to update the kubebuilder-declarative-pattern dependency before you run the controller:

go get -u sigs.k8s.io/kubebuilder-declarative-pattern@fe5be9431eae158f86f9de23000a9a2ec06745fc
go mod tidy

After running make run, you'll see the following error:

1.6548110787980578e+09  ERROR   applying manifest       {"error": "error getting apply options: must specify one of -f and -k"}

Anything else we need to know?: This issue is currently blocking us from bumping our controller-runtime dependency to get a fix that we need to stop our unit tests from failing frequently due to flakes.

Environment: