Fixing service bundle resource linking #18250
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes an issue with the provisioning of bundled services that was introduced in https://github.com/ManageIQ/manageiq/pull/16799/files#diff-9257fff45a7d1258305c9a6b7d15e322R198, a pr which changed service_template.rb to use the block form of create. The issue with this is that when we get to the "add_resource" call the child service isn't saved yet and does not have an ID which causes the service resource to be saved with a resource_type but without a resource_id.
The second commit puts back the original direct_service_retirement call taken out here: https://github.com/ManageIQ/manageiq/pull/17881/files#diff-610ed908579256e82c76ec0910169142L10. The fact that things were being provisioned without the link in the first commit meant that the children of a bundle weren't being retired. This fixes that and adds an additional check to make sure that we're not doubly retiring anything.
This will in some form need to go back to Fine, though the call for the double service retirement was removed entirely from gaprindashvili.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1653648