juju / python-libjuju

Python library for the Juju API
Apache License 2.0
57 stars 93 forks source link

Pinned revision in bundle not taken into account when deploying with model.deploy() #1042

Closed Thanhphan1147 closed 2 months ago

Thanhphan1147 commented 2 months ago

From the conversation at: https://matrix.to/#/!xzmWHtGpPfVCXKivIh:ubuntu.com/$gVXe8o8uyDewViyBtlQi0QBFn6eWfy4nGqSbegxg0jg?via=ubuntu.com&via=matrix.org&via=fsfe.org

Hi!

When trying to deploy this bundle : https://github.com/canonical/iam-bundle/blob/main/bundle.yaml.j2, I see that the revision for some of the charms are pinned (e.g: rev52 for self-signed-certificates). But when I deploy the bundle with this code :

identity_platform = await model.deploy(
    'identity-platform',
     channel='edge',
     trust=True,
)

The pinned revision didn't get taken into account and instead I get the latest revision of the charms (rev127 in this case)

self-signed-certificates                      active       1  self-signed-certificates             latest/edge    127  10.152.183.67   no 

This doesn't happen when I do juju deploy identity-platform --channel=latest/edge --trust

Environment

(.env) ubuntu@ubuntu:~$ juju --version
3.1.7-genericlinux-amd64

(.env) ubuntu@ubuntu:~$ sudo microk8s version
MicroK8s v1.28.7 revision 6532

(.env) ubuntu@ubuntu:~$ python3 --version
Python 3.10.12

(.env) ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy

(.env) ubuntu@ubuntu:~$ juju controllers
Use --refresh option with this command to see the latest information.

Controller   Model      User   Access     Cloud/Region        Models  Nodes  HA  Version
controller*  pylibjuju  admin  superuser  microk8s/localhost       2      1   -  3.1.7  

(.env) ubuntu@ubuntu:~$ pip3 show juju 
Name: juju
Version: 3.4.0.0
Summary: Python library for Juju
Home-page: https://github.com/juju/python-libjuju
Author: 
Author-email: 
License: Apache 2
Location: /home/ubuntu/.env/lib/python3.10/site-packages
Requires: hvac, kubernetes, macaroonbakery, packaging, paramiko, pyasn1, pyRFC3339, pyyaml, toposort, typing-inspect, websockets
Required-by: