From 914998de6807b94de8c7ca5747a419472ffcf61b Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Thu, 1 Aug 2024 20:03:01 +0200 Subject: Support slash-separated deployments in namespaces --- arthur/exts/kubernetes/deployments.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'arthur/exts/kubernetes/deployments.py') 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." ), ) -- cgit v1.2.3