Commit 4349a4a
authored
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-36383 files changed
Lines changed: 59 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1743 | 1743 | | |
1744 | 1744 | | |
1745 | 1745 | | |
| 1746 | + | |
| 1747 | + | |
1746 | 1748 | | |
1747 | 1749 | | |
1748 | 1750 | | |
| |||
1774 | 1776 | | |
1775 | 1777 | | |
1776 | 1778 | | |
1777 | | - | |
1778 | | - | |
1779 | | - | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
1780 | 1793 | | |
1781 | 1794 | | |
1782 | 1795 | | |
| |||
1829 | 1842 | | |
1830 | 1843 | | |
1831 | 1844 | | |
| 1845 | + | |
1832 | 1846 | | |
1833 | 1847 | | |
1834 | 1848 | | |
| |||
2029 | 2043 | | |
2030 | 2044 | | |
2031 | 2045 | | |
2032 | | - | |
2033 | 2046 | | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
2034 | 2050 | | |
2035 | | - | |
2036 | | - | |
2037 | | - | |
| 2051 | + | |
2038 | 2052 | | |
2039 | | - | |
| 2053 | + | |
2040 | 2054 | | |
2041 | | - | |
2042 | | - | |
2043 | | - | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
| 2055 | + | |
| 2056 | + | |
2048 | 2057 | | |
2049 | | - | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
2053 | 2064 | | |
2054 | | - | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
2055 | 2069 | | |
2056 | | - | |
2057 | | - | |
2058 | | - | |
2059 | | - | |
| 2070 | + | |
2060 | 2071 | | |
2061 | | - | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
2062 | 2076 | | |
2063 | 2077 | | |
2064 | 2078 | | |
2065 | 2079 | | |
2066 | 2080 | | |
2067 | | - | |
| 2081 | + | |
2068 | 2082 | | |
2069 | 2083 | | |
2070 | 2084 | | |
| |||
2077 | 2091 | | |
2078 | 2092 | | |
2079 | 2093 | | |
2080 | | - | |
| 2094 | + | |
2081 | 2095 | | |
2082 | 2096 | | |
2083 | 2097 | | |
| |||
2099 | 2113 | | |
2100 | 2114 | | |
2101 | 2115 | | |
| 2116 | + | |
2102 | 2117 | | |
2103 | 2118 | | |
2104 | 2119 | | |
2105 | 2120 | | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
2106 | 2128 | | |
2107 | 2129 | | |
2108 | 2130 | | |
| |||
2125 | 2147 | | |
2126 | 2148 | | |
2127 | 2149 | | |
| 2150 | + | |
2128 | 2151 | | |
2129 | 2152 | | |
2130 | 2153 | | |
| |||
2729 | 2752 | | |
2730 | 2753 | | |
2731 | 2754 | | |
2732 | | - | |
| 2755 | + | |
2733 | 2756 | | |
2734 | 2757 | | |
2735 | | - | |
| 2758 | + | |
2736 | 2759 | | |
2737 | 2760 | | |
2738 | 2761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
194 | | - | |
195 | | - | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | | - | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
705 | | - | |
| 705 | + | |
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
| 721 | + | |
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| |||
0 commit comments