Skip to content

Commit

Permalink
Support slash-separated deployments in namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristgit committed Aug 1, 2024
1 parent 96f525f commit 914998d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions arthur/exts/kubernetes/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,16 @@ async def deployments_list(self, ctx: commands.Context, namespace: str = "defaul
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(
Expand All @@ -163,9 +172,9 @@ async def deployments_restart(
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."
),
)
Expand Down

0 comments on commit 914998d

Please sign in to comment.