seaweedfs / seaweedfs-operator

seaweedfs kubernetes operator
Apache License 2.0
174 stars 42 forks source link

controller-gen file missing and missing required field in io.k8s.api.admissionregistration.v1.MutatingWebhook #75

Closed rkmsk closed 1 year ago

rkmsk commented 2 years ago

I've stumbled across 2 issues:

1) I had to manually do go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.0 otherwise I got an error

<my home>/go/bin/controller-gen "crd:trivialVersions=true,preserveUnknownFields=false" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/bin/sh: <my home>/go/bin/controller-gen: No such file or directory
make: *** [manifests] Error 127

2) There is a bug in seaweedfs-operator/config/webhook/manifests.yaml where

  sideEffects: None
  admissionReviewVersions:
  - v1
  - v1beta1

is missing for

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  creationTimestamp: null
  name: mutating-webhook-configuration

thus showing an error on make deploy

chrislusf commented 2 years ago

Could you please send a PR?

rkmsk commented 2 years ago

Done. Issue with controller-tools could be my local one, as I didn't make any changes to project files.

mathe-matician commented 1 year ago

I had to manually do go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.0 otherwise I got an error

@rkmsk @chrislusf, the issue here for me was the same with go get in the Makefile. go get is deprecated since go1.17. I'm using go1.19, and changing the go gets to go install in the Makefile allowed make install to work.

chrislusf commented 1 year ago

@mathe-matician thanks! Updated. Please help to confirm the fix.

mathe-matician commented 1 year ago

@chrislusf yep that works, I pulled the repo and ran make install, it was successful on the first go. Thanks!