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

k9s interprets [] characters in a weird way #3051

Open
kinoute opened this issue Jan 8, 2025 · 2 comments
Open

k9s interprets [] characters in a weird way #3051

kinoute opened this issue Jan 8, 2025 · 2 comments

Comments

@kinoute
Copy link
Contributor

kinoute commented Jan 8, 2025




Describe the bug

K9s seems to have problem "escaping" [ and ] characters. Since a few versions (using 0.32.7 here). The problem wasn't here before. It causes problems when watching logs of a pod or when I copy the content of the secret from the cluster/k9s to my Mac.

To Reproduce
Steps to reproduce the behavior

  1. Use the latest version as of today (0.32.7)
  2. Copy the content of a secret from k9s with the c shortcut which have a string like match[] in it
  3. Paste the result in your IDE for instance, the first [ is gone

You can see the same problem by reading the log of a pod which contains both characters.

Expected behavior
Both characters should be displayed correctly. By the way, when using kubectl, the problem doesn't appear for instance when reading logs.

Screenshots

Example in logs of a pod:

Screenshot 2025-01-08 à 12 23 06

See the problem here, we should see [date][level] but instead some characters are added or mis interpreted. Kubectl doesn't have this problem (same pod here):

Screenshot 2025-01-08 à 12 32 12

Versions (please complete the following information):

  • OS: macOS Sequoia 15.2
  • K9s: [e.g. 0.32.7]
  • K8s: [e.g. 1.27.10]
  • Terminal: iterm2 Build 3.5.12beta1
@Anghille
Copy link

Anghille commented Jan 8, 2025

I can confirm this issue for 0.32.7.

When editing a secret like this, and copying this content to paste it elsewhere, we go from this:

#original content
values.yaml: |-
  prometheus:
    prometheusSpec:
      additionalScrapeConfigs:
        - params:
            'match[]':
              - '*'

To this

#pasted elsewhere
values.yaml: |-
  prometheus:
    prometheusSpec:
      additionalScrapeConfigs:
        - params:
            'match]': #<----- Missing [ from the copy
              - '*'

OS used for this test: Macos 15.2

# kubectl version
Client Version: v1.31.3
Kustomize Version: v5.4.2

I could not reproduce this error on ubuntu 24.04.1 LTS either the logs or secrets.
I also could not see the problem on configmaps containing [], in either Ubuntu or Macos

Seems like the issue is OS related - and impacts only secrets and Logs ?

@kinoute
Copy link
Contributor Author

kinoute commented Jan 8, 2025

The problem is not present in k9s 0.31.9.

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

No branches or pull requests

2 participants