diff options
author | 2024-08-01 20:03:01 +0200 | |
---|---|---|
committer | 2024-08-01 20:08:53 +0200 | |
commit | 914998de6807b94de8c7ca5747a419472ffcf61b (patch) | |
tree | 22a633dc419b895217619070e88e0b34f6d9fe27 /arthur/exts/kubernetes/deployments.py | |
parent | Merge pull request #253 from vivekashok1221/vivek/uid-reset-msg (diff) |
Support slash-separated deployments in namespaces
Diffstat (limited to 'arthur/exts/kubernetes/deployments.py')
-rw-r--r-- | arthur/exts/kubernetes/deployments.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arthur/exts/kubernetes/deployments.py b/arthur/exts/kubernetes/deployments.py index 66f9a1e..8c47cd7 100644 --- a/arthur/exts/kubernetes/deployments.py +++ b/arthur/exts/kubernetes/deployments.py @@ -150,7 +150,16 @@ class Deployments(commands.Cog): async def deployments_restart( self, ctx: commands.Context, deployment: str, namespace: str = "default" ) -> None: - """Restart the specified deployment in the selected namespace (defaults to default).""" + """ + Restart the specified deployment in the selected namespace (defaults to default). + + It is also possible to use the more natural `kubectl` notation, that + is, specifying `rollout restart tooling/ff-bot` to restart the + deployment `ff-bot` in the namespace `tooling`. + """ + if "/" in deployment and namespace == "default": + deployment, namespace = deployment.split("/") + confirmation = ConfirmDeployment(ctx.author.id, [namespace, deployment]) msg = await ctx.send( @@ -163,9 +172,9 @@ class Deployments(commands.Cog): if timed_out: await msg.edit( content=generate_error_message( - title="What is the airspeed velocity of an unladen swallow?", + title="What is the airspeed velocity of Bella?", description=( - "Whatever the answer may be, it's certainly " + "Whatever the answer may be, he is certainly " "faster than you could select a confirmation option." ), ) |