英文:
Go broken import
问题
我正在尝试通过Go SDK与Helm进行交互,但在构建代码时遇到以下错误:
../../../go/pkg/mod/github.com/deislabs/oras@v0.11.1/pkg/oras/push.go:52:31: 调用remotes.PushContent时参数不足
已有 (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, nil, func(images.Handler) images.Handler)
期望 (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, *semaphore.Weighted, platforms.MatchComparer, func(images.Handler) images.Handler)
我追踪到了helm.sh/helm/v3/pkg/action
包:
$ go get helm.sh/helm/v3/pkg/action
# github.com/deislabs/oras/pkg/oras
../../../go/pkg/mod/github.com/deislabs/oras@v0.11.1/pkg/oras/push.go:52:31: 调用remotes.PushContent时参数不足
已有 (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, nil, func(images.Handler) images.Handler)
期望 (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, *semaphore.Weighted, platforms.MatchComparer, func(images.Handler) images.Handler)
我怀疑这与这个更改有关:https://github.com/helm/helm/commit/663c5698878c959805de053116581d15673e1ce3
我该如何解决这个问题?我尝试使用旧版本的helm包,但没有成功。
英文:
I'm trying to interact with helm via the go SDK and I'm getting the following error when I try to build my code:
../../../go/pkg/mod/github.com/deislabs/oras@v0.11.1/pkg/oras/push.go:52:31: not enough arguments in call to remotes.PushContent
have (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, nil, func(images.Handler) images.Handler)
want (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, *semaphore.Weighted, platforms.MatchComparer, func(images.Handler) images.Handler)
I've traced it down to package helm.sh/helm/v3/pkg/action
:
$ go get helm.sh/helm/v3/pkg/action
# github.com/deislabs/oras/pkg/oras
../../../go/pkg/mod/github.com/deislabs/oras@v0.11.1/pkg/oras/push.go:52:31: not enough arguments in call to remotes.PushContent
have (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, nil, func(images.Handler) images.Handler)
want (context.Context, remotes.Pusher, v1.Descriptor, "github.com/containerd/containerd/content".Store, *semaphore.Weighted, platforms.MatchComparer, func(images.Handler) images.Handler)
I suspect that this is related to this change: https://github.com/helm/helm/commit/663c5698878c959805de053116581d15673e1ce3
How do I fix this? I've tried using older versions of the helm package to no avail.
答案1
得分: 1
github.com/containerd/containerd/remotes.PushContent
的签名在commit f8c2f0中发生了不兼容的更改,该更改在v1.5.0
中发布。(尽管containerd
的Go API版本号为v1.5.5
,但它似乎是不稳定的;请参阅containerd#3554)。
短期解决方法是通过go get -d github.com/containerd/containerd@v1.4
将版本降级到最新的v1.4.*
,直到您的依赖项与最新版本兼容为止。
长期解决方法似乎是helm
的commit 663c56,它迁移到了一个与containerd
v1.5 API兼容的不同的oras
库。据我所知,该提交尚未包含在helm
的发布版本中,但您可以尝试使用go get -d helm.sh/helm/v3/pkg/action@main
进行测试;请参阅https://golang.org/doc/modules/managing-dependencies#repo_identifier。
英文:
The signature for github.com/containerd/containerd/remotes.PushContent
was changed incompatibly in commit f8c2f0, which was released in v1.5.0
. (The containerd
Go API appears to be unstable, despite its apparently-semantic version v1.5.5
; see containerd#3554.)
The short-term fix is to go get -d github.com/containerd/containerd@v1.4
to downgrade to the latest v1.4.*
until your dependencies are compatible with the latest release.
The longer-term fix appears to be helm
commit 663c56, which migrates to a different oras
library whose latest release is compatible with the containerd
v1.5 API. As far as I can tell that commit has not yet been included in a helm
release, but you may be able to try it out using go get -d helm.sh/helm/v3/pkg/action@main
; see https://golang.org/doc/modules/managing-dependencies#repo_identifier.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论