`juju deploy --dry-run` reporting false positives for config changes

Bug #1925998 reported by Tom Haddon
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Jack Shaw

Bug Description

When running `juju deploy --dry-run` I'm seeing false positives for config differences. The output of `juju config ubuntu-advantage ppa` is `ppa:ua-client/stable`, but when I run juju deploy --dry-run --verbose against my bundle file I see:
```
Changes to deploy bundle:
- set application options for ubuntu-advantage
  setting options:
    ppa: "ppa:ua-client/stable"
```
Here's some more verbose output (sorry, Canonical only):

https://pastebin.canonical.com/p/hpN6Jd948J/

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1925998] [NEW] `juju deploy --dry-run` reporting false positives for config changes

So one question is whether the default value for ppa is
ppa:ua-client/stable, in which case we are distinguishing from a charm
explicitly setting the value to what happens to be the default, vs just
inheriting the default value.

On Sat, Apr 24, 2021 at 5:00 AM Tom Haddon <email address hidden>
wrote:

> Public bug reported:
>
> When running `juju deploy --dry-run` I'm seeing false positives for config
> differences. The output of `juju config ubuntu-advantage ppa` is
> `ppa:ua-client/stable`, but when I run juju deploy --dry-run --verbose
> against my bundle file I see:
> ```
> Changes to deploy bundle:
> - set application options for ubuntu-advantage
> setting options:
> ppa: "ppa:ua-client/stable"
> ```
> Here's some more verbose output (sorry, Canonical only):
>
> https://pastebin.canonical.com/p/hpN6Jd948J/
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1925998
>
> Title:
> `juju deploy --dry-run` reporting false positives for config changes
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1925998/+subscriptions
>

Revision history for this message
Tom Haddon (mthaddon) wrote :

The charm default is indeed `ppa:ua-client/stable` and `juju config ubuntu-advantage` is reports `source: default`. So it sounds like this is as you say the difference between being left to the charm default and set explicitly to the same value as the charm default. Seems we can close this out. Thanks.

Revision history for this message
Drew Freiberger (afreiberger) wrote :

The behavior of juju 2.9.22 is now different. You cannot explicitly set a variable to the same value as default for the charm:

to demonstrate:

$ juju deploy ubuntu
$ juju config ubuntu hostname=""
WARNING the configuration setting "hostname" already has the value ""
$ juju config ubuntu
*snip*
settings:
  hostname:
    default: ""
    description: Override hostname of machine, when empty uses default machine hostname
    source: default
    type: string
    value: ""

Note that the source remains default, and the user cannot explicitly set the value any longer. This protects against bundles that overly zealously configure charm settings which are default, but doesn't protect against charm authors potentially changing charm defaults in the future when users would prefer to nail their configs to the current defaults as they upgrade their charm.

Changed in juju:
assignee: nobody → Jack Shaw (jack-shaw)
importance: Undecided → Medium
status: New → Triaged
tags: added: config deploy dry-run
Revision history for this message
Jack Shaw (jack-shaw) wrote :

Unable to replicate this. Presumably it was resolved by accident?

```
$ juju version
2.9.40-ubuntu-amd64

$ juju config ubuntu hostname
foo.bar

$ cat bundle.bundle
series: focal
applications:
  ubuntu:
    charm: ubuntu
    channel: stable
    revision: 21
    num_units: 1
    to:
    - "0"
    options:
      hostname: foo.bar
    constraints: arch=amd64
machines:
  "0":
    constraints: arch=amd64

$ juju deploy ./bundle.bundle --dry-run --verbose
No changes to apply.
```

Closing this. Feel free to re-open if you are still able to replicate

Changed in juju:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.