kubernetes-sigs / krew

📦 Find and install kubectl plugins
https://krew.sigs.k8s.io
Apache License 2.0
6.33k stars 364 forks source link

Cross platfrom (Windows) install testing failing on Linux #850

Closed aravindhp closed 1 month ago

aravindhp commented 7 months ago

When cross platform testing node-logs.yaml I am seeing the following error:

kubectl-node-logs   main {1} ?:9  KREW_OS=windows KREW_ARCH=amd64 kubectl krew -v=5 install --manifest=krew.yaml --archive=nodelogs_windows_amd64.zip
I0125 15:02:11.263169 1850805 root.go:238] Ensure creating dir: "/home/aravindh/.krew"
I0125 15:02:11.263206 1850805 root.go:238] Ensure creating dir: "/home/aravindh/.krew/store"
I0125 15:02:11.263214 1850805 root.go:238] Ensure creating dir: "/home/aravindh/.krew/bin"
I0125 15:02:11.263220 1850805 root.go:238] Ensure creating dir: "/home/aravindh/.krew/index"
I0125 15:02:11.263228 1850805 root.go:238] Ensure creating dir: "/home/aravindh/.krew/receipts"
I0125 15:02:11.263305 1850805 root.go:132] skipping upgrade check
I0125 15:02:11.263359 1850805 migration.go:30] Checking if index migration is needed.
I0125 15:02:11.263368 1850805 migration.go:33] Index already migrated.
I0125 15:02:11.263373 1850805 root.go:167] detected windows, will check for old krew installations to clean up
I0125 15:02:11.264060 1850805 root.go:210] Clean up krew stale installations, current=v0.4.4
I0125 15:02:11.264084 1850805 install.go:256] Found 1 entries in krew store directory
I0125 15:02:11.264089 1850805 install.go:258] Found a krew installation: v0.4.4 (d---------)
I0125 15:02:11.264095 1850805 install.go:191] --manifest specified, not ensuring plugin index
I0125 15:02:11.264385 1850805 install.go:148] Will install plugin: detached/node-logs
Installing plugin: node-logs
I0125 15:02:11.264393 1850805 install.go:58] Looking for installed versions
I0125 15:02:11.264404 1850805 platform.go:43] Matching platform for labels(arch=amd64,os=windows)
I0125 15:02:11.264424 1850805 platform.go:51] Found matching platform with index (1)
I0125 15:02:11.264429 1850805 install.go:77] Install plugin node-logs at version=v0.0.1
I0125 15:02:11.264433 1850805 install.go:95] Creating download staging directory
I0125 15:02:11.264457 1850805 install.go:100] Successfully created download staging directory "/tmp/krew-downloads2628447562"
I0125 15:02:11.264462 1850805 fetch.go:55] Reading "nodelogs_windows_amd64.zip"
I0125 15:02:11.264476 1850805 downloader.go:41] Reading archive file into memory
I0125 15:02:11.541865 1850805 downloader.go:46] Read 25828722 bytes from archive into memory
I0125 15:02:11.541907 1850805 verifier.go:51] Compare sha256 (2633cd802e2bf9f0db8db79c6644a9b18e964423944259144beb0776cefd516a) signed version
I0125 15:02:11.541977 1850805 downloader.go:203] detected "application/zip" file type
I0125 15:02:11.541986 1850805 downloader.go:53] Extracting zip archive to "/tmp/krew-downloads2628447562"
I0125 15:02:11.542014 1850805 downloader.go:73] zip: ensuring parent dirs exist for regular file, dir=/tmp/krew-downloads2628447562
I0125 15:02:11.933377 1850805 downloader.go:73] zip: ensuring parent dirs exist for regular file, dir=/tmp/krew-downloads2628447562
I0125 15:02:11.933562 1850805 downloader.go:73] zip: ensuring parent dirs exist for regular file, dir=/tmp/krew-downloads2628447562
I0125 15:02:11.933635 1850805 install.go:135] file operation not specified, assuming [{* .}]
I0125 15:02:11.933646 1850805 move.go:156] Creating directory "/home/aravindh/.krew/store/node-logs"
I0125 15:02:11.933667 1850805 move.go:162] Creating temp plugin move operations dir "/tmp/krew-temp-move1304652365"
I0125 15:02:11.933673 1850805 move.go:124] Finding move targets from "/tmp/krew-downloads2628447562" to "/tmp/krew-temp-move1304652365" with file operation=index.FileOperation{From:"*", To:"."}
I0125 15:02:11.933681 1850805 move.go:43] Trying to move single file directly from="/tmp/krew-downloads2628447562" to="/tmp/krew-temp-move1304652365" with file operation=index.FileOperation{From:"*", To:"."}
I0125 15:02:11.933690 1850805 move.go:51] Wasn't a single file, proceeding with Glob move
I0125 15:02:11.933728 1850805 move.go:131] Move file from "/tmp/krew-downloads2628447562/LICENSE" to "/tmp/krew-temp-move1304652365/LICENSE"
I0125 15:02:11.933745 1850805 move.go:131] Move file from "/tmp/krew-downloads2628447562/README.md" to "/tmp/krew-temp-move1304652365/README.md"
I0125 15:02:11.933758 1850805 move.go:131] Move file from "/tmp/krew-downloads2628447562/kubectl-node_logs.exe" to "/tmp/krew-temp-move1304652365/kubectl-node_logs.exe"
I0125 15:02:11.933773 1850805 move.go:140] Move operations are complete
I0125 15:02:11.933777 1850805 move.go:172] Move directory "/tmp/krew-temp-move1304652365" to "/home/aravindh/.krew/store/node-logs/v0.0.1"
I0125 15:02:11.933796 1850805 move.go:175] Cleaning up installation directory due to error during copying files
I0125 15:02:11.938353 1850805 install.go:102] Deleting the download staging directory /tmp/krew-downloads2628447562
W0125 15:02:11.938369 1850805 install.go:164] failed to install plugin "node-logs": install failed: failed while moving files to the installation directory: could not rename/copy directory "/tmp/krew-temp-move1304652365" to "/home/aravindh/.krew/store/node-logs/v0.0.1": rename /tmp/krew-temp-move1304652365 /home/aravindh/.krew/store/node-logs/v0.0.1: invalid cross-device link
F0125 15:02:11.938438 1850805 root.go:80] rename /tmp/krew-temp-move1304652365 /home/aravindh/.krew/store/node-logs/v0.0.1: invalid cross-device link
could not rename/copy directory "/tmp/krew-temp-move1304652365" to "/home/aravindh/.krew/store/node-logs/v0.0.1"
sigs.k8s.io/krew/internal/installation.moveToInstallDir
        /home/runner/work/krew/krew/internal/installation/move.go:178
sigs.k8s.io/krew/internal/installation.install
        /home/runner/work/krew/krew/internal/installation/install.go:112
sigs.k8s.io/krew/internal/installation.Install
        /home/runner/work/krew/krew/internal/installation/install.go:78
sigs.k8s.io/krew/cmd/krew/cmd.init.2.func1
        /home/runner/work/krew/krew/cmd/krew/cmd/install.go:156
github.com/spf13/cobra.(*Command).execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
sigs.k8s.io/krew/cmd/krew/cmd.Execute
        /home/runner/work/krew/krew/cmd/krew/cmd/root.go:78
main.main
        /home/runner/work/krew/krew/cmd/krew/main.go:25
runtime.main
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
runtime.goexit
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
failed while moving files to the installation directory
sigs.k8s.io/krew/internal/installation.install
        /home/runner/work/krew/krew/internal/installation/install.go:113
sigs.k8s.io/krew/internal/installation.Install
        /home/runner/work/krew/krew/internal/installation/install.go:78
sigs.k8s.io/krew/cmd/krew/cmd.init.2.func1
        /home/runner/work/krew/krew/cmd/krew/cmd/install.go:156
github.com/spf13/cobra.(*Command).execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
sigs.k8s.io/krew/cmd/krew/cmd.Execute
        /home/runner/work/krew/krew/cmd/krew/cmd/root.go:78
main.main
        /home/runner/work/krew/krew/cmd/krew/main.go:25
runtime.main
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
runtime.goexit
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
install failed
sigs.k8s.io/krew/internal/installation.Install
        /home/runner/work/krew/krew/internal/installation/install.go:85
sigs.k8s.io/krew/cmd/krew/cmd.init.2.func1
        /home/runner/work/krew/krew/cmd/krew/cmd/install.go:156
github.com/spf13/cobra.(*Command).execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
sigs.k8s.io/krew/cmd/krew/cmd.Execute
        /home/runner/work/krew/krew/cmd/krew/cmd/root.go:78
main.main
        /home/runner/work/krew/krew/cmd/krew/main.go:25
runtime.main
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
runtime.goexit
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
failed to install some plugins: [node-logs]
sigs.k8s.io/krew/cmd/krew/cmd.init.2.func1
        /home/runner/work/krew/krew/cmd/krew/cmd/install.go:185
github.com/spf13/cobra.(*Command).execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
sigs.k8s.io/krew/cmd/krew/cmd.Execute
        /home/runner/work/krew/krew/cmd/krew/cmd/root.go:78
main.main
        /home/runner/work/krew/krew/cmd/krew/main.go:25
runtime.main
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
runtime.goexit
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598

Seems like the issue is with isCrossDeviceRenameErr() which I think also needs to take cross platform testing into account. Maybe an additional (runtime.GOOS != "windows" && errno == 18) check there will help. But I am not 100% sure if that is the correct fix.

PS: the plugin installs without issue on native Windows.

kundan2707 commented 6 months ago

/kind support

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 1 month ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/krew/issues/850#issuecomment-2228016415): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.