only query subscriptions service with sku based features #161
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.
Summary
/services
endpoint, only query subscriptions service for features that are sku based, aka have >1 sku attached to themWhy
Right now we are querying IT subscriptions service for all features defined in the
ENT_FEATURES
environment variable. In stage/prod, this is set to:ansible,smart_management,rhods,rhoam,rhosak,openshift,acs
This config results in the following request made to subs service from entitlements:
The
openshift
feature is not configured to be sku based in prod, which meansbundle_sync
does not create this feature in subs service when it runs, which results in errors in subs service when we eventually include&features=openshift
in our querySo this PR adds a bit of logic to only include features in our query that are sku based, aka features that are 1) included in
ENT_FEATURES
, 2) have a non nil, non zero sized list of skus attached to them in our configurationhere is the prod entitlements config for reference: https://github.com/RedHatInsights/entitlements-config/blob/master/configs/prod/bundles.yml
notice how the
openshift
bundle does not have any skus defined for it. Same with a few others. This means they will not / should not have a feature created in IT subs service and that we should not query for itTesting
I copied the prod config locally to make things simple
copy prod config (linked above) to `.../entitlements-api-go/local/prod-bundles.yml
start entitlements locally with the following config:
hit the entitlements endpoint:
check the service logs, and you should see a log made about the request to subs service like so:
and then we can verify the request url did not contain the
features=openshift
param as expected