Skip to content

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

Merged
caseydavenport merged 2 commits into
tigera:masterfrom
caseydavenport:casey-operator-shim
Aug 28, 2026
Merged

Add a startup extension so main stops calling into pkg/enterprise#5237
caseydavenport merged 2 commits 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

cmd/main.go builds the extensions once it has a client and has read the variant off the Installation, which leaves it naming a variant in exactly one place.

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

Comment thread cmd/main.go Outdated
@caseydavenport
caseydavenport force-pushed the casey-operator-shim branch 3 times, most recently from 865327d to c1b3931 Compare August 28, 2026 14:35
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.
The shared factory type only pays off once both variants call a common entry point, which the mono repo merge has not settled yet.
@caseydavenport
caseydavenport merged commit 223401c into tigera:master Aug 28, 2026
6 checks passed
@caseydavenport
caseydavenport deleted the casey-operator-shim branch August 28, 2026 21:43
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