I wanted to download kube-linter
, to lint my kubernetes manifests with
I use mise to install it, but (currently) the plugin is broken -- the link it uses for the binary download has a minor typo.
I thought, "how do I fix this without googling it?"
Strace Rules
strace can show files opened by a process—
# from the man page, on the `-e` (trace filtering) flags: # Trace all system calls which take a file name as an argument. You can think of this # as an abbreviation for -e trace=open,stat,chmod,unlink,... which is useful to seeing # what files the process is referencing. Furthermore, using the abbreviation will en‐ # sure that you don't accidentally forget to include a call like lstat(2) in the list. # Betchya woulda forgot that one. The syntax without a preceding percent sign ("-e # trace=file") is deprecated. strace -e trace=%file mise upgrade kube-linter # outputs many things, including: # statx(AT_FDCWD, "/home/rosin/.local/share/mise/plugins/kube-linter", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0
Nice, we found where mise keeps the kube-linter
plugin
From here, it's a little bit of sleuthing to find the code that sets the download url:
# lib/utils.bash, line 48
--- url="$GH_REPO/releases/download/${version}/kube-linter-${os}.tar.gz"
+++ url="$GH_REPO/releases/download/v${version}/kube-linter-${os}.tar.gz"
mise install kube-linter && mise use kube-linter
and all is well!