Giter Club home page Giter Club logo

Comments (9)

iamniting avatar iamniting commented on August 26, 2024 1

It will also work with golang 1.18 if you use these changes #187

from lvm-operator.

nbalacha avatar nbalacha commented on August 26, 2024

Can you paste the entire output of the make deploy command?Thanks.

from lvm-operator.

iamniting avatar iamniting commented on August 26, 2024

The command is failing in the manifests target which uses controller-gen, It is possible that you might be using a different version of controller-gen which is not compatible with the command in the makefile.

Can you pls check the controller-gen version also?

from lvm-operator.

bzzwh avatar bzzwh commented on August 26, 2024

Thanks guys. It missed one golang module -
cp config/default/manager_custom_env.yaml.in config/default/manager_custom_env.yaml
sed 's|TOPOLVM_CSI_IMAGE_VAL|quay.io/ocs-dev/topolvm:latest|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_LIVENESSPROBE_IMAGE_VAL|k8s.gcr.io/sig-storage/livenessprobe:v2.5.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_PROVISIONER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_RESIZER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-resizer:v1.3.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_REGISTRAR_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_SNAPSHOTTER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-snapshotter:v5.0.1|g' --in-place config/default/manager_custom_env.yaml
/root/lvm-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
../go/pkg/mod/k8s.io/[email protected]/pkg/labels/selector.go:30:2: missing go.sum entry needed to verify package k8s.io/klog/v2 (imported by k8s.io/apimachinery/pkg/runtime) is provided by exactly one module; to add:
go get k8s.io/apimachinery/pkg/[email protected]
Error: not all generators ran successfully
run controller-gen rbac:roleName=manager-role crd webhook paths=./... output:crd:artifacts:config=config/crd/bases -w to see all available markers, or controller-gen rbac:roleName=manager-role crd webhook paths=./... output:crd:artifacts:config=config/crd/bases -h for usage
make: *** [Makefile:92: manifests] Error 1

When I tried to install it, it failed too.
[root@masperf-aws1]~/lvm-operator# go get k8s.io/apimachinery/pkg/[email protected]

sigs.k8s.io/json/internal/golang/encoding/json

../go/pkg/mod/sigs.k8s.io/[email protected]/internal/golang/encoding/json/encode.go:1249:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
../go/pkg/mod/sigs.k8s.io/[email protected]/internal/golang/encoding/json/encode.go:1255:18: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)

what is golang version I need to make the deploy? I am using go version go1.16.12 linux/amd64

from lvm-operator.

iamniting avatar iamniting commented on August 26, 2024

You can use golang 1.17 or above. I think it should work.

from lvm-operator.

bzzwh avatar bzzwh commented on August 26, 2024

I upgraded golang to 1.18. Now, it cannot /root/lvm-operator/bin/controller-gen .
Here are the steps I did:

  1. upgrade golang 1.18
  2. git clone https://github.com/red-hat-storage/lvm-operator.git
  3. export IMG=quay.io/ocs-dev/lvm-operator
  4. cd lvm-operator
  5. make deploy

cp config/default/manager_custom_env.yaml.in config/default/manager_custom_env.yaml
sed 's|TOPOLVM_CSI_IMAGE_VAL|quay.io/ocs-dev/topolvm:latest|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_LIVENESSPROBE_IMAGE_VAL|k8s.gcr.io/sig-storage/livenessprobe:v2.5.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_PROVISIONER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_RESIZER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-resizer:v1.3.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_REGISTRAR_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_SNAPSHOTTER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-snapshotter:v5.0.1|g' --in-place config/default/manager_custom_env.yaml
go: creating new go.mod: module tmp
Downloading sigs.k8s.io/controller-tools/cmd/[email protected]
go: added github.com/fatih/color v1.12.0
go: added github.com/go-logr/logr v0.4.0
go: added github.com/gobuffalo/flect v0.2.3
go: added github.com/gogo/protobuf v1.3.2
go: added github.com/google/go-cmp v0.5.6
go: added github.com/google/gofuzz v1.1.0
go: added github.com/inconshreveable/mousetrap v1.0.0
go: added github.com/json-iterator/go v1.1.11
go: added github.com/mattn/go-colorable v0.1.8
go: added github.com/mattn/go-isatty v0.0.12
go: added github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: added github.com/modern-go/reflect2 v1.0.1
go: added github.com/spf13/cobra v1.2.1
go: added github.com/spf13/pflag v1.0.5
go: added golang.org/x/mod v0.4.2
go: added golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
go: added golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
go: added golang.org/x/text v0.3.6
go: added golang.org/x/tools v0.1.5
go: added golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: added gopkg.in/inf.v0 v0.9.1
go: added gopkg.in/yaml.v2 v2.4.0
go: added gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: added k8s.io/api v0.22.2
go: added k8s.io/apiextensions-apiserver v0.22.2
go: added k8s.io/apimachinery v0.22.2
go: added k8s.io/klog/v2 v2.9.0
go: added k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
go: added sigs.k8s.io/controller-tools v0.7.0
go: added sigs.k8s.io/structured-merge-diff/v4 v4.1.2
go: added sigs.k8s.io/yaml v1.2.0
/root/lvm-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
bash: /root/lvm-operator/bin/controller-gen: No such file or directory
make: *** [Makefile:92: manifests] Error 127

from lvm-operator.

iamniting avatar iamniting commented on August 26, 2024

You are hitting this error because of golang 1.18 as go get is depricated in golang 1.18. You are required to use go install instead.

Just replace get with install here
https://github.com/red-hat-storage/lvm-operator/blob/main/Makefile#L224

from lvm-operator.

bzzwh avatar bzzwh commented on August 26, 2024

Thanks @iamniting. Now, I hit another issue as below:
[root@masperf-aws1]~/lvm-operator# make deploy
cp config/default/manager_custom_env.yaml.in config/default/manager_custom_env.yaml
sed 's|TOPOLVM_CSI_IMAGE_VAL|quay.io/ocs-dev/topolvm:latest|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_LIVENESSPROBE_IMAGE_VAL|k8s.gcr.io/sig-storage/livenessprobe:v2.5.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_PROVISIONER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_RESIZER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-resizer:v1.3.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_REGISTRAR_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0|g' --in-place config/default/manager_custom_env.yaml
sed 's|CSI_SNAPSHOTTER_IMAGE_VAL|k8s.gcr.io/sig-storage/csi-snapshotter:v5.0.1|g' --in-place config/default/manager_custom_env.yaml
go: creating new go.mod: module tmp
Downloading sigs.k8s.io/controller-tools/cmd/[email protected]
/root/lvm-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
go: creating new go.mod: module tmp
Downloading sigs.k8s.io/kustomize/kustomize/[email protected]
go: sigs.k8s.io/kustomize/kustomize/[email protected] (in sigs.k8s.io/kustomize/kustomize/[email protected]):
The go.mod file for the module providing named packages contains one or
more exclude directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
make: *** [Makefile:200: kustomize] Error 1

from lvm-operator.

bzzwh avatar bzzwh commented on August 26, 2024

After I switched to golang 1.17, everything works. Thanks all for your help!

from lvm-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.