]> git.eshelyaron.com Git - emacs.git/commitdiff
New commands 'kubed-transient', 'kubed-transient-run'
authorEshel Yaron <me@eshelyaron.com>
Thu, 25 Jul 2024 16:10:13 +0000 (18:10 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 25 Jul 2024 18:54:08 +0000 (20:54 +0200)
lisp/net/kubed-transient.el

index 6bd15655d9b6ba1702fe2ad71a86f2489b79dcfa..2217e2e7c2f592cda899bf6cb3ee746c42e4a918 100644 (file)
   "Read and return Kubernetes resource definition file name."
   (kubed-read-resource-definition-file-name))
 
+;;;###autoload
+(transient-define-prefix kubed-transient ()
+  "Perform Kubernetes operation."
+  ["Actions"
+   ("c" "Create" kubed-transient-create)
+   ("r" "Run" kubed-transient-run)
+   ("!" "Command line" kubed-kubectl-command)])
+
+;;;###autoload
+(transient-define-prefix kubed-transient-run ()
+  "Run container image in a Kubernetes pod."
+  ["Switches"
+   ("-A" "Attach" "--attach")
+   ("-i" "Open stdin" "--stdin")
+   ("-t" "Allocate TTY" "--tty")
+   ("-R" "Remove after exit" "--rm")
+   ("-C" "Override container command" "--command")]
+  ["Options"
+   ("-n" "Namespace" "--namespace="
+    :prompt "Namespace" :reader kubed-transient-read-namespace)
+   ("-I" "Image" "--image="
+    :prompt "Image to deploy: ")
+   ("-p" "Port" "--port="
+    :prompt "Port to expose: " :reader transient-read-number-N+)
+   ("-E" "Env vars" "--env="
+    :prompt "Set environment VAR=VAL: "
+    :multi-value repeat)
+   ("--" "Arguments" "-- ="
+    :prompt "Arguments for container command: ")]
+  ["Actions"
+   ("r" "Run" kubed-run)
+   ("!" "Command line" kubed-kubectl-command)]
+  (interactive)
+  (transient-setup 'kubed-transient-run nil nil
+                   :scope '("run")))
+
 ;;;###autoload
 (transient-define-prefix kubed-transient-create ()
   "Create Kubernetes resource."