canonical / operator

Pure Python framework for writing Juju charms
Apache License 2.0
247 stars 119 forks source link

Check if pebble layer coerces values or is round-trip safe #1398

Open dimaqq opened 1 month ago

dimaqq commented 1 month ago

From the survey

I ran into a problem when updating a layer that contains an integer, e.g. integer configuration option. The logs were duplicated because layer was updated / replanned always, since the current plan had integer converted to string, but my plan had an integer.

@dimaqq 's assumption here is that perhaps it's allowed to set pebble layer with val: 42 which is then read back as val: "42". If that's the case, charmer's version of the layer never compares equal to the current, and the charm keeps re-planning on every event.