Open alnvdl-work opened 6 months ago
This limitation caused a headache today with IS. Context:
r43
), because using channels means that charms don't get updated (and maybe they have other reasons?).ubuntu-pro-client
is updated in the machines via apt, which itself relies a kind-of-channel-based mechanism for package updates (e.g., *-updates
).r43
.juju refresh
was not enough: applying the plan again reverted it to the old r43
revision. So IS needed to update the pinned version on their TF plan.See the conversation around this: https://chat.canonical.com/canonical/pl/sx4cmx5gsfgxun1i3ra4658fph
This is just to say that the problem reported in this issue leads to TF plan developers pinning revisions, effectively defeating the purpose of having channels in the first place.
And having pinned revisions tends to introduce these kinds of problems, because despite the charm itself being pinned, some of the resources it depends on (e.g., deb packages, snaps) may get updated anyway.
As discussed in chats before, this may be due to a deeper disconnect between how Juju and Terraform work at a fundamental level. I'm not expecting an easy solution, I just wanted to highlight the implications of this issue.
FYI @cmisare, @mthaddon, @fbertetto
Requirements
If an application is specifying the channel of a charm (and not a revision), then releasing a new revision to that channel and running
terraform apply
does not cause any updates. That's because the plan did not change in fact.A workaround seems to be manually running
juju refresh
to update these applications.Would it be possible to somehow have the Juju TF provider invoke
juju refresh
on the user's behalf for all applications that are not pinning a revision?A documentation update would also be nice to explain this limitation and the possible workarounds if this can't be implemented by the provider.
Urgency
It would save us from a weird workaround
Notes & References
Related discussion: https://matrix.to/#/!tGlkJIgTBsNijRGgvq:ubuntu.com/$YWVorJ5jndh30P9q0NqqlYP4AzFxwo5H6SFqxpfpxVE?via=ubuntu.com&via=matrix.org