salesforce / craft

CRAFT removes the language barrier to create Kubernetes Operators.
BSD 3-Clause "New" or "Revised" License
93 stars 15 forks source link

Some ERROR logs are labelled as [INFO] #5

Open supra08 opened 4 years ago

supra08 commented 4 years ago

While running the craft create command, it threw some errors in the logs but those were labelled as [INFO]:

INFO[0014] main.go:24:2: package wordpress/controllers is not in GOROOT (/usr/local/opt/go/libexec/src/wordpress/controllers)
INFO[0014] Error: not all generators ran successfully
INFO[0014] run `controller-gen object:headerFile=./hack/boilerplate.go.txt paths=./... -w` to see all available markers, or `controller-gen object:headerFile=./hack/boilerplate.go.txt paths=./... -h` for usage
INFO[0014] make: *** [generate] Error 1
INFO[0014] exit status 2
FATA[0014] exit status 1
vnzongzna commented 4 years ago

Hey @supra08, My guess is kubebuilder isn't installed properly with all the dependencies but to get around this error can you do

go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.4

controller-gen should be in your path

supra08 commented 4 years ago

No still no success. What I suspect is wordpress/controllers is not generated properly. It is empty. It is showing an import error in main.go:

    wordpressv1 "wordpress/api/v1"
      23
✖     24     "wordpress/controllers" compiler: could not import wordpress/controllers (no package for import wordpress/controllers)
      25
      26     "k8s.io/apimachinery/pkg/runtime"
supra08 commented 4 years ago

I guess it is failing to build because of this: https://github.com/salesforce/craft/blob/master/cmd/build.go#L128 It supports linux but I am building on mac.

vnzongzna commented 4 years ago

That section of build.goisn't for the user, it's for the container (building the manager binary that we can add in the container) can you tell which version of kubebuilder you are using?

supra08 commented 4 years ago
Version: version.Version{KubeBuilderVersion:"2.2.0", KubernetesVendor:"1.15.5", GitCommit:"0824a139f59e109c9e418a0b6e71a53c6e9e144f", BuildDate:"2019-11-20T00:00:24Z", GoOs:"unknown", GoArch:"unknown"}