-
Notifications
You must be signed in to change notification settings - Fork 75
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
Separate CIS and USG in the client #3344
Conversation
PR ChecklistHow to use this checklistHow to use this checklistPR AuthorFor each section, check a box when it is true. PR ReviewerCheck that the PR checklist action did not fail. Bug ReferencesNone. Confirm
How to properly reference fixed bugs
Test UpdatesUnit Tests
Integration Tests
Documentation
Does this PR require review from someone outside the core ubuntu-pro-client team?
|
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.
Looking good! A few little things.
I guess we can't really test yet until the resource is up on the backend
lib/postinst-migrations.sh
Outdated
# On Focal and Jammy, the CIS service transitioned to USG from v35 | ||
# This changes the lists and authentication files to represent that | ||
# in case CIS is enabled | ||
if [ "$VERSION_ID" = "20.04" ] || [ "$VERSION_ID" = "22.04" ]; then |
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 can have a behave test in the style of https://github.com/canonical/ubuntu-pro-client/pull/3341/files#diff-95cb2615ef8a6b5f6b24db69b295f91bd822a5d26cb1a75769c1fd0d83df5a8fR42
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 only thing missing in this PR now is integration tests. I have manually tested it many times up to the point where we can without the backends, and will have the behave stuff in place asap
Signed-off-by: Renan Rodrigo <[email protected]>
Get rid of valid_names, called_name and related functionality, so entitlements are called only by the name defined for them. Signed-off-by: Renan Rodrigo <[email protected]>
Signed-off-by: Renan Rodrigo <[email protected]>
Signed-off-by: Renan Rodrigo <[email protected]>
The entitlement classes list now returns a different value for xenial and bionic, which includes cis, and for the other releases, which includes usg Signed-off-by: Renan Rodrigo <[email protected]>
This way it is easier to test, as the return value is not determined at import time. Signed-off-by: Renan Rodrigo <[email protected]>
As Focal is the only series to ever have both of the services in a valid state at different times, there is a particular path to enable USG instead of CIS when users call `pro enable cis`. A specific message is shown on the CLI to tell users that it changed. Signed-off-by: Renan Rodrigo <[email protected]>
@orndorffgrant @lucasmoura this is done feature-wise, just missing the beave testing. |
The old CIS entitlement will not be recognized on Focal and Jammy after version 35. This converts the .list file and changes cis/ to usg/ both in the source and authentication files when running on these series. Signed-off-by: Renan Rodrigo <[email protected]>
and system.get_release_info().series == "focal" | ||
): | ||
service_to_enable = "usg" | ||
USGEntitlement.cis_version = True |
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.
sneaky sneaky heheh
we're going to love hating this
or hate loving this? unclear
but I see the compromises made and I'm happy with it. +1
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'm hate hating this for years now I hate this part a little less
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'm okay merging this ahead of integration tests, but would like @lucasmoura to approve as well before we do
We are now sorting the entitlements by name which requires a test change
Why is this needed?
This PR solves all of our problems because it implements the changes needed to turn USG into an actual resource on the client side. This aligns client behaviour with the implementation done for the backend
Test Steps
kept behavior:
new behavior:
Integration tests TBD