Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions cmd/lk/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 23 additions & 0 deletions cmd/lk/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading