-
Notifications
You must be signed in to change notification settings - Fork 45
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
Use subscription of the product class #1283
base: master
Are you sure you want to change the base?
Conversation
Use add_on check that would return the real product class, instead of the wrong base product With that add_on product class value, perform the query to fetch the proper subscription for the product Do not compare product identifiers or based product classes but product class which belong to the right subscription This Fixes bsc#1236816 and bsc#1236836
engines/instance_verification/lib/instance_verification/providers/example.rb
Show resolved
Hide resolved
@@ -121,8 +143,12 @@ def verify_base_product_upgrade | |||
return unless upgrade_product.base? | |||
|
|||
activated_bases = @system.products.where(product_type: 'base') | |||
activated_bases.each do |base_product| | |||
return true if (base_product.identifier == upgrade_product.identifier) | |||
upgrade_product_subscription = find_subscription(upgrade_product, logger, request) |
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 would be more straight forward to check if the base_product_subscription
includes the upgrade_product
: base_product_subscription.products.include?(upgrade_product)
def add_on | ||
# method to check if a system has an add on product | ||
# based on the system metadata | ||
# and if so, it returns its real product class |
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 cannot follow this comment, what does it mean that a system has an add on product, and what is the real product class? Also, add on product is not a term used in RMT, I assume you mean 'extension product'?
# i.e. in the case of SUMA, it would SUMA product class | ||
# not the SUMA base product class (Micro) | ||
product_class = add_on_product_class.presence || base_product.product_class | ||
Subscription.joins(:product_classes).find_by( |
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, that this code (find_by
) returns randomly the first subscription that matches this criteria. But there can be multiple subscriptions that include a certain product class.
Some examples from the pubcloud account:
> Organization.find(500276).subscriptions.map{|s| "#{s.name}, product_classes: #{s.product_classes.map(&:name).join(',')}"}
=>
["RES Expanded Support, product_classes: HPC-X86-ALPHA,RES,7261-BETA,7261-ALPHA,RES-ALPHA,OPENSUSE-BETA,OPENSUSE-ALPHA,HPC-X86-BETA,HPC-X86,OPENSUSE,7261",
"SLES + HPC LTSS aarch64, product_classes: SLES12-SP3-LTSS-ARM64,SLES15-LTSS-ARM64,HPC15-LTSS-ARM64,SLES12-SP4-LTSS-ARM64,HPC15-SP2-LTSS-ARM64,SLES15-SP1-LTSS-ARM64,HPC15-SP1-LTSS-ARM64,SLES15-SP2-LTSS-ARM64,HPC15-SP3-LTSS-ARM64,HPC15-SP4-LTSS-ARM64,SLES15-SP3-LTSS-ARM64,HPC15-SP5-LTSS-ARM64,SLES15-SP4-LTSS-ARM64,SLES15-SP5-LTSS-ARM64,SLES12-SP5-LTSS-ARM64",
"SUSE Linux Enterprise Server x86_64, product_classes: 7261-BETA,HPC-X86-BETA,HPC-X86,7261",
"SUSE Linux Enterprise Server aarch64, product_classes: SLES-ARM64-BETA,SLES-ARM64,HPC-ARM64-BETA,HPC-ARM64,OPENSUSE",
"SLES for SAP + Live Patching x86_64 (special setup for public cloud), product_classes: SLE-LP,SLE-HAE-X86,SLE-HAE-X86-BETA,AiO-BETA,SLE-LP-BETA,AiO",
"SLES + HPC LTSS x86_64, product_classes: SLES15-SP4-LTSS-X86,SLES12-GA-LTSS-X86,SLES12-SP1-LTSS-X86,SLES15-GA-LTSS-X86,HPC15-LTSS-X86,SLES12-SP2-LTSS-X86,SLES12-SP3-LTSS-X86,SLES12-SP4-LTSS-X86-ALPHA,SLES12-SP4-LTSS-X86,HPC15-SP2-LTSS-X86,SLES15-SP1-LTSS-X86-ALPHA,SLES15-SP1-LTSS-X86,HPC15-SP1-LTSS-X86,HPC15-SP3-LTSS-X86,SLES15-SP2-LTSS-X86,HPC15-SP4-LTSS-X86,SLES15-SP3-LTSS-X86,SLES12-SP5-LTSS-X86,AiO,7261,HPC15-SP5-LTSS-X86,SLES15-SP5-LTSS-X86",
"SUSE Manager x86_64, product_classes: HPC-X86-ALPHA,SMP,SMS-X86,7261-BETA,SMS-X86-BETA,SMP-BETA,7261-ALPHA,SLE-M-T,SMP-ALPHA,OPENSUSE-BETA,OPENSUSE-ALPHA,HPC-X86-BETA,HPC-X86,SLE-M-T-BETA,SMS-X86-ALPHA,SLE-M-T-ALPHA,OPENSUSE,MICROOS-X86-BETA,MICROOS-X86,7261",
"SUSE Manager aarch64, product_classes: SM_ENT_MGM_S,SM_ENT_PROV_S,SLE-M-T,OPENSUSE,MICROOS-ARM64-ALPHA,MICROOS-ARM64-BETA,MICROOS-ARM64,SMS-ARM64,SMP-ARM64",
"SLE Micro aarch64, product_classes: MICROOS-ARM64-BETA,MICROOS-ARM64",
"SLE Micro x86_64, product_classes: SLE-LP,HPC-X86-ALPHA,7261-BETA,7261-ALPHA,SLE-LP-BETA,SLE-LP-ALPHA,OPENSUSE-BETA,OPENSUSE-ALPHA,HPC-X86-BETA,HPC-X86,OPENSUSE,MICROOS-X86-ALPHA,MICROOS-X86-BETA,MICROOS-X86,7261"]
You can see that the 7261 (sles x86) product class is included in multiple subscriptions. It might be required to configure which client instance data product is supposed to use which subscription in the pubcloud RMTs.
Description
Use add_on check that would return the real product class, instead of the wrong base product
With that add_on product class value, perform the query to fetch the proper subscription for the product
Do not compare product identifiers or based product classes but product class which belong to the right subscription
This Fixes bsc#1236816 and bsc#1236836
How to test
Migrate a Micro 5.5 -> Micro 6.1 should succeed
Change Type
Please select the correct option.
Checklist
Please check off each item if the requirement is met.
MANUAL.md
file with any changes to the user experience.package/obs/rmt-server.changes
.Review
Please check out our review guidelines
and get in touch with the author to get a shared understanding of the change.