Skip to content

Commit 899d901

Browse files
fixup! Add kubernetes inventory.
1 parent 82ee186 commit 899d901

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pyinfra/api/inventories/kubernetes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from pyinfra.api.exceptions import InventoryError
21
from pyinfra.api.connectors.util import run_local_process, split_combined_output
2+
from pyinfra.api.exceptions import InventoryError
3+
34

45
def get_pods(selector, namespace='default', all_namespaces=False, container=None):
56
if all_namespaces:
@@ -10,9 +11,8 @@ def get_pods(selector, namespace='default', all_namespaces=False, container=None
1011
return_code, combined_output = run_local_process(
1112
['"$@"', '-',
1213
'kubectl', 'get', 'pods', *ns, '-l', selector, '--template',
13-
r'{{range .items}}@kubernetes/' +
14-
r'{{.metadata.namespace}}/{{.metadata.name}}{{"\n"}}{{end}}'
15-
]
14+
r'{{range .items}}@kubernetes/'
15+
r'{{.metadata.namespace}}/{{.metadata.name}}{{"\n"}}{{end}}'],
1616
)
1717
stdout, stderr = split_combined_output(combined_output)
1818

0 commit comments

Comments
 (0)