Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions autocomplete/fish_autocomplete
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcomma
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l image -r -d 'Pre-built image from the local Docker daemon (e.g. myimage:latest). Requires Docker.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l image-tar -r -d 'Pre-built image from an OCI tar file (e.g. ./image.tar). No Docker daemon required.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l id -r -d '`ID` of the agent. If unset, and the livekit.toml file is present, will use the id found there.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l help -s h -d 'show help'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy; and not __fish_seen_subcommand_from help h' -a 'help' -d 'Shows a list of commands or help for one command'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'status' -d 'Get the status of an agent'
Expand Down
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