derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
27.08k stars 1.7k forks source link

conflicting plugins shortcuts #2929

Open fragolinux opened 5 days ago

fragolinux commented 5 days ago

hi, i created this script which will fetch all the available plugins (and skins) and add them all to the correct file (according to XDG config)...

#!/usr/bin/env bash

base="$HOME/.config/k9s"
custom="$base/custom"
remote="$base/remote"
backup="$base/backup"
mkdir -p "$custom" "$remote" "$backup"
DATA=$(date +%Y-%m-%d_%Hh%Mm)
git clone --depth 1 --filter=blob:none --sparse https://github.com/derailed/k9s $remote > /dev/null 2>&1
cd $remote
git sparse-checkout set plugins skins
[ -f "$base/plugins.yaml" ] && mv "$base/plugins.yaml" "$backup/plugins-$DATA.yaml"
echo "plugins:" > "$base/plugins.yaml"
for i in $(ls $remote/plugins/*.yaml); do cat $i | grep -v "plugins:" | grep -v "plugins.yaml" >> "$base/plugins.yaml" ; done
if compgen -G "$custom/*.yaml" > /dev/null; then
  for i in $(ls $custom/*.yaml); do cat $i | grep -v "plugins:" | grep -v "plugins.yaml" >> "$base/plugins.yaml" ; done
fi
cp -a "$remote/skins" "$base"

only problem, not related to my script, is that many plugins have identical shortcuts configured, having them conflicting if logFile is enabled:

11:52AM INF 🐶 K9s starting up...
11:52AM ERR Fail to locate metrics-server error="No metrics api group metrics.k8s.io found on cluster"
11:52AM INF ✅ Kubernetes connectivity
11:53AM INF 🐶 K9s starting up...
11:53AM INF ✅ Kubernetes connectivity
12:02PM INF 🐶 K9s starting up...
12:02PM INF ✅ Kubernetes connectivity
12:02PM WRN Plugins load failed: duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-A" in "trace"
12:02PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-L" in "loki-pods"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-L" in "loki-pods"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-A" in "trace"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Shift-L" in "loki-pods"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "stern"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-L" in "stern"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-L" in "log-less"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Shift-L" in "loki-pods"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Shift-L" in "loki-pods"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Shift-A" in "trace"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Shift-L" in "loki-pods"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-L" in "log-less"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Shift-L" in "loki-pods"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Shift-L" in "log-less"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-L" in "loki-pods"
duplicate plugin key found for "Shift-A" in "trace"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Shift-L" in "loki-pods"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Shift-A" in "trace"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Shift-L" in "log-less"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Shift-L" in "loki-pods"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-A" in "trace"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-L" in "stern"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-L" in "loki-pods"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-T" in "open-terminal"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Shift-L" in "log-less"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"
duplicate plugin key found for "Ctrl-T" in "duplicate-pod"
duplicate plugin key found for "Shift-L" in "log-less"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-L" in "stern"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Shift-L" in "loki-pods"
12:03PM WRN Plugins load failed: duplicate plugin key found for "Ctrl-T" in "open-terminal"
duplicate plugin key found for "Shift-A" in "trace"
duplicate plugin key found for "Shift-L" in "loki-pods"
duplicate plugin key found for "Ctrl-L" in "raw-logs-follow"
duplicate plugin key found for "Ctrl-X" in "kube-lineage"
duplicate plugin key found for "Ctrl-L" in "loki-pods-raw"

any way to fix them? Maybe i can select different ones for each, and open a PR, anyone interested?

fragolinux commented 5 days ago

i fixed everything and opened a PR: https://github.com/derailed/k9s/pull/2930