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

Application refresh with resources #960

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

cderici
Copy link
Contributor

@cderici cderici commented Oct 13, 2023

Description

This adds two things:

  1. Fixes the error that causes upgrade_charm does not work for ceph-mon #955 where we were trying to pass a revision for a resource in refresh, can be reproduced with the juju-cli as well as follows:
 $ juju deploy ceph-mon --channel octopus/stable
 $ juju refresh ceph-juju --channel quincy/stable --resource alert-rules=1
ERROR while adding pending resource info for "alert-rules": bad resource metadata: bad info: bad metadata: resource missing filename
  1. This also implements functionality that allows passing resources argument to application refresh for non-local charms.

Fixes #955 and #883

QA Steps

So the fix for the #955 can be tested manually by recreating the scenario above with pylibjuju as follows:

 $ python -m asyncio
>>> import asyncio
>>> from juju import model;m=model.Model();await m.connect()
>>> await m.deploy('ceph-mon', channel='octopus/stable')

Check the resources for that using juju-cli:

  $ juju resources ceph-mon
No resources to display.

Go back to the python repl:

>>> await m.applications['ceph-mon'].refresh(channel='quincy/stable')
This should succeed

And check the resources again external to pylibjuju, you should see the resource is added:

  $ juju resources ceph-juju
Resource     Supplied by  Revision
alert-rules  charmstore   1

Additionally, an integration test for the second part of the PR that adds the resource argument to refresh is added, so just run that, and maybe play with it manually for different charms:

tox -e integration -- tests/integration/test_application.py::test_refresh_with_resource_argument

All CI tests need to pass.

Notes & Discussion

JUJU-4736

Fixes juju#955

This also implements functionality that allows passing resources
argument to application refresh.
@cderici cderici added hint/2.9 going on 2.9 branch area/forward-port to be forward ported - remove label after port labels Oct 13, 2023
@cderici cderici requested a review from jack-w-shaw October 13, 2023 18:18
@cderici cderici changed the title App refresh resources issue 955 Application refresh with resources Oct 13, 2023
@cderici cderici requested a review from anvial October 16, 2023 15:13
Copy link
Member

@anvial anvial left a comment

Choose a reason for hiding this comment

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

QA passed,

thx

@cderici
Copy link
Contributor Author

cderici commented Oct 17, 2023

/merge

@jujubot jujubot merged commit 4691c96 into juju:2.9 Oct 17, 2023
9 checks passed
jujubot added a commit that referenced this pull request Oct 26, 2023
#973

#### Description

This is a forward port of #960, bringing support for refreshing application with providing `resources` as arguments.

Fixes #955 and #883 for 3.x track.

#### QA Steps

QA steps should be the same with #960:

So the fix for the #955 can be tested manually by recreating the scenario above with pylibjuju as follows:

```python
 $ python -m asyncio
>>> import asyncio
>>> from juju import model;m=model.Model();await m.connect()
>>> await m.deploy('ceph-mon', channel='octopus/stable')
```

Check the resources for that using juju-cli:

```sh
 $ juju resources ceph-mon
No resources to display.
```

Go back to the python repl:

```python
>>> await m.applications['ceph-mon'].refresh(channel='quincy/stable')
This should succeed
```

And check the resources again external to pylibjuju, you should see the resource is added:

```sh
 $ juju resources ceph-juju
Resource Supplied by Revision
alert-rules charmstore 1
```

Additionally, an integration test for the second part of the PR that adds the resource argument to refresh is added, so just run that, and maybe play with it manually for different charms:

```
tox -e integration -- tests/integration/test_application.py::test_refresh_with_resource_argument
```

All CI tests need to pass.

#### Notes & Discussion

JUJU-4736
jujubot added a commit that referenced this pull request Oct 26, 2023
#979

## What's Changed
* Deploy by revision on 2.9 by @cderici in #957
* Application refresh with resources by @cderici in #960
* Improve jujudata to find controller name by endpoint by @cderici in #964
* Allow switch kwarg in refresh to switch to local charms by @jack-w-shaw in #968
* Parse charm URLs consistantly for local charms by @jack-w-shaw in #969
* Fix juju config directory location pointed by XDG_DATA_HOME by @cderici in #975
* [JUJU-4779] Switch to local properly by @jack-w-shaw in #977

#### Notes & Discussion

JUJU-4850

[JUJU-4779]: https://warthogs.atlassian.net/browse/JUJU-4779?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@cderici cderici removed the area/forward-port to be forward ported - remove label after port label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hint/2.9 going on 2.9 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants