Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support slash-separated deployments in namespaces #257

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading