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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'config substitute-path' is cached, even after -clear #3565

Closed
thockin opened this issue Nov 15, 2023 · 0 comments · Fixed by #3567
Closed

'config substitute-path' is cached, even after -clear #3565

thockin opened this issue Nov 15, 2023 · 0 comments · Fixed by #3567

Comments

@thockin
Copy link
Contributor

thockin commented Nov 15, 2023

Observe:

$ dlv exec ./_output/bin/kubectl
Warning: no debug info found, some functionality will be missing such as stack traces and variable evaluation.
Type 'help' for list of commands.

(dlv) c main.main
Breakpoint 1 set at 0x1a21080 for main.main() k8s.io/kubernetes/cmd/kubectl/kubectl.go:28
> main.main() k8s.io/kubernetes/cmd/kubectl/kubectl.go:28 (hits total:1) (PC: 0x1a21080)

(dlv) config substitute-path k8s.io/kubernetes .

(dlv) list
> main.main() ./cmd/kubectl/kubectl.go:28 (PC: 0x1a21080)
    18:	
    19:	import (
    20:	... "k8s.io/component-base/cli"
    21:	... "k8s.io/kubectl/pkg/cmd"
    22:	... "k8s.io/kubectl/pkg/cmd/util"
    23:	
    24:	... // Import to initialize client auth plugins.
    25:	... _ "k8s.io/client-go/plugin/pkg/client/auth"
    26:	)
    27:	
=>  28:	func main() {
    29:	... command := cmd.NewDefaultKubectlCommand()
    30:	... if err := cli.RunNoErrOutput(command); err != nil {
    31:	... ... // Pretty-print the error and exit with an error.
    32:	... ... util.CheckErr(err)
    33:	... }
    34:	}
(dlv) exit

But if I make a mistake, then fix it, it doesn't work:

$ dlv exec ./_output/bin/kubectl
Warning: no debug info found, some functionality will be missing such as stack traces and variable evaluation.
Type 'help' for list of commands.

(dlv) c main.main
Breakpoint 1 set at 0x1a21080 for main.main() k8s.io/kubernetes/cmd/kubectl/kubectl.go:28

main.main() k8s.io/kubernetes/cmd/kubectl/kubectl.go:28 (hits total:1) (PC: 0x1a21080)

(dlv) config substitute-path k8s.io/kubernetes ./foo

(dlv) list

main.main() ./foo/cmd/kubectl/kubectl.go:28 (PC: 0x1a21080)
Command failed: open ./foo/cmd/kubectl/kubectl.go: no such file or directory

(dlv) config substitute-path -clear

(dlv) config substitute-path k8s.io/kubernetes .

(dlv) list

main.main() ./foo/cmd/kubectl/kubectl.go:28 (PC: 0x1a21080)
Command failed: open ./foo/cmd/kubectl/kubectl.go: no such file or directory

(dlv) config substitute-path
"k8s.io/kubernetes" → "."


I expected the -clear, followed by the correct  substitution to work, but it still is looking for "foo".

> 1. What version of Delve are you using (`dlv version`)?

$ dlv version
Delve Debugger
Version: 1.21.1
Build: $Id: a358c02f24aa7047ecc562b0587dc2d08330b2cf $


> 2. What version of Go are you using? (`go version`)?

$ go version
go version go1.21.3 linux/amd64


> 3. What operating system and processor architecture are you using?

Linux amd64


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants