Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Segfault opening xray for unsupported resource type #498

@hsychla

Description

@hsychla




Describe the bug
K9s segfaults if one tries to open xray-mode for an unsupported resource type.

To Reproduce
Steps to reproduce the behavior:

  1. Open k9s
  2. switch to xray-mode for an unsupported resource type
    :x rs
  3. See error
🐶 [OK] replicasetspanic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x16a7be7]
goroutine 133 [running]:
github.com/derailed/k9s/internal/model.treeHydrate(0x1e1d560, 0xc001c85140, 0x0, 0x0, 0xc000562d00, 0x8e, 0x8e, 0x0, 0x0, 0xb, ...)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/tree.go:289 +0x77
github.com/derailed/k9s/internal/model.(*Tree).reconcile(0xc0004ab860, 0x1e1d4a0, 0xc00095c380, 0xc000a80000, 0xc000ccbf90)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/tree.go:216 +0x57c
github.com/derailed/k9s/internal/model.(*Tree).refresh(0xc0004ab860, 0x1e1d4a0, 0xc00095c380)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/tree.go:180 +0xb4
github.com/derailed/k9s/internal/model.(*Tree).updater(0xc0004ab860, 0x1e1d4a0, 0xc00095c380)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/tree.go:168 +0x13c
created by github.com/derailed/k9s/internal/model.(*Tree).Watch
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/internal/model/tree.go:80 +0x75 

Expected behavior
A message that the chosen resource type is currently not supported in xray-mode.

Versions (please complete the following information):

  • OS: Win10 / WSL /zsh
  • K9s 13.0
  • K8s v1.15.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions