Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

hack/verify-mocks.sh Append sudo to a git worktree remove command #116338

Closed
samruddhikhandale opened this issue Mar 7, 2023 · 7 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@samruddhikhandale
Copy link

What happened?

Hi 馃憢

I have been working with @craiglpeters on adding a dev container to this repo - #113019

With the dev config, when we run make verify then, we are having a test failure for hack/verify-mocks.sh. It fails at this line with following error msg 馃憞

image

The dev config uses a vscode remote user, I wonder if that's the cause of this test failure.

What did you expect to happen?

I expect make verify to succeed with the dev config. Hence, can we update the current hack/verify-mocks.sh file and append sudo to it ? This fixes the test

Current -

kube::util::trap_add "git worktree remove -f ${_tmpdir}" EXIT

Proposed -

kube::util::trap_add "sudo git worktree remove -f ${_tmpdir}" EXIT

How can we reproduce it (as minimally and precisely as possible)?

N/A

Anything else we need to know?

No response

Kubernetes version

N/A

Cloud provider

N/A

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

@samruddhikhandale samruddhikhandale added the kind/bug Categorizes issue or PR as related to a bug. label Mar 7, 2023
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Mar 7, 2023
@k8s-ci-robot
Copy link
Contributor

There are no sig labels on this issue. Please add an appropriate label by using one of the following commands:

  • /sig <group-name>
  • /wg <group-name>
  • /committee <group-name>

Please see the group list for a listing of the SIGs, working groups, and committees available.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 7, 2023
@XDRAGON2002
Copy link
Member

Hey @samruddhikhandale could I take this up? Sounds like a small enough issue.

@nikhita
Copy link
Member

nikhita commented Mar 8, 2023

I don't think we should be adding sudo. Also see related slack discussion here.

@samruddhikhandale
Copy link
Author

Closing as no longer needed! Thanks.

@samruddhikhandale samruddhikhandale closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2023
@marthinal
Copy link

I had the same error locally from my mac. The problem is when trying to remove the worktree from /private. See this example:

% git worktree list
/Users/marthinal/go/src/k8s.io/kubernetes                                                 330b5a2b8db [master]
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.atu6W8xJ  fe05ee9f534 (detached HEAD)
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.Izy4n9jB  c242a003682 (detached HEAD)
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.sU7P0tTo  c242a003682 (detached HEAD)
/Users/marthinal/projects/testworktree                                                    330b5a2b8db [mango]

% git worktree remove -f /Users/marthinal/projects/testworktree 

% git worktree list                                             
/Users/marthinal/go/src/k8s.io/kubernetes                                                 330b5a2b8db [master]
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.atu6W8xJ  fe05ee9f534 (detached HEAD)
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.Izy4n9jB  c242a003682 (detached HEAD)
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.sU7P0tTo  c242a003682 (detached HEAD)

% git worktree remove -f /private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.atu6W8xJ
error: failed to delete '/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.atu6W8xJ': Permission denied

Running hack/verify-mocks.sh again... The worktree has been removed BUT the temp dir is still there

staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/interface.go
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmsizeclient/interface.go
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/interface.go
staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/interface.go
test/e2e/storage/drivers/csi-test/driver/driver.go
go: downloading github.com/container-storage-interface/spec v1.7.0
error: failed to delete '/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.rBiKblhB': Permission denied

% git worktree list
/Users/marthinal/go/src/k8s.io/kubernetes                                                 330b5a2b8db [master]
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.Izy4n9jB  c242a003682 (detached HEAD)
/private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.sU7P0tTo  c242a003682 (detached HEAD)

% ls /private/var/folders/g3/73rql5xd5t7cxt63gwkf04n00000gn/T/verify-mocks.sh.XXXXXX.rBiKblhB
OWNERS		OWNERS_ALIASES	_output		api		build		pkg		vendor

@BenTheElder
Copy link
Member

see #117273 and #117526

we had a similar issue recently as well #117510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

6 participants