Skip to content

Different image deployed using python-libjuju compared to juju on Kubernetes #925

@jnsgruk

Description

@jnsgruk

Description

So juju deploy zinc-k8s --channel edge --trust, I get the following result:

❯ k -n zinc get pods zinc-k8s-0 -o json | jq '.spec.containers[1].image'
"registry.jujucharms.com/charm/hgjw3c886prn4ysv07exaoapcjerfrxyxjt7d/zinc-image@sha256:0f4a3966b438b50474e59e32814bad5b804421a211b54ae1653e835f0247d74e"

But if I deploy with python-libjuju like so:

async def test_profiling_endpoint_relation(ops_test: OpsTest):
    await asyncio.gather(
        # Test charm to ensure that the relation works properly on Kubernetes
        ops_test.model.deploy("zinc-k8s", channel="edge", application_name="zinc-k8s"),
        ops_test.model.wait_for_idle(
            apps=["zinc-k8s"], status="active", raise_on_blocked=True, timeout=1000
        ),
    )

And run the same command I get:

❯ k -n test-charm-x66r get pods zinc-k8s-0 -o json | jq '.spec.containers[1].image'
"registry.jujucharms.com/charm/hgjw3c886prn4ysv07exaoapcjerfrxyxjt7d/zinc-image@sha256:1d2df94e9899c4eeb7760faf5900da241e6ea3ffc8a964b93e99d2f1b56d5eda"

To be clear, the second is the wrong image from a previous revision and results in a broken charm

Urgency

Annoying bug in our test suite

Python-libjuju version

3.2.0.1

Juju version

3.2.0

Reproduce / Test

Example run on CI: https://github.com/jnsgruk/parca-k8s-operator/actions/runs/5680498978/job/15396238752 

To repro:

git clone https://github.com/jnsgruk/zinc-k8s-operator 
cd zinc-k8s-operator
git checkout 8fae9f1d199499cad407bd50f4bb63632ebe5058
tox -e integration

Needs microk8s/juju installed.

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