kubernetes-sigs / krew

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

Installing krew - failed to list indexes on Windows #851

Closed uriyay closed 4 months ago

uriyay commented 9 months ago

Had the same issue as this When I tried to run: kubectl krew install sniff

Digging into it, I saw that it tries to run: git config --get remote.origin.url from the folder %USERPROFILE%.krew\index\default. But since it was cloned by admin and not a regular user it returned nothing, and when I ran git remote -v I got:

'.krew/index/default' is owned by:
        'S-...'
but the current user is:
        'S-......'
To add an exception for this directory, call:

        git config --global --add safe.directory '.krew/index/default'

Solved it by deleting %USERPROFILE%.krew\index\default and cloning it from a non admin user by: git clone https://github.com/kubernetes-sigs/krew-index.git %USERPROFILE%\.krew\index\default

That solved this specific error, but later I got another error:

W0215 19:50:01.507919   64756 install.go:164] failed to install plugin "sniff": install failed: failed to link installed plugin: failed to create a symlink from".krew\\store\\sniff\\v1.6.2\\kubectl-sniff.exe" to ".krew\\bin\\kubectl-sniff.exe": symlink .krew\store\sniff\v1.6.2\kubectl-sniff.exe .krew\bin\kubectl-sniff.exe: A required privilege is not held by the client.

So I ran it with admin and it worked.

So I think that in the Windows section in the install guide there should be a guidance that kubectl krew install <plugin> should be done also by an admin user.

kundan2707 commented 9 months ago

/kind support

k8s-triage-robot commented 6 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 5 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 4 months 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 4 months ago

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

In response to [this](https://github.com/kubernetes-sigs/krew/issues/851#issuecomment-2228016435): >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.