Skip to content

Commit

Permalink
Merge pull request #13646 from roosterfish/cli_remote_regression
Browse files Browse the repository at this point in the history
lxc: Always allow specifying a password when adding remotes
  • Loading branch information
tomponline authored Jun 21, 2024
2 parents 18214db + e6c71a1 commit 65de71d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lxc/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ func (c *cmdRemoteAdd) run(cmd *cobra.Command, args []string) error {
if c.flagAuthType == api.AuthenticationMethodTLS {
req := api.CertificatesPost{}

if d.(lxd.InstanceServer).HasExtension("explicit_trust_token") {
// If the password flag isn't provided and the server supports the explicit_trust_token extension,
// use the token instead and prompt for it if not present.
if d.(lxd.InstanceServer).HasExtension("explicit_trust_token") && c.flagPassword == "" {
// Prompt for trust token.
if c.flagToken == "" {
c.flagToken, err = c.global.asker.AskString(fmt.Sprintf(i18n.G("Trust token for %s: "), server), "", nil)
Expand Down

0 comments on commit 65de71d

Please sign in to comment.