-
Notifications
You must be signed in to change notification settings - Fork 289
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
Fixes #36064 - Don't try to assign empty CV/LCE to a cloned host #10448
Conversation
Issues: #36064 |
a117bb9
to
1149ae3
Compare
Hmmm, it does not seem to solve the issue for me.
|
@ares What are your exact repro steps? I reproduced the error but I did notice the stack was a bit different. And I could only reproduce on a host without content in build mode. |
1149ae3
to
eebdebf
Compare
@ares Updated. I wasn't able to reliably reproduce the error, but I think I've fixed the codepath from the error stack you posted. |
The UI issue we saw where the CV is not shown for the hostgroup even if it's present in the backend causes an incorrect patch request to go out with empty CV if we don't re-set it for every edit when using synced content from a kickstart repo in a CV.
|
This is a separate issue and I'm hoping it will be corrected when #10380 is ready.. |
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.
The UI issue we saw where the CV is not shown for the hostgroup even if it's present in the backend causes an incorrect patch request to go out
This is a separate issue and I'm hoping it will be corrected when #10380 is ready..
Ack..Remember or remind me to test this on that PR..
This PR looks good. Was able to reproduce the error and the stacktrace in different flows. This patch fixes it. 👍🏼
…atello#10448) (cherry picked from commit 870746d)
What are the changes introduced in this pull request?
Host cloning was broken! In
hosts_and_hostgroups_helper
, thekickstart_repository_options
method was taking the original host's content view and lifecycle environment and assigning it to the cloned host, without first checking to see if the original host even had a CVE assigned. Now, it skips cloning the CVE if the original host doesn't have one.Considerations taken when implementing this change?
Currently only works for single-environment hosts. I didn't cover multi-environment hosts because we haven't yet adapted anything else for multi-environment hosts. But we'll have to do that eventually.
For now, for a multi-environment host it just wouldn't clone the multiple CVEs and your cloned host would be left with no CVE. But at least you won't get a Rails error.
What are the testing steps for this pull request?
Try, from either the old or new host UI, to clone a host that doesn't have a LCE/CV assigned.