Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JUJU-736] Fix embedded deploy CLI for external users #13827

Merged
merged 1 commit into from Mar 11, 2022

Conversation

wallyworld
Copy link
Member

When using the dashboard CLI widget, the deploy command was failing. The deploy command creates a couple of facades, and calls NewAPIRoot() more than once. Each call does a login and then updates the account details. Because the embedded CLI uses an in memory store for these details, the info was being overwritten and the macaroon was cleared.

This fix does 2 things:

  • refactor deploy to only get the api root once
  • make the mem store robust to account updates in case it happens again

QA steps

juju bootstrap aws/ap-southeast-2 ian --config identity-url=https://api.jujucharms.com/identity --config identity-public-key=hmHaPgCC1UfuhYHUSX5+aihSAZesqpVdjRv0mgfIwjo=
juju grant wallyworld@external login
juju grant wallyworld@external write default

then use the dashboard to deploy a charm
also check deploy from the CLI

Copy link
Member

@ycliuhw ycliuhw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just two suggestions ty

jujuclient/mem.go Show resolved Hide resolved
cmd/juju/application/deploy.go Outdated Show resolved Hide resolved
cmd/juju/application/deploy.go Outdated Show resolved Hide resolved
@wallyworld
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit b9fb403 into juju:2.9 Mar 11, 2022
@wallyworld wallyworld mentioned this pull request Mar 16, 2022
jujubot added a commit that referenced this pull request Mar 16, 2022
#13840

Merge 2.9

#13822
#13763
#13810
#13827 
#13830 
#13831 
#13833 
#13835 
#13836 
#13832 
#13838

```
# Conflicts:
# cmd/juju/application/deploy.go
# cmd/juju/application/deployer/interface.go
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants