[英]How to add new packages in Kubernetes
作為標題,我在Kubernetes的plugin/pkg/scheduler/algorithm/priorities
文件夾中添加了一個新的算法包。 它是一個文件夾,有一些Go源文件,例如util
文件夾。 但是,當運行make
,出現了錯誤:
test/e2e_node/e2e_node.test
cmd/gke-certificates-controller
plugin/pkg/scheduler/algorithm/priorities/test.go:7:2: no buildable Go source files in /home/zhangjian/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/priorities/test
!!! [0703 09:22:46] Call tree:
!!! [0703 09:22:46] 1: /home/zhangjian/src/k8s.io/kubernetes/hack/lib/golang.sh:740 kube::golang::build_binaries_for_platform(...)
!!! [0703 09:22:46] 2: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0703 09:22:46] Call tree:
!!! [0703 09:22:46] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0703 09:22:46] Call tree:
!!! [0703 09:22:46] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [all] Error 1
它們確實是Go文件,我不知道錯誤的原因。 還是我想念的其他東西?
我只想將我自己的算法包(不是第三個庫,例如exapmle.com/xxx/xxx
)添加到priority
,那么該怎么做?
我提到了community / contributors / devel / godep.md並嘗試go build ./...
./hack/godep-restore.sh
go build ./...
, go build ./...
./hack/godep-restore.sh
go build ./...
./hack/godep-restore.sh
, go build ./...
./hack/godep-restore.sh
go build ./...
./hack/godep-save.sh
命令,但仍然無法正常工作。
原來是CGO_ENABLED
變量引起的問題,盡管您在環境變量中啟用了它,但仍需要在hack/lib/golang.sh
文件(kubernetes項目的文件)中將其設置為啟用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.