Match the Enterprise product, not one of its two spellings - #5169
Merged
Conversation
An Installation asking for the deprecated TigeraSecureEnterprise variant got no extensions at all: enterprise.New switched on operatorv1.CalicoEnterprise and fell through to the zero-value Extensions for the alias. Every Enterprise modifier went missing, so calico-node and calico-typha rendered without the Enterprise-only cluster role rules and Typha never reached a ready state: connection is unauthorized: licensekeys.projectcalico.org is forbidden: User "system:serviceaccount:calico-system:calico-typha" cannot list resource "licensekeys" in API group "projectcalico.org" calico-private's kind clusters install with variant: TigeraSecureEnterprise, which is how this surfaced. Match on IsEnterprise() instead, and compare the same way in Decorate so an Installation and an extension that spell the variant differently still pair up. The typha integration test now runs over both spellings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
caseydavenport
approved these changes
Aug 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression in the enterprise extension mechanism by making variant matching alias-safe, so TigeraSecureEnterprise (deprecated) and CalicoEnterprise (current) both correctly activate Enterprise modifiers and extensions.
Changes:
- Make Enterprise extension registration in
pkg/enterprisematch onvariant.IsEnterprise()instead of a single constant. - Make extension decoration (
extensions.Decorate) treat both Enterprise spellings as the same product via a shared comparison helper. - Expand tests to exercise the deprecated spelling through both the unit-level decoration tests and the Typha integration-style test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/extensions/extensions_test.go | Adds coverage for the deprecated Enterprise spelling in Decorate behavior. |
| pkg/extensions/component.go | Updates Decorate to use an alias-safe Enterprise comparison (sameProduct). |
| pkg/enterprise/register.go | Fixes Enterprise extension set construction to use IsEnterprise() for variant matching. |
| pkg/controller/utils/component_enterprise_test.go | Extends the Typha modifier integration test to run for both Enterprise spellings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+60
to
+66
| It("runs the modifier for the deprecated Enterprise spelling", func() { | ||
| c := extensions.Decorate(baseComponent(), inputsFor(operatorv1.TigeraSecureEnterprise), operatorv1.CalicoEnterprise, addConfigMap) | ||
|
|
||
| create, _ := c.Objects() | ||
| Expect(create).To(HaveLen(2)) | ||
| }) | ||
|
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
calico-private's kind clusters have been failing to come up since #4871 landed. Typha never goes ready, and its log fills with:
The same happens for
networks,externalnetworks,egressgatewaypolicies,packetcaptures,bfdconfigurations,deeppacketinspectionsandremoteclusterconfigurations, on bothcalico-typhaandcalico-node. That set is exactly whatmodifyTyphaandmodifyNodeadd, so the Enterprise extensions were not running at all.Cause
ProductVarianthas two Enterprise spellings —CalicoEnterprise, andTigeraSecureEnterprisekept as a deprecated alias (#4607).enterprise.Newswitched on the constant:An Installation asking for
TigeraSecureEnterprisematched neither case and fell through to the zero value, which extends nothing. Every Enterprise modifier — installation, windows, apiserver, clusterconnection — silently went missing. calico-private'shack/test/kind/infra/values.yamlsetsvariant: TigeraSecureEnterprise, so its kind clusters took the whole regression.Fix
Match on
variant.IsEnterprise()rather than the constant, and compare the same way inextensions.Decorate, so an Installation and an extension that spell the variant differently still pair up.pkg/renderwas already alias-safe: every other comparison tests againstCalico, which has only one spelling.Testing
pkg/controller/utils/component_enterprise_test.goalready renders a real Typha through the handler and assertslicensekeyslands in the cluster role. It hardcodedCalicoEnterprise— the one spelling that worked — so it now runs over both, and fails onTigeraSecureEnterprisewithout this change.🤖 Generated with Claude Code