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

Switch to more strict data types #117

Merged
merged 3 commits into from
May 27, 2018

Conversation

smortex
Copy link
Member

@smortex smortex commented May 22, 2018

This Pull-Request enforce stricter data types (e.g. Integer for port number).

While the change is smooth on file daemons where only bacula-fd is used, nodes running a director must cope simultaneously with the old and the new data types. Because the bacula::director class create a bacula::job (RestoreFiles) which is realized on the same host ; if PuppetDB already has a definition of the exported resource, it will not comply with the types requirements. As a consequence, the catalog compilation will fail and the correct "updated" resource will not replace the old invalid one in the database.

To avoid this dead-end situation, the latest commit temporary adds compatibility with the types previously used. The plan would be to release a new version of the module with this code, and then revert this patch and release a new version.

Please note however that a transient invalid configuration can occur if a director is updated before the file daemons. Hopefully, as soon as the file daemons have run puppet once, the exported resources will be fixed in PuppetDB and the next update of the director will restore a valid working configuration.

smortex added 3 commits May 22, 2018 15:11
A few parameters where configured to use a String rather than a more
specific data type.  Switch them to Boolean / Integer accordingly.
This commit will be reverted in the next version.
@smortex smortex force-pushed the fix-legacy-data-types branch from 29dddd6 to 0301c98 Compare May 22, 2018 14:07
@zachfi
Copy link
Contributor

zachfi commented May 27, 2018

Excellent, thanks @smortex.

@zachfi zachfi merged commit f4c37bb into voxpupuli:master May 27, 2018
@smortex smortex deleted the fix-legacy-data-types branch May 27, 2018 18:15
smortex added a commit that referenced this pull request Aug 21, 2023
When data types where added in version 5.4.0 a few years ago (#117),
backward compatibility with old catalog that used String for all
parameters was preserved.

We already did a few major releases so keeping this backward
compatibility does not make sense and we can make the types more
consistent by removing them.
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