-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #953 from cderici/handle-pending-upload-resources-…
…deployfromrepository #953 #### Description This is the continuation of #949, that implements handling of the local resources that need to be uploaded after a (server-side) deploy. In particular, this splits out the second part of the `add_local_resources` into a separate `_upload` function to use after the `DeployFromRepository` call which reports the pending file uploads if there's any. #### QA Steps Following the #949, this needs the server side deploy support from the controller (i.e. `>= 3.3`). So, ```sh $ juju version 3.3-beta2-ubuntu-amd64 $ juju bootstrap localhost lxd33 && juju add-model test ``` Now let's make a local resource to use: ```sh $ cd python-libjuju $ echo "jujurulez" > ./foo.txt $ cat ./foo.txt jujurulez ``` Then just manually deploy the `juju-qa-test` charm with the local resource `foo.txt`. ```python python -m asyncio asyncio REPL 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux Use "await" directly instead of "asyncio.run()". Type "help", "copyright", "credits" or "license" for more information. >>> import asyncio >>> from juju import model;m=model.Model();await m.connect();await m.deploy('juju-qa-test', application_name='j1', resources={'foo-file':'./foo.txt'})) <Application entity_id="j1"> >>> exiting asyncio REPL... ``` Now confirm that the resource is uploaded: ```sh $ juju resources j1 Resource Supplied by Revision foo-file admin 2023-09-19T22:55 ``` All CI tests need to pass. #### Notes & Discussion JUJU-3638
- Loading branch information
Showing
3 changed files
with
59 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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