-
Notifications
You must be signed in to change notification settings - Fork 120
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
[1.28.36] cockpit: code fix and CI fixes from subscription-manager-cockpit #3445
Merged
m-horky
merged 5 commits into
subscription-manager-1.28.36
from
ptoscano/cockpit-fixes-1.28.36
Aug 7, 2024
Merged
[1.28.36] cockpit: code fix and CI fixes from subscription-manager-cockpit #3445
m-horky
merged 5 commits into
subscription-manager-1.28.36
from
ptoscano/cockpit-fixes-1.28.36
Aug 7, 2024
Conversation
This file contains 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
The file /etc/insights-client/.last-upload.results is watched to determine when was the last upload done. A couple of important notes about it: 1) even though it is read (and parsed), its content is actually never used currently 2) the file is written by insights-client (better: insights-core) only when "legacy_upload" is true (which is the default as of this writing) While (1) is not much an issue, (2) means that the displaying of the last upload (timestamp) to Insights is not available when switching insights-client to non-legacy-upload. To avoid both the issues, switch from .last-upload.results to /etc/insights-client/.lastupload: - .lastupload is always written, no matter the mode, and its modification timestamp is indeed accurate - stop reading the file at all, saving a bit of resources There should be no behaviour changes. (cherry picked from commit 2ac616ffdf0d25afc10d72dc2a32b16032512dc8 in the subscription-manager-cockpit repository)
Tweak their implementations a bit to prepare them for more substantial changes; in particular: - properly name the ID we get: the "insights_id" query parameter as such, and the UUID as Inventory ID - use an helper variable to which add/set all the bits to the replies, dumping them as JSON only in one place This is only a refactor with no behaviour change. (cherry picked from commit 2cf70497eb9a1e8b87a0eb5d9910a3675a811929 in the subscription-manager-cockpit repository)
Currently, the fake systems (or better, only one) is kept in the helper "systems" dictionary by the machine ID; while this seems to work fine, in practice it will not work for upcoming changes, and it does not match what Inventory actually does. Change the ID handling to represent better what Inventory does: - assign "id" as Inventory ID for each newly registered system; in practice we have only one, and keep hardcoding "123-nice-id" for now (the "testInsights" test checks for it) - use the "id" as key in the "systems" dictionary, rather than the "machine_id" - when registering a new system, copy "machine_id" as "insights_id"; this will help later on when implementing the non-legacy API endpoints - adapt endpoints to search for the ID they need Even with all the changes, there should be no behaviour changes. (cherry picked from commit 40c42862eaf15b6f17b9a9f4e70a762574541b80 in the subscription-manager-cockpit repository)
…dpoints Implement a couple of missing platform endpoints needed to make insights-client work in non-legacy-upload mode: - the upload endpoint, which needs to get the system metadata from the MIME data sent with POST: because of this, the implementation needs a bit more work; because of testing reasons, the Inventory ID is still hardcoded as "123-nice-id" - the delete endpoint, needed to unregister a system (cherry picked from commit 5bafd3772f88ec2d3d8422f2aac6f53828ffe761 in the subscription-manager-cockpit repository)
Switch the authentication method of insights-client to CERT-based, which uses the consumer certificate & key of subscription-manager. This means using mTLS for authentication, still without verifying them, just like the previous fake credentials; this is still acceptable in the testing environment of a transient guest. (cherry picked from commit e682d429aab936718bb902380d56849ec568a141 in the subscription-manager-cockpit repository)
m-horky
approved these changes
Aug 7, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport a fix for cockpit, and some fixes to CI bits to help with non-legacy-upload, and CERT-based authentication; the PRs are: