fix(agent): register --id flag on agent deploy#879
Open
mcdgavin wants to merge 1 commit into
Open
Conversation
deployAgent resolves the agent via getAgentID, which reads cmd.String("id"),
but the deploy subcommand never registered the --id flag (unlike config, status,
restart, rollback). As a result `lk agent deploy --id CA_XXX` failed at parse time
with "flag provided but not defined: --id".
Add idFlag(false) to the deploy command's flags, matching the other subcommands.
Fixes livekit#830
188bd00 to
fe6e232
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lk agent deployresolves the target agent viagetAgentID, which readscmd.String("id")— but thedeploysubcommand never registered the--idflag(unlike
config,status,restart, androllback). As a resultlk agent deploy --id CA_XXXfailed at flag-parse time withflag provided but not defined: --id, and the id lookup was effectively dead codeon the deploy path.
This adds
idFlag(false)to the deploy command's flags, matching the siblingsubcommands.
--idremains optional and falls back tolivekit.tomlas before.Test
TestAgentDeployRegistersIDFlagintrospects the realagent deploycommand andasserts it registers
--id(fails before this change).lk agent deploy --helpnow lists--id;go test ./cmd/lk/andgofmtpass.Thanks to @MSameerAbbas for the precise diagnosis in the issue.
Fixes #830