Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore empty dtoverlay coming from target state #2269

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

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
@@ -33,6 +33,7 @@ export function envToBootConfig(
.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.

1 participant