Skip to content

[release-v1.44] Give FelixConfiguration patches their own field managers - #5367

Merged
caseydavenport merged 2 commits into
tigera:release-v1.44from
caseydavenport:casey-port-14397-release-v1.44
Oct 28, 2026
Merged

caseydavenport merged 2 commits into
tigera:release-v1.44from
caseydavenport:casey-port-14397-release-v1.44

Conversation

@caseydavenport

@caseydavenport caseydavenport commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Description

This ports PR 14397 (operator FelixConfiguration field managers) to release-v1.44. Since v1.44.0, the operator's first server-side apply of FelixConfiguration overwrites or removes settings from its own patches, including those migrated from FELIX_* env vars. Those patches had no field manager, so the API server recorded them as "operator", which the apply treats as a pre-SSA operator whose fields it takes over.

  • Field managers. The shared FelixConfiguration patch helper now takes a field manager and uses it on both create and patch. Istio and Gateway API patch as operator.tigera.io/istio and operator.tigera.io/gatewayapi, and the manifest migration patches the FELIX_* settings as operator.tigera.io/migration.
  • Branch-only callers. The application layer and egress gateway controllers also call the helper on this branch but not on master, so the second commit gives them operator.tigera.io/applicationlayer and operator.tigera.io/egressgateway. Sharing one manager would bring back the same clobbering between them.
  • Port. The non-test changes applied cleanly. The tests needed only import path changes, plus one import block fixed by hand.
  • Existing clusters. A cluster already on v1.44.0 keeps whatever its first apply did; this doesn't repair it.
  • Testing. New unit tests run the fake client with managed fields enabled and check that the migration patch and the helper's create and patch each land under the expected field manager. They fail without the fix.

Introduced by: PR 5324 (shared config via server-side apply), commit 1017cf8
Related: Bug CORE-13856 (FELIX_ vars lost on migration)

Release Note

Fixes the operator overwriting or removing FelixConfiguration settings, including those migrated from FELIX_ environment variables, when it applies its own FelixConfiguration changes.

AI assistance: Claude Code (Claude Opus 5.5) ported the change and drafted this description; I reviewed every change.

By opening this PR you take responsibility for every line in it, and you agree to explain the change yourself during review rather than routing review comments back through an agent.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.
Agent context

Decisions

  • Each FelixConfiguration writer gets its own field manager under operator.tigera.io/, rather than one shared manager, so the writers don't clobber each other's fields.
  • The first commit (c6ee268) is the port of calico master squash commit e964a6840b. The second (1291eb0) covers the two callers that exist only on release-v1.44.

Constraints and gotchas

  • The managedfields package treats any field held by manager "operator" with operation Update as written by a pre-SSA operator. On its first apply it force-takes those fields, ignoring the Defer policy (a custom VXLAN VNI resets to 4096), or clears the ones its declaration leaves unset (a route table range, for example).
  • Test files import github.com/tigera/operator/... on this branch instead of github.com/projectcalico/calico/operator/..., and the import grouping differs, so one import hunk was applied by hand.

Verification

  • make ut passes for pkg/controller/utils, migration/convert, managedfields, gatewayapi, istio, applicationlayer, and egressgateway.
  • go build ./... and go vet on those packages are clean.

Code map

  • pkg/controller/utils/felix_configuration.go: PatchFelixConfiguration takes a fieldOwner argument and passes it to Create and Patch.
  • pkg/controller/migration/convert/felix_vars.go: handleFelixVars patches as migrationFieldOwner.
  • pkg/controller/{istio,gatewayapi,applicationlayer,egressgateway}/*_controller.go: each defines a fieldOwner constant and passes it to PatchFelixConfiguration.
  • pkg/controller/utils/felix_configuration_test.go, pkg/controller/migration/convert/felix_vars_test.go: managed-fields tests for the helper and the migration patch.

…eir own field managers

These two controllers call PatchFelixConfiguration on release-v1.44 but
not on master, so projectcalico/calico#14397 did not cover them. Each
gets its own owner; sharing one would let their writes clobber each
other again.
@caseydavenport caseydavenport added this to the v1.44.1 milestone Oct 27, 2026
@caseydavenport
caseydavenport requested a review from a team as a code owner October 27, 2026 19:48
@caseydavenport
caseydavenport merged commit 4042d38 into tigera:release-v1.44 Oct 28, 2026
6 checks passed
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.

1 participant