Skip to content

Commit

Permalink
fix: Generate a filename that won't implicitely assume a subfolder (a…
Browse files Browse the repository at this point in the history
…brochard#133)

Or the kubectl command will fail.

For EKR clusters, the buffer name contains a / character, leading
to the need for this fix.
  • Loading branch information
Konubinix authored Aug 7, 2024
1 parent eb41a64 commit 68da30c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kubel.el
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ Use C-c C-c to kubectl apply the current yaml buffer."
(format "/%s%s:%s@%s:" (or hop "") method user host)))
""))
(let* ((filename-without-tramp-prefix (format "/tmp/kubel/%s-%s.yaml"
(replace-regexp-in-string "\*\\| " "" (buffer-name))
(replace-regexp-in-string "/" "_"
(replace-regexp-in-string "\*\\| " "" (buffer-name)))
(floor (float-time))))
(filename (format "%s%s" dir-prefix filename-without-tramp-prefix)))
(when (y-or-n-p "Apply the changes? ")
Expand Down

0 comments on commit 68da30c

Please sign in to comment.