From f9c710047c4f25030cad06ec9d6ac32e576b3932 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Tue, 23 Jul 2024 17:57:17 +0200 Subject: [PATCH] ; * lisp/net/kubed.el (kubed-create): DRY --- lisp/net/kubed.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/net/kubed.el b/lisp/net/kubed.el index 64a887076cd..f36ebae9b23 100644 --- a/lisp/net/kubed.el +++ b/lisp/net/kubed.el @@ -1005,12 +1005,13 @@ completion candidates." "Create Kubernetes resource of kind KIND with definition DEFINITION." (interactive (list (kubed-read-resource-definition-file-name))) - (message "Creating Kubernetes %s with definition `%s'..." (or kind "resource") definition) - (message "Creating Kubernetes %s with definition `%s'... Done. New %s name is `%s'." - (or kind "resource") definition (or kind "resource") - (car (process-lines kubed-kubectl-executable - "create" "-f" (expand-file-name definition) - "-o" "jsonpath={.metadata.name}")))) + (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'." + kind definition kind + (car (process-lines kubed-kubectl-executable + "create" "-f" (expand-file-name definition) + "-o" "jsonpath={.metadata.name}"))))) (defun kubed-pod-containers (pod &optional k8sns) "Return list of containers in Kubernetes pod POD in namespace K8SNS." -- 2.39.2