Git Product home page Git Product logo

kubecui's Issues

k logs change view (Ctrl-/) results in "invalid memory address or nil pointer dereference"

Thanks for putting together a useful kubectl tool using fzf. I ran into an issue when I used k logs and tried to change the view using Ctrl-/. After two presses, when it tries to go 'full-screen' I get an error.

Steps to reproduce

  1. Set KUI_PATH to the directory with kubecui.sh
  2. Load kubecui.sh using source kubecui.sh
  3. Run k logs
  4. Press Ctrl-/ twice

Error message below, I had to clean it up because it was intermingled with the shell output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x68 pc=0x5772b4]                                                                                                                                                                                                                                                              
goroutine 24 [running]:                                                                                                                                                                                                                                       
github.com/junegunn/fzf/src.(*Terminal).Loop.func9.2(0x0?)
github.com/junegunn/fzf/src/terminal.go:3055 +0x714
github.com/junegunn/fzf/src/util.(*EventBox).Wait(0xc000012738, 0xc0000c9fa0)
github.com/junegunn/fzf/src/util/eventbox.go:34 +0x62
github.com/junegunn/fzf/src.(*Terminal).Loop.func9()l
github.com/junegunn/fzf/src/terminal.go:2978 +0xee
created by github.com/junegunn/fzf/src.(*Terminal).Loop in goroutine 8
github.com/junegunn/fzf/src/terminal.go:2962 +0x593

Lastly, I am using bash on Debian testing (trixie) version GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)

[F1]Explain results in error due to known option for yq/jq

Steps to reproduce:

  1. k get pods
  2. select a pod and press F1

Visible error message:

jq: Unknown option -o
                     Use jq --help for help with command-line options,
                                                                      or see the jq manpage, or online docs  at https://jqlang.github.io/jq

I also believe I see a "Broken pipe" error but it does not persist on screen.

My install of jq and yq on a Debian linux system are versions:

jq 1.7.1-3
yq 3.2.3.-1

Neither has option -o available.

I thought fx/libs/explain.sh, line 4 may be the culprit

EXPLAIN=$(kubectl explain ${RS_TYPE} --recursive | sed -r 's/FIELDS:/---/' | sed -n '\|---|,$p' | sed -r 's/(\w+)\t.*/\1:/g' | yq -o props -P . | sed -r 's/ =//g')

I tried removing the -o and -P options, so the line reads as follows:

EXPLAIN=$(kubectl explain ${RS_TYPE} --recursive | sed -r 's/FIELDS:/---/' | sed -n '\|---|,$p' | sed -r 's/(\w+)\t.*/\1:/g' | yq . | sed -r 's/ =//g')

Update: I forgot to source the kubecui.sh file after my change. After changing the EXPLAIN line 4, and removing the -o and -P, the F1 button for Explain "works". Although the results may not have been what you originally intended. Without knowing what these two options were suppose to do, I can't really figure out what the change in behavior is.

Let me know if there is anything else I can test to help determine the root cause of the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.