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

[2.7] improve errors when resolving bundle includes #11080

Conversation

achilleasa
Copy link
Contributor

Description of change

This PR brings in the changes from juju/charm#301 so the juju CLI can display more informative error messages when failing to locate a relative include from a base bundle or an overlay.

QA steps

$ mkdir bananas ; cd bananas

#----------------------
# Check error for a base bundle include
#----------------------
$ cat > bundle.yaml <<EOT
applications:
  containerd:
    charm: cs:~containers/containerd-53
    options:
      foo: include-file://../secrets/secret-password.txt
EOT

$ juju deploy ./bundle.yaml --dry-run
ERROR cannot deploy bundle: processing option "foo" for application "containerd": resolving include "../secrets/secret-password.txt": include file "$PWD/secrets/secret-password.txt" not found

#----------------------
# Check error for an overlay include
#----------------------
$ cat > bundle.yaml <<EOT
applications:
  containerd:
    charm: cs:~containers/containerd-53
EOT

$ mkdir bar
$ cat > bar/overlay.yaml <<EOT
applications:
  containerd:
    charm: cs:~containers/containerd-53
    options:
      foo: include-file://../secrets/secret-password.txt
EOT

# Note that the absolute path in the following error has been resolved relative to the *overlay* path
$ juju deploy ./bundle.yaml --overlay bar/overlay.yaml --dry-run
ERROR cannot deploy bundle: processing option "foo" for application "containerd": resolving include "../secrets/secret-password.txt": include file "$PWD/bananas/secrets/secret-password.txt" not found

# Compare the above errors to the ones generated by an older 2.7 CLI (e.g. from snap)

Bug reference

Improves error messages as discussed in https://bugs.launchpad.net/juju/+bug/1851817

This bump improves the generated error messages when juju fails to
locate a relative include from a base bundle or an overlay.
@achilleasa
Copy link
Contributor Author

$$merge$$

@jujubot jujubot merged commit ec91b32 into juju:2.7 Jan 7, 2020
@ycliuhw ycliuhw mentioned this pull request Jan 8, 2020
jujubot added a commit that referenced this pull request Jan 8, 2020
#11081

## Please provide the following details to expedite Pull Request review:

### Checklist

- <del>[ ] Checked if it requires a [pylibjuju](https://github.com/juju/python-libjuju) change?</del>
 - <del>[ ] Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR?</del>
 - <del>[ ] Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed?</del>
 - <del>[ ] Do comments answer the question of why design decisions were made?</del>

----

## Description of change

port 2.7 to develop:

- #11075 Allow RemoteRelationWatcher facade for CaaS;
- #11080 [2.7] improve errors when resolving bundle includes;

## QA steps

None


## Documentation changes

None

## Bug reference

None
@achilleasa achilleasa deleted the 2.7-improve-errors-when-resolving-bundle-includes branch January 8, 2020 10:35
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