open-hand / choerodon-cluster-agent

choerodon cluster agent
Apache License 2.0
16 stars 30 forks source link

How to fix the error of `undefined: meta.VersionInterfaces` #4

Open ycyin opened 2 years ago

ycyin commented 2 years ago

When i clone after,make command caused this error.How to fix it ,thank you very much.

yyc@yyc-virtual-machine:~/work/src/choerodon-cluster-agent$ go mod download
yyc@yyc-virtual-machine:~/work/src/choerodon-cluster-agent$ go build
package github.com/choerodon/choerodon-cluster-agent: build constraints exclude all Go files in /home/yyc/work/src/choerodon-cluster-agent
yyc@yyc-virtual-machine:~/work/src/choerodon-cluster-agent$ make
GOBIN=/home/yyc/work/src/choerodon-cluster-agent/bin go install -tags '' -ldflags '-X github.com/choerodon/choerodon-cluster-agent/pkg/version.GitCommit=27affc06ef90524aee5ca034e3635e5ff34383a8 -X github.com/choerodon/choerodon-cluster-agent/pkg/version.GitTreeState=clean' github.com/choerodon/choerodon-cluster-agent/...
# github.com/choerodon/choerodon-cluster-agent/pkg/apis/certificate/v1/client/informers/externalversions/certmanager/v1
pkg/apis/certificate/v1/client/informers/externalversions/certmanager/v1/certificate.go:65:35: client.CertmanagerV1().Certificates undefined (type "github.com/choerodon/choerodon-cluster-agent/pkg/apis/certificate/v1/client/clientset/versioned/typed/certmanager/v1".CertmanagerV1Interface has no field or method Certificates)
pkg/apis/certificate/v1/client/informers/externalversions/certmanager/v1/certificate.go:71:35: client.CertmanagerV1().Certificates undefined (type "github.com/choerodon/choerodon-cluster-agent/pkg/apis/certificate/v1/client/clientset/versioned/typed/certmanager/v1".CertmanagerV1Interface has no field or method Certificates)
# k8s.io/apimachinery/pkg/apimachinery
certificate/apimachinery/types.go:48:57: undefined: meta.VersionInterfaces
certificate/apimachinery/types.go:51:52: undefined: meta.VersionInterfaces
certificate/apimachinery/types.go:57:79: undefined: meta.VersionInterfaces
certificate/apimachinery/types.go:69:89: undefined: meta.VersionInterfaces
certificate/apimachinery/types.go:74:63: undefined: meta.VersionInterfaces
make: *** [Makefile:16: build] Error 2

my go env:

yyc@yyc-virtual-machine:~/work/src/choerodon-cluster-agent$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/yyc/.cache/go-build"
GOENV="/home/yyc/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/yyc/work/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/yyc/work"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/home/yyc/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/yyc/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/yyc/work/src/choerodon-cluster-agent/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1460433679=/tmp/go-build -gno-record-gcc-switches"