insights: Fix license check for freezing insights
Created by: CristinaBirkel
Description
This is a bug fix for the license check. Previously I was using licensing.GetConfiguredProductLicenseInfo()
and checking the plan's features for code-insights
. For the real license I generated for k8s
, this didn't pick up on the code-insights
tag. (It did for the dev
license I was using to test with locally though, which is why I had originally thought it was working.)
So this fix is to use licensing.Check(licensing.FeatureCodeInsights)
instead, which is working with a license generated with all the tags I used for the k8s
license.
Test plan
Follow the same steps as in https://github.com/sourcegraph/sourcegraph/pull/32418 except that the license should be generated as follows:
go run ./enterprise/internal/license/generate-license.go -private-key ../dev-private/enterprise/dev/test-license-generation-key.pem -tags=plan:enterprise-0,acls,private-extension-registry,remote-extensions-allow-disallow,monitoring,true-up,batch-changes,code-insights,distro,internal -users=10 -expires=8784h