-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: register with content templates #168
Open
rverdile
wants to merge
1
commit into
RedHatInsights:main
Choose a base branch
from
rverdile:content-templates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ BUILDROOT | |
RPMS | ||
SOURCES | ||
SRPMS | ||
.idea |
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
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
Oops, something went wrong.
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.
The registration using activation key & org & content templates does not work.
You cannot do it so simple, when activation key(s) are used for registration. You cannot use environment names as environment IDs. You have to get IDs from environment names in the same way as you do it for registration using username & password.
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 GetEnvironments() method requires username and password, so the intention here was to assume that the given values are the IDs.
But now I am wondering if using activation keys with templates should be prevented? The ID is not really usable in the case of content templates. @ptoscano wrote the ticket he want to provide some input.
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.
Yeah, you are right. Getting environments requires username and password...
Hmm, It would be easy to simply say that content templates are supported only with username and password authentication, but user experience would not be the best.
Other approach: requiring environment name for username & password and requiring environment ID (typically some UUID) for activation key authentication would be very very confusing.
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 problem here is due to the difference in behaviour of two types of "credentials": username & password, activation key(s) (AKs) + org id:
POST /consumers
endpoint. They currently cannot be used for anything else than thatEnvironments have been historically handled in a "special way": so far they are Katello-only feature, and for reasons I'm not even sure about they were implemented in Katello directly (since Katello proxies the communication to its Candlepin instance) as part of AKs. When connecting directly to Candlepin there is (or better, used to be) no possibility to specify environments with AKs. Hence, if the IDs and names of AKs are different, they don't generally matter in a Katello setup.
Strictly speaking, the org ID has the same inconsistency as environments:
--org
--org
as-is when registering with AKsThe above inconsistency for org ID practically has not been an issue because:
Because of the above, IMHO there is not much that can be done to avoid the inconsistencies from Candlepin; my recommendation is to:
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.
No, I will never accept anything like this! Because it would very confusing user experience. If this proposal was implemented, then we would see many customer cases related to this inconsistency (environment names for username & password, environment IDs for activation-keys & orgs).
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.
I have been thinking about this problem and I think that cleanest solution is to use environment IDs in both cases (authentication using username & password, authentication using activation-key & org). Could environment IDs be some e.g. UUID. Yes, it could happen. Do users care? Not really, because if environment names were supported, then they would probably copy paste environment names to command line anyway. So, it does not matter, what they copy paste.
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.
A candlepin dev pointed out that candlepin can natively accept the environment name:
Any reason to not go that route?
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 is probably doable, but something like this would be necessary for subscription-manager first: candlepin/subscription-manager#3480