Skip to content

[Bug]: model.deploy with channel and series parameters deploys different revision with respect to juju cli #822

@dariofaccin

Description

@dariofaccin

Description

When model.deploy() is used with channel and series parameters, it dpeloys a different revision of the charm with respect to using juju cli.
Using juju cli:

> juju deploy osm-lcm lcm --channel=latest/beta --resource lcm-image=opensourcemano/lcm:testing-daily --series focal
Located charm "osm-lcm" in charm-hub, revision 152
Deploying "lcm" from charm-hub charm "osm-lcm", revision 152 in channel latest/beta on focal
> juju status
App  Version  Status   Scale  Charm    Channel      Rev  Address        Exposed  Message
lcm           waiting      1  osm-lcm  latest/beta  152  10.152.183.22  no       installing agent
> juju show-application lcm
lcm:
  charm: osm-lcm
  series: focal
  channel: latest/beta
  constraints:
    arch: amd64
  principal: true
  exposed: false
  remote: false
  life: alive
  endpoint-bindings:
    "": alpha
    kafka: alpha
    mongodb: alpha
    ro: alpha
    vca: alpha

Using libjuju:

> await model.deploy("osm-lcm", application_name="lcm", channel="latest/beta", resources={"lcm-image": "opensourcemano/lcm:testing-daily"}, series="focal")
> juju status
App  Version  Status   Scale  Charm    Channel  Rev  Address         Exposed  Message
lcm           waiting      1  osm-lcm  beta      11  10.152.183.112  no       installing agent
> juju show-application lcm      
lcm:
  charm: osm-lcm
  series: focal
  channel: beta
  constraints:
    arch: amd64
  principal: true
  exposed: false
  remote: false
  life: alive
  endpoint-bindings:
    "": alpha
    kafka: alpha
    mongodb: alpha
    ro: alpha
    vca: alpha

This is the upstream:

> charmcraft status osm-lcm
Track    Base                    Channel                       Version    Revision    Resources       Expires at                                                                                           
latest   ubuntu 20.04 (aarch64)  stable                        113        113         image (r1)                                                                                                           
                                 candidate                     1          1           image (r1)                                                                                                           
                                 beta                          2          2           image (r1)                                                                                                           
                                 edge                          1          1           image (r1)                                                                                                           
         ubuntu 20.04 (amd64)    stable                        113        113         image (r1)                                                                                                           
                                 candidate                     1          1           image (r1)                                                                                                           
                                 beta                          152        152         lcm-image (r1)                                                                                                       
                                 edge                          1          1           image (r1)                                                                                                           
                                 edge/merged                   152        152         lcm-image (r1)  2023-04-02T00:00:00Z                                                                                 
                                 edge/paas                     154        154         lcm-image (r1)  2023-04-22T00:00:00Z                                                                                 
                                 edge/refs-changes-87-12987-2  148        148         lcm-image (r1)  2023-03-26T00:00:00Z                                                                                 
                                 edge/refs-changes-87-12987-3  150        150         lcm-image (r1)  2023-03-30T00:00:00Z                                                                                 
                                 edge/refs-changes-87-12987-4  151        151         lcm-image (r1)  2023-03-31T00:00:00Z                                                                                 
                                 edge/refs-changes-92-13092-1  155        155         lcm-image (r1)  2023-04-23T00:00:00Z                                                                                 
                                 edge/refs-changes-92-13092-2  156        156         lcm-image (r1)  2023-04-23T00:00:00Z                                                                                 
                                 edge/refs-changes-92-13092-3  157        157         lcm-image (r1)  2023-04-23T00:00:00Z                                                                                 
         ubuntu 20.04 (arm64)    stable                        113        113         image (r1)                                                                                                           
                                 candidate                     1          1           image (r1)                                                                                                           
                                 beta                          2          2           image (r1)                                                                                                           
                                 edge                          1          1           image (r1)                                                                                                           
         ubuntu 22.04 (amd64)    stable                        -          -           -                                                                                                                    
                                 candidate                     -          -           -                                                                                                                    
                                 beta                          11         11          lcm-image (r1)                                                                                                       
                                 edge                          ↑          ↑           ↑

Urgency

Annoying bug in our test suite

Python-libjuju version

2.9.42.1

Juju version

2.9.42

Reproduce / Test

from juju import jasyncio
from juju.model import Model


LCM_CHARM = "osm-lcm"
LCM_APP = "lcm"
LCM_CHANNEL = "latest/beta"
LCM_SERIES = "focal"
LCM_RESOURCES = {"lcm-image": "opensourcemano/lcm:testing-daily"}

async def deploy():
    model = Model()
    await model.connect_current()
    try:
        await model.deploy(
            LCM_CHARM,
            application_name=LCM_APP,
            resources=LCM_RESOURCES,
            channel=LCM_CHANNEL,
            series=LCM_SERIES,
        )
    finally:
        await model.disconnect()

def main():
    jasyncio.run(deploy())

if __name__ == "__main__":
    main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugindicates a bug in the project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions