Skip to content

Add a startup extension so main stops calling into pkg/enterprise - #5237

Open
caseydavenport wants to merge 1 commit into
tigera:masterfrom
caseydavenport:casey-operator-shim
Open

Add a startup extension so main stops calling into pkg/enterprise#5237
caseydavenport wants to merge 1 commit into
tigera:masterfrom
caseydavenport:casey-operator-shim

Conversation

@caseydavenport

@caseydavenport caseydavenport commented Aug 21, 2026

Copy link
Copy Markdown
Member

Description

The operator's startup path calls into the Enterprise package directly for several things. Those go through the extensions boundary here instead, via a new startup slot that no-ops when nothing registers.

  • checking that the variant's CRDs are served before any controller starts
  • verifying the cluster's Elasticsearch certificates match the configured internal or external mode
  • listing the namespaces the operator manages and so must not run in itself
  • discovering the tenancy mode, which only ever comes back true for Enterprise or Cloud
  • interpreting the cloud build flag, which the Makefile bakes in through linker flags

The extensions now arrive as a factory rather than a built registry, since the variant is not known until the operator has a client and has read the Installation. That leaves cmd/main.go naming a variant in exactly one place, the factory it starts with, which is what a variant's own entry point replaces.

Behavior is unchanged with two exceptions worth calling out. The protected namespaces were already applied whatever the variant, so the startup extension registers for every variant and skips the checks that only apply to Enterprise. The version banner prints the build variant it was given rather than a hardcoded product name, so a cloud build reports "cloud"; the line the release tooling parses for the operator version is untouched.

Related: CORE-13420

None

The variant's API checks, cluster state verification, protected namespaces,
tenancy and cloud build flag now register through pkg/extensions, and the
extensions arrive as a factory the operator calls once it resolves the variant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants