我遇到了一个我要包含在多个项目中的库问题
# github.com/pcs-services/message-queue-operator/pkg/controller/messagequeue
pkg/controller/messagequeue/messagequeue_controller.go:167:129: cannot use instance.ObjectMeta.GetUID() (type "github.com/pcs-services/message-queue-operator/vendor/k8s.io/apimachinery/pkg/types".UID) as type "github.com/pcs-services/grafana/vendor/k8s.io/apimachinery/pkg/types".UID in argument to grafana.DeployGrafana
文件在主项目中与
相同$ md5 k8s.io/apimachinery/pkg/types/uid.go
MD5 (k8s.io/apimachinery/pkg/types/uid.go) = cc286eae550982db7f93c079e0df1f52
$ md5 k8s.io/apimachinery/pkg/types/uid.go
MD5 (k8s.io/apimachinery/pkg/types/uid.go) = cc286eae550982db7f93c079e0df1f52
k8s.io/apimachinery
是在主应用程序中提供的,而不是在库中提供的。
答案 0 :(得分:0)
错误提示:
pkg/controller/messagequeue/messagequeue_controller.go:167:129:
cannot use instance.ObjectMeta.GetUID() (type
"github.com/pcs-services/message-queue-operator/vendor/k8s.io/apimachinery/pkg/types".UID)
as type
"github.com/pcs-services/grafana/vendor/k8s.io/apimachinery/pkg/types".UID
in argument to grafana.DeployGrafana
因此,您正在使用github.com/pcs-services/grafana/vendor/k8s.io/apimachinery/pkg/types.UID
,但已导入github.com/pcs-services/message-queue-operator/vendor/k8s.io/apimachinery/pkg/types.UID
。检查您的导入,并可能运行dep ensure
(如果使用的是dep)将正确的依赖项复制到供应商文件夹中。