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 @@ -80,6 +80,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 config' -f -l help -s h -d 'show help'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from config; 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 simulate help h' -a 'deploy' -d 'Deploy a new version of the agent'
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 secrets -r -d 'KEY=VALUE comma separated secrets. These will be injected as environment variables into the agent. These take precedence over secrets-file.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -l secrets-file -r -d '`FILE` containing secret KEY=VALUE pairs, one per line. These will be injected as environment variables into the agent.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment'
Expand Down
1 change: 1 addition & 0 deletions cmd/lk/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ var (
Before: createAgentClient,
Action: deployAgent,
Flags: []cli.Flag{
idFlag(false),
secretsFlag,
secretsFileFlag,
secretsMountFlag,
Expand Down
18 changes: 18 additions & 0 deletions cmd/lk/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,3 +456,21 @@ func TestRequireSecrets_QuietSuppressesStatus(t *testing.T) {
})
}
}

// TestAgentDeployRegistersIDFlag is a regression test for #830: `lk agent deploy`
// resolves the agent via getAgentID, which reads cmd.String("id"). The deploy
// subcommand must therefore register the --id flag; it previously omitted it, so
// `lk agent deploy --id ...` failed at flag-parse time with "flag provided but not defined".
func TestAgentDeployRegistersIDFlag(t *testing.T) {
agentCmd := findCommandByName(AgentCommands, "agent")
require.NotNil(t, agentCmd, "top-level 'agent' command must exist")

deployCmd := findCommandByName(agentCmd.Commands, "deploy")
require.NotNil(t, deployCmd, "'agent deploy' command must exist")

var names []string
for _, f := range deployCmd.Flags {
names = append(names, f.Names()...)
}
require.Contains(t, names, "id", "'agent deploy' must register the --id flag")
}
Loading