-
-
Notifications
You must be signed in to change notification settings - Fork 650
Avoid possible override of existing values during migration of collections to 3.3.0 #3299
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
Avoid possible override of existing values during migration of collections to 3.3.0 #3299
Conversation
Codecov ReportBase: 65.51% // Head: 65.43% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #3299 +/- ##
==========================================
- Coverage 65.51% 65.43% -0.09%
==========================================
Files 113 113
Lines 15151 15155 +4
==========================================
- Hits 9926 9916 -10
- Misses 5225 5239 +14
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
c4bd185
to
57419c1
Compare
@meaksh Thanks for submitting this PR. I know little time is available but can we maybe add an isolated test case that shows that this is successfully mitigated now? |
57419c1
to
8bdcc32
Compare
When running the migration of collections from older Cobbler 2 collections to newer to 3.3.0, the mechanism for adding new items to collections (or renaming them) is not taking into consideration that those items may be existing already and may have different values than the default ones to add. We have detected this happening in distros where "boot_loaders" attribute was already existing because of any reason (i.a. retriggering migration), with "boot_loaders" set to "<<inherit>>", then after the migration runs the "boot_loaders" will end up with default value "grub", instead of preserving the existing value. This makes then profiles for this distro to not being available in the generated PXE menus.
8bdcc32
to
01ed8cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR fixes an issue found when running the migration of collections from 2.8.5 to 3.3.0. This can lead into profiles not being available in PXE menu after the migration.
The mechanism for adding predefined new items to collections (or renaming them) is not taking into consideration that those items may be existing already and may have different values than the default ones to add.
We have detected this happening in distros where
boot_loaders
attribute was already existing because of any reason (i.a. retriggering the migration), whereboot_loaders
is set to<<inherit>>
, then after the migration runs theboot_loaders
will end up wrongly with default value "grub", instead of preserving the existing value. This makes then profiles for this distro to not being available in the generated PXE menus.Behaviour changes
Old:
Given a collection with
boot_loaders: <<inherit>>
, after the migration is done for this collection, value would beboot_loaders: ['grub']
-> profiles are not shown in the PXE menuNew:
Given a collection with
boot_loaders: <<inherit>>
, after the migration is done for this collection, the value will be preserved -> profiles are still shown in the PXE menu.Category
This is related to a:
Tests