Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Crash on usage #6

@DanTulovsky

Description

@DanTulovsky

Describe the bug

% k view-webhook                                                                                                
W1002 10:10:34.102548   96545 warnings.go:67] admissionregistration.k8s.io/v1beta1 MutatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration
W1002 10:10:34.162715   96545 warnings.go:67] admissionregistration.k8s.io/v1beta1 ValidatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1e96c8a]

goroutine 1 [running]:
github.com/Trendyol/kubectl-view-webhook/pkg/k8s.retrieveValidDateCount(0x0, 0x0, 0x0, 0x0)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/pkg/k8s/webhook.go:257 +0x4a
github.com/Trendyol/kubectl-view-webhook/pkg/k8s.(*WebHookClient).fillMutatingWebhookConfigurations(0xc000353d60, 0x0, 0x0, 0x0, 0x0, 0xc00056cae0, 0x21, 0x0, 0x0, 0x0, ...)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/pkg/k8s/webhook.go:112 +0x2b3
github.com/Trendyol/kubectl-view-webhook/pkg/k8s.(*WebHookClient).Run(0xc000353d60, 0x2cf9798, 0x0, 0x0, 0xb, 0x2237d5a, 0x5)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/pkg/k8s/webhook.go:70 +0x208
github.com/Trendyol/kubectl-view-webhook/cmd.(*ViewWebhookOptions).Run(0xc0003e37a0, 0xc0003c7340, 0x2cf9798)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/cmd/root.go:139 +0xa5
github.com/Trendyol/kubectl-view-webhook/cmd.NewCmdViewWebhook.func1(0xc0003c7340, 0x2cf9798, 0x0, 0x0, 0x0, 0x0)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/cmd/root.go:70 +0x78
github.com/spf13/cobra.(*Command).execute(0xc0003c7340, 0xc00003a1d0, 0x0, 0x0, 0xc0003c7340, 0xc00003a1d0)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003c7340, 0xc00000e010, 0x23d6aa0, 0xc00000e018)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
main.main()
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/main.go:36 +0x167
% k version                                                                                                 
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.4-gke.1801", GitCommit:"589503e56a4fd76a38f277d6fb11bd6ec4931482", GitTreeState:"clean", BuildDate:"2021-09-14T03:52:38Z", GoVersion:"go1.16.6b7", Compiler:"gc", Platform:"linux/amd64"}

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions