Skip to content

Commit 48b36c2

Browse files
committed
started exec and attach for ArgoCD - temp commit
1 parent c93e97d commit 48b36c2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/edge_containers_cli/cmds/argo_commands.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,24 @@ def deploy(self, service_name, version, args, confirm_callback=None) -> None:
151151

152152
push_value(self.target, f"ec_services.{service_name}", deploy_dict)
153153

154+
def exec(self, service_name):
155+
# this command uses kubectl. TODO is there an argocd cli equivalent?
156+
self._check_service(service_name)
157+
# namespace for kubectl is the first part of the argocd root app name
158+
# TODO this is very specific to the nameing conventions used at DLS
159+
# and is a bit rubbish - we probably should also provide the namespace
160+
# as an environment variable - but I'd prefer a pure argocd solution
161+
# if possible
162+
target = f"{self.target.split('/')[1]}-beamline"
163+
shell.run_interactive(
164+
f"kubectl -it -n {target} exec {service_name}-0 -- bash",
165+
skip_on_dryrun=True,
166+
)
167+
168+
def attach(self, service_name):
169+
self._check_service(service_name)
170+
self.exec("ioc-attach")
171+
154172
def logs(self, service_name, prev):
155173
self._logs(service_name, prev)
156174

0 commit comments

Comments
 (0)