Skip to content

Conversation

@pipex
Copy link
Contributor

@pipex pipex commented Apr 11, 2024

Before v16, the supervisor would incorrectly interpret an empty dtoverlay in config.txt (i.e. a line with dtoverlay=) as a proper variable and create it as config var if found on config.txt before provisioning. With the latest supervisor, an empty dtoverlay on config.txt is interpreted in the correct way, but that makes an empty dtoverlay on the target state meaningless, leading to looping behavior as the current and target state won't match.

This PR modifies the pre-processing function to filter out empty array variables before the comparison, to prevent this sort of looping behavior. This allows empty dtoverlay to be ignored.

Change-type: patch

Before v16, the supervisor would incorrectly interpret an empty dtoverlay in
config.txt (i.e. a line with `dtoverlay=`) as a proper variable and
create it as config var if found on config.txt before provisioning.
With the latest supervisor, an empty dtoverlay on config.txt is
interpreted in the [correct way](https://www.raspberrypi.com/documentation/computers/config_txt.html#dtoverlay), but
that makes an empty dtoverlay on the target state meaningless, leading
to looping behavior as the current and target state won't match.

This PR modifies the pre-processing function to filter out empty array
variables before the comparison, to prevent this sort of looping
behavior. This allows empty dtoverlay to be ignored.

Change-type: patch
.mapValues((val, key) =>
configBackend.processConfigVarValue(key, val || ''),
)
.pickBy((val) => !Array.isArray(val) || val.length > 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I saw on the other config backends, this should have no impact as the config.txt backend is the only one that returns an empty array

@pipex pipex marked this pull request as draft April 11, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants