-
Notifications
You must be signed in to change notification settings - Fork 897
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
Fix vm retirement initiated on global region #20244
Conversation
0ad35b1
to
0c58d19
Compare
0c58d19
to
a4d3daf
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.
Can you describe what the actual problem was and why this fixes it? Based on the diff it looks like there was some problem with the user id, but I'm not exactly sure. It would be good to have a real description of the issue in case we need to look back on this.
api_args ||= {} | ||
collection = api_client_connection_for_region(region).public_send(collection_name) | ||
user_name = api_args[:requester]&.fetch("user_name") | ||
user_name = User.current_user&.userid if user_name.blank? |
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.
Why the &.
here?
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.
Retirement request now going throw queue, so, User.current_user
(or User.curent_userid
) is nil
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.
for retirement request we need &
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.
this fix does does make sense right now only for retirement request, but going forward all operations toward remote region over queue can use it
@@ -70,8 +70,11 @@ def self.api_client_connection_for_region(region_number, user = User.current_use | |||
|
|||
def self.exec_api_call(region, collection_name, action, api_args = nil, id = nil) | |||
require 'manageiq-api-client' | |||
_log.info("Executing InterRegion api call for region #{region} with arguments: #{api_args}") |
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.
Could these args have something sensitive in them that we maybe don't want to log? I think the api logs have a special parser that sanitizes things which we wouldn't have here.
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.
Ohh, ok. I wanted to provide more info for future troubleshooting.
Will remove logging
…for_region invocation
bea62a6
to
9cde7d7
Compare
Checked commits yrudman/manageiq@a4d3daf~...9cde7d7 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint |
@miq-bot add-label ivanchuk/yes, jansa/yes |
Fix vm retirement initiated on global region (cherry picked from commit 97c2e5b)
Jansa backport details:
|
with ManageIQ/manageiq#20244 for global region initiated requests.
Fix vm retirement initiated on global region (cherry picked from commit 97c2e5b)
Ivanchuk backport details:
|
ISSUE:
When
InterRegionApiMethodRelay.api_relay_class_method
invoked over queueUser.current_userid
is not defined, sonil
passed asuser
inIt cause
in
Authentication.authenticate_with_system_token
on remote regionFixes https://bugzilla.redhat.com/show_bug.cgi?id=1839770
@miq-bot add-label bug, ivanchuk/yes, jansa/yes