kubeletctl icon indicating copy to clipboard operation
kubeletctl copied to clipboard

Getting panic for `metrics cadvisor` command

Open Dentrax opened this issue 1 year ago • 8 comments

Summary

Provide brief overview and context for the discovered bug.

Steps to Reproduce

  1. curl -LO https://github.com/cyberark/kubeletctl/releases/download/v1.11/kubeletctl_darwin_amd64 && chmod a+x ./kubeletctl_darwin_amd64 && mv ./kubeletctl_darwin_amd64 /usr/local/bin/kubeletctl
  2. kubeletctl -s 10.11.12.13 metrics cadvisor
  3. See error
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1763c4e]

goroutine 1 [running]:
kubeletctl/cmd.PrintPrettyHttpResponse(0x0, {0xc0000f17d0?, 0xc00021fd48?})
	/home/cyber/kubeletctl/cmd/print.go:56 +0x2e
kubeletctl/cmd/metrics.glob..func1(0x1f0d520?, {0x18c600e?, 0x4?, 0x4?})
	/home/cyber/kubeletctl/cmd/metrics/cadvisor.go:45 +0x4f
github.com/spf13/cobra.(*Command).execute(0x1f0d520, {0xc000324f00, 0x4, 0x4})
	/home/cyber/kubeletctl/vendor/github.com/spf13/cobra/command.go:842 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1f0cd40)
	/home/cyber/kubeletctl/vendor/github.com/spf13/cobra/command.go:943 +0x37d
github.com/spf13/cobra.(*Command).Execute(...)
	/home/cyber/kubeletctl/vendor/github.com/spf13/cobra/command.go:883
kubeletctl/cmd.Execute()
	/home/cyber/kubeletctl/cmd/root.go:83 +0x25
main.main()
	/home/cyber/kubeletctl/main.go:20 +0x17

Expected Results

It should work?

Actual Results

Throws panic.

Reproducible

  • [X] Always
  • [ ] Sometimes
  • [ ] Non-Reproducible

Version/Tag number

1.11

K8s: v1.23.7

Environment setup

macOS

Additional Information

Add any other context about the problem here.

Dentrax avatar Jul 19 '23 13:07 Dentrax