emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/kubed 377bcbcbb9 29/70: New command 'kubed-restart-depl


From: ELPA Syncer
Subject: [elpa] externals/kubed 377bcbcbb9 29/70: New command 'kubed-restart-deployment'
Date: Tue, 6 Aug 2024 06:58:28 -0400 (EDT)

branch: externals/kubed
commit 377bcbcbb9368227ca02c15ce76f414ae053834e
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    New command 'kubed-restart-deployment'
    
    * kubed.el (kubed-restart-deployment)
    (kubed-deployments-restart): New commands.
---
 kubed.el | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/kubed.el b/kubed.el
index 8df65327bc..448bc93ae1 100644
--- a/kubed.el
+++ b/kubed.el
@@ -1156,6 +1156,20 @@ defaulting to the current namespace."
    (message "Created Kubernetes job `%s'." name)
    (kubed-update-jobs t)))
 
+;;;###autoload
+(defun kubed-restart-deployment (dep &optional namespace)
+  "Restart Kubernetes deployment DEP in namespace NAMESPACE.
+If NAMESPACE is nil or omitted, it defaults to the current namespace."
+  (interactive
+   (list (kubed-read-deployment "Restart deployment")))
+  (unless (zerop
+           (apply #'call-process
+                  kubed-kubectl-program nil nil nil
+                  "rollout" "restart" "deployment" dep
+                  (when namespace (list "-n" namespace))))
+    (user-error "Failed to restart Kubernetes deployment `%s'" dep))
+  (message "Restarted Kubernetes deployment `%s'." dep))
+
 ;;;###autoload (autoload 'kubed-display-deployment "kubed" nil t)
 ;;;###autoload (autoload 'kubed-edit-deployment "kubed" nil t)
 ;;;###autoload (autoload 'kubed-delete-deployments "kubed" nil t)
@@ -1222,7 +1236,10 @@ optional command to run in the images."
                     (when command (cons "--" command)))))
      (user-error "Failed to create Kubernetes deployment `%s'" name))
    (message "Created Kubernetes deployment `%s'." name)
-   (kubed-update-deployments t)))
+   (kubed-update-deployments t))
+  (set "R" "Restart"
+       (kubed-restart-deployment deployment k8sns)
+       (kubed-update-deployments t)))
 
 ;;;###autoload (autoload 'kubed-display-replicaset "kubed" nil t)
 ;;;###autoload (autoload 'kubed-edit-replicaset "kubed" nil t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]