Skip to content

Commit 196eb48

Browse files
committed
apply_kubernetes_yaml: remove kubectl
Not sure if we are using this. Does not appear to be tested.
1 parent 494e0ba commit 196eb48

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/warnet/k8s.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,13 @@ def set_context_namespace(namespace: str):
122122

123123

124124
def apply_kubernetes_yaml(yaml_file: str) -> bool:
125-
command = f"kubectl apply -f {yaml_file}"
126-
return stream_command(command)
125+
v1 = get_static_client()
126+
path = os.path.abspath(yaml_file)
127+
try:
128+
create_from_yaml(v1, path)
129+
return True
130+
except Exception as e:
131+
raise e
127132

128133

129134
def apply_kubernetes_yaml_obj(yaml_obj: str) -> None:

0 commit comments

Comments
 (0)