Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jinnovation committed Jan 20, 2025
1 parent 760c58a commit 69dc1a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions kele.el
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ NAMESPACE and CONTEXT are used to identify the resource type to query for."
(port (if (string-equal (oref resource kind) "services")
(completing-read "Port: "
(-map (lambda (port-spec) (number-to-string (alist-get 'port port-spec)))
(kele--service-ports resource))
(kele--get-ports-for-resource resource))
nil t)
(number-to-string (read-number "Port: ")))))
(list context ns gvk name port)))
Expand Down Expand Up @@ -2137,7 +2137,10 @@ PORTS is used according to `completion-extra-properties'."
(cl-defun kele--get-ports-for-resource (obj)
"Get the exposed ports for the resource OBJ.
OBJ must be a `kele--resource-container'."
OBJ must be a `kele--resource-container'.
Return value is a list of plists consisting of keys `name',
`protocol', and `port'."
(pcase (alist-get 'kind (oref obj resource))
("Service" (kele--service-ports obj))))

Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test-kele.el
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,7 @@ metadata:
(protocol . "TCP"))
((name . "foo")
(containerPort . 9999)
(protocol
. "TCP"))))))))))))))))
(protocol . "TCP"))))))))))))))))
:to-have-same-items-as
(list '((name . "whatever") (port . 1234) (protocol . "TCP"))
'((name . "foo") (port . 5678) (protocol . "TCP")))))
Expand Down

0 comments on commit 69dc1a3

Please sign in to comment.