Closed johanneskastl closed 1 year ago
Any ideas, anyone?
(Still happens with 1.4.6 of talos)
Thanks for reporting. This is an issue with talos upstream's use of a go.work
workspace for the module module-sig-verify
in directory hack/module-sig-verify
. I have verified that the behavior is the same with our packaged go1.21 and the upstream binary toolchain download. I do not yet know if many workspace mods will have this issue or if it is specific to module-sig-verify
. Running go mod verify
directly in hack/module-sig-verify
fails with the same error, so I suspect it is specific.
There is currently an upstream Go issue that is directly related: https://github.com/golang/go/issues/62663
The initial workspaces proposal stated that go.work
was not intended to be a committed file. Current upstream consensus seems to be that in certain limited circumstances and workflows, it can be useful to commit go.work
workspaces to source code repositories. We may see a small number of projects doing this over time and will support that use case if possible.
I do not plan to add an option to skip the go mod verify
step.
Thanks for taking a look, @jfkw! Any workaround for the time being? I would really like to package talosctl, but without too much manual work...
Is it only talosctl
that is wanted for vendoring and packaging at this time? If so, it might be possible to remove parts of the large source tree ("Talos Linux is a modern Linux distribution built for Kubernetes"). It turns out only removing the committed go.work
is necessary:
talos> rm go.work
talos> go mod verify
all modules verified
talos> go build ./cmd/talosctl/
talos> git status
D go.work
?? talosctl
?? vendor/
talos> ./talosctl --help
A CLI for out-of-band management of Kubernetes nodes created by Talos
Usage:
talosctl [command]
Available Commands:
apply-config Apply a new configuration to a node
bootstrap Bootstrap the etcd cluster on the specified node.
(...)
The obs-service-go_modules
runs in a separate service phase before the rpmbuild %prep
step could issue the rm
command. We'll need a solution to remove or ignore the file at that time. obs_scm
/tar_scm
has exclude features that would do it while building the archive.
I'm open to supporting an "ignore go.work" feature in obs-service-go_modules
, but that will first require some planning and more information on how Go upstream plans to handle the presence of go.work
during go mod verify
. If upstream added an argument to the command to ignore, we would support that. Or perhaps they will detect and ignore go.work
transparently.
The talos workspace module is the example discussed in the upstream issue, it seems like it will get the necessary attention and an eventual fix at a date TBD.
Thanks @jfkw , ignoring the go.work file in the obs_scm service seems to work.
Good to hear, closing.
The plan is that our go mod verify
usage will support the eventual Go upstream recommendation for handling committed go.work
files and workspaces. That may be via an added argument to ignore, or transparent detection by the go mod verify
command.
I am trying to packages talosctl based on https://github.com/siderolabs/talos. But the verify step fails. Not sure if this is an error in the service or the talos go files?
Here is the _service file: