From b8549943d226b97141fcfd9ed920c651efe16e07 Mon Sep 17 00:00:00 2001 From: Brian Lopez <104384533+blo-grindr@users.noreply.github.com> Date: Wed, 1 Jul 2026 19:36:33 -0500 Subject: [PATCH] fix(agent): register deploy --id flag --- cmd/lk/agent.go | 1 + cmd/lk/agent_test.go | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index a61f6cb56..14f9ca74a 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -229,6 +229,7 @@ var ( skipSDKCheckFlag, agentPrebuiltImageFlag, agentPrebuiltImageTarFlag, + idFlag(false), }, // NOTE: since secrets may contain commas, or indeed any special character we might want to treat as a flag separator, // we disable it entirely here and require multiple --secrets flags to be used. diff --git a/cmd/lk/agent_test.go b/cmd/lk/agent_test.go index 1d2551f66..4c21c577b 100644 --- a/cmd/lk/agent_test.go +++ b/cmd/lk/agent_test.go @@ -398,6 +398,29 @@ func TestQuietFlagAlias(t *testing.T) { // "Skipped N empty secret(s)" breadcrumb) is suppressed when the Printer is quiet, and // that the --silent alias drives the same suppression as --quiet — end to end through the // real global flag and the Printer, with no code in requireSecrets checking the flag. +func TestAgentDeployRegistersIDFlag(t *testing.T) { + var deploy *cli.Command + for _, cmd := range AgentCommands { + if cmd.Name != "agent" { + continue + } + for _, sub := range cmd.Commands { + if sub.Name == "deploy" { + deploy = sub + break + } + } + } + require.NotNil(t, deploy, "deploy command should be registered") + + for _, flag := range deploy.Flags { + if flag.Names()[0] == "id" { + return + } + } + t.Fatalf("deploy command should register --id flag") +} + func TestRequireSecrets_QuietSuppressesStatus(t *testing.T) { tests := []struct { name string