[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kubed 2079112172 7/8: ; Fix errors in last commit
From: |
ELPA Syncer |
Subject: |
[elpa] externals/kubed 2079112172 7/8: ; Fix errors in last commit |
Date: |
Wed, 14 Aug 2024 12:58:19 -0400 (EDT) |
branch: externals/kubed
commit 2079112172977e524af79e0db10bcbb918e7f064
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
; Fix errors in last commit
* kubed.el (kubed-create-namespace, kubed-create): Restore
'interactive'.
(kubed-create-deployment): Use 'kubed-update', not
'kubed-list-update', in case we're called from other buffer.
---
kubed.el | 93 +++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 48 insertions(+), 45 deletions(-)
diff --git a/kubed.el b/kubed.el
index 3e3c7a9029..d8511e78ff 100644
--- a/kubed.el
+++ b/kubed.el
@@ -1702,18 +1702,19 @@ Switch to namespace `%s' and proceed?"
kubed-list-namespace))
Interactively, prompt for NAME. With a prefix argument, prompt for
CONTEXT instead."
- (let ((context nil))
- (dolist (arg (kubed-transient-args 'kubed-transient-create))
- (cond
- ((string-match "--context=\\(.+\\)" arg)
- (setq context (match-string 1 arg)))))
- (unless context
- (setq context
- (let ((cxt (kubed-local-context)))
- (if current-prefix-arg
- (kubed-read-context "Context" cxt)
- cxt))))
- (list (read-string "Create namespace with name: ") context))
+ (interactive
+ (let ((context nil))
+ (dolist (arg (kubed-transient-args 'kubed-transient-create))
+ (cond
+ ((string-match "--context=\\(.+\\)" arg)
+ (setq context (match-string 1 arg)))))
+ (unless context
+ (setq context
+ (let ((cxt (kubed-local-context)))
+ (if current-prefix-arg
+ (kubed-read-context "Context" cxt)
+ cxt))))
+ (list (read-string "Create namespace with name: ") context)))
(unless (zerop
(apply #'call-process
kubed-kubectl-program nil nil nil
@@ -1956,9 +1957,8 @@ to create for each image, PORT is the port to expose, and
COMMAND is an
optional command to run in the images."
(interactive
(let ((name (read-string "Create deployment with name: "))
- (images nil)
- (replicas (prefix-numeric-value current-prefix-arg))
- (port nil) (command nil) (context nil) (namespace nil))
+ (images nil) (replicas nil) (port nil) (command nil)
+ (context nil) (namespace nil))
(dolist (arg (kubed-transient-args 'kubed-transient-create-deployment))
(cond
((string-match "--replicas=\\(.+\\)" arg)
@@ -1988,20 +1988,22 @@ optional command to run in the images."
(kubed-read-namespace "Namespace" cur nil context)
cur))))
(list name images context namespace replicas port command)))
- (unless (zerop
- (apply #'call-process
- kubed-kubectl-program nil nil nil
- "create" "deployment" name
- (append
- (mapcar (lambda (image) (concat "--image=" image)) images)
- (when namespace (list (concat "--namespace=" namespace)))
- (when context (list (concat "--context=" context)))
- (when replicas (list (format "--replicas=%d" replicas)))
- (when port (list (format "--port=%d" port)))
- (when command (cons "--" command)))))
- (user-error "Failed to create Kubernetes deployment `%s'" name))
- (message "Created Kubernetes deployment `%s'." name)
- (kubed-list-update t))
+ (let ((context (or context (kubed-local-context)))
+ (namespace (or namespace (kubed-local-namespace context))))
+ (unless (zerop
+ (apply #'call-process
+ kubed-kubectl-program nil nil nil
+ "create" "deployment" name
+ (append
+ (mapcar (lambda (image) (concat "--image=" image))
images)
+ (when namespace (list (concat "--namespace=" namespace)))
+ (when context (list (concat "--context=" context)))
+ (when replicas (list (format "--replicas=%d" replicas)))
+ (when port (list (format "--port=%d" port)))
+ (when command (cons "--" command)))))
+ (user-error "Failed to create Kubernetes deployment `%s'" name))
+ (message "Created Kubernetes deployment `%s'." name)
+ (kubed-update "deployments" context namespace)))
(restart "R" "Restart"
(kubed-restart-deployment deployment kubed-list-context
kubed-list-namespace)
(unless kubed-restart-deployment-watch-status
@@ -2421,22 +2423,23 @@ completion candidates."
;;;###autoload
(defun kubed-create (definition &optional kind context)
"Create resource of kind KIND with definition DEFINITION via CONTEXT."
- (let ((definition nil) (context nil))
- (dolist (arg (kubed-transient-args 'kubed-transient-create))
- (cond
- ((string-match "--context=\\(.+\\)" arg)
- (setq context (match-string 1 arg)))
- ((string-match "--filename=\\(.+\\)" arg)
- (setq definition (match-string 1 arg)))))
- (unless context
- (setq context
- (let ((cxt (kubed-local-context)))
- (if current-prefix-arg
- (kubed-read-context "Context" cxt)
- cxt))))
- (unless definition
- (setq definition (kubed-read-resource-definition-file-name)))
- (list definition nil context))
+ (interactive
+ (let ((definition nil) (context nil))
+ (dolist (arg (kubed-transient-args 'kubed-transient-create))
+ (cond
+ ((string-match "--context=\\(.+\\)" arg)
+ (setq context (match-string 1 arg)))
+ ((string-match "--filename=\\(.+\\)" arg)
+ (setq definition (match-string 1 arg)))))
+ (unless context
+ (setq context
+ (let ((cxt (kubed-local-context)))
+ (if current-prefix-arg
+ (kubed-read-context "Context" cxt)
+ cxt))))
+ (unless definition
+ (setq definition (kubed-read-resource-definition-file-name)))
+ (list definition nil context)))
(let ((kind (or kind "resource")))
(message "Creating Kubernetes %s with definition `%s'..." kind definition)
(message "Creating Kubernetes %s with definition `%s'... Done. New %s
name is `%s'."
- [elpa] externals/kubed updated (5ef2b5ebc4 -> cca5f42891), ELPA Syncer, 2024/08/14
- [elpa] externals/kubed d1c486c7a0 4/8: Teach deletion commands about buffer-local contexts and namespaces, ELPA Syncer, 2024/08/14
- [elpa] externals/kubed 647680f877 1/8: ; * kubed.el (kubed-define-resource): Fix typo., ELPA Syncer, 2024/08/14
- [elpa] externals/kubed 716e951e71 5/8: Teach edit commands about buffer-local contexts and namespaces, ELPA Syncer, 2024/08/14
- [elpa] externals/kubed 3ef32c0364 3/8: ; (kubed-display-resource): Only ask for namespace when needed., ELPA Syncer, 2024/08/14
- [elpa] externals/kubed b1dd9ae700 2/8: ; Improve docstrings of resource-displaying commands, ELPA Syncer, 2024/08/14
- [elpa] externals/kubed 2079112172 7/8: ; Fix errors in last commit,
ELPA Syncer <=
- [elpa] externals/kubed cca5f42891 8/8: ; (kubed-list-delete-marked): Update original buffer., ELPA Syncer, 2024/08/14
- [elpa] externals/kubed bc32d4f981 6/8: Teach creation commands about buffer-local contexts, ELPA Syncer, 2024/08/14