-
Notifications
You must be signed in to change notification settings - Fork 462
Bug 2031049: Fix panic when PlatformStatus VSphere is nil #2865
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Indeed we haven't changed this code in a while, so wondering why we are hitting this bug now. My main concern is, is this something expected on vSphere to have infraStatus.PlatformStatus.VSphere nil or something is missing during vSphere cluster install. Also, can it cause any possible issue later with cluster where we are not adding securePortStr on a vSphere cluster?
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.
Ah I think this was due to the recent PR merge to manage user data secret, as a result of
129d6e4#diff-3e205577bec1a1d1711df8bfeff30e63f044b24cfbdc69bbd7d0052fdc881891
and
59f1381#diff-3e205577bec1a1d1711df8bfeff30e63f044b24cfbdc69bbd7d0052fdc881891
Which we didn't do in sync.go prior to this since we (presumably) didn't need to figure out the ignition port. I may have been a little hasty on merging that PR. Maybe we can revisit that whole section? Otherwise the fix here (although it would get us past the failure) will still cause problems for the managed secret.
Uh oh!
There was an error while loading. Please reload this page.
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.
It looks like we may hit this bug on other platform handled in getIgnitionHost() right?
Jerry, since you have better context of #2827 , do you think it is better to revert the PR or check with PR author to see if we can fix the issue?
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.
cc @zaneb
I think this is because some of the old ported code may not be updated with updated assumptions on what can be nil on what platform.
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.
There's no immediate plans to use the managed secret in vSphere, so I think we should go ahead with this fix.
It's not clear to me why infraStatus.PlatformStatus would be non-nil but infraStatus.PlatformStatus.VSphere nil on a vSphere cluster.
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.
Ok so I dug around for this, and we aren't exactly internally consistent on this either. Namely, we have 2 functions that query for this field,
machine-config-operator/pkg/operator/render.go
Line 272 in b50080b
machine-config-operator/pkg/controller/template/render.go
Line 466 in aaa600e
I wonder why the operator one doesn't error. In any case I think we should probably look to de-duplicate the above 2 functions and then use the correct one here. At least we should be safe for the other platforms, so it's ok either way.
We can just merge this PR as is to unblock CI -> properly de-dupe as well.