Skip to content

Unify cache keys, use field manager ownership for runtime cache, & add integration tests - #422

Merged
byjustina merged 49 commits into
mainfrom
reconciler-tests
Aug 11, 2026
Merged

Unify cache keys, use field manager ownership for runtime cache, & add integration tests #422
byjustina merged 49 commits into
mainfrom
reconciler-tests

Conversation

@byjustina

@byjustina byjustina commented May 29, 2026

Copy link
Copy Markdown
Contributor

Replace server-assigned CloudSecure IDs with deterministic kind/namespace/name cache keys across both config and runtime caches. This ensures the reconciler can directly compare desired state (from CloudSecure) against observed state (from Kubernetes) without needing labels, which are subject to external controller changes.

Key changes:

  • Cache keys: Both caches now use kind/namespace/name instead of opaque server IDs
  • Ownership detection: Replace ManagedByLabel with SSA managedFields check for determining if a K8s object is operator-managed
  • Add reconciliation integration tests infra

Comment thread internal/controller/reconciler/testdata/crds/ciliumcidrgroups.yaml Outdated
Base automatically changed from reconciler-runtime to main June 2, 2026 00:19
Comment thread .github/workflows/envtest.yml Fixed
@byjustina byjustina changed the title Reconcilation loop integration tests Fix field manager ownership & add reconciliation loop integration tests Jun 5, 2026
Comment thread internal/controller/reconciler/testdata/crds/ciliumcidrgroups.yaml Outdated
Comment thread internal/controller/reconciler/testdata/crds/ciliumcidrgroups.yaml Outdated
@byjustina byjustina changed the title Fix field manager ownership & add reconciliation loop integration tests Unify cache keys, use field manager ownership for runtime cache, & add integration tests Jun 9, 2026
Comment thread internal/controller/stream/config/client.go Outdated
Comment thread internal/controller/stream/config/client.go Outdated
Comment thread internal/controller/stream/config/client.go Outdated
@byjustina
byjustina marked this pull request as ready for review June 9, 2026 18:55

@rigdomin-illumio rigdomin-illumio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Nice coverage.

There are some things that I'm a bit hesitant on and want to think further on, for now I left a few comments.

Comment thread .github/workflows/integration_envtest_tests.yml
Comment thread .github/workflows/envtest.yml Outdated
Comment thread .github/workflows/integration_envtest_tests.yml Outdated
Comment thread .github/workflows/integration_envtest_tests.yml
Comment thread internal/controller/reconciler/testdata/policies/init.yaml Outdated
Comment thread internal/controller/reconciler/setup_envtest_test.go
Comment thread Makefile Outdated
Comment thread Makefile
@rigdomin-illumio

Copy link
Copy Markdown
Contributor

Please update your PR with latest changes from main

pavankumarinnamuri

This comment was marked as spam.

@pavankumarinnamuri
pavankumarinnamuri dismissed their stale review June 16, 2026 21:50

Reposting as inline comments per file/line — please disregard this consolidated version.

@pavankumarinnamuri pavankumarinnamuri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, great coverage! A few things to address before merge — left some comments .

Comment thread internal/convert/policy.go
Comment thread internal/convert/policy.go Outdated
Comment thread internal/convert/policy.go
Comment thread internal/controller/reconciler/reconciler.go
Comment thread internal/controller/reconciler/reconciler.go Outdated
Comment thread cmd/fakeserver/main.go Outdated
Comment thread fakeserver/server.go
Comment thread fakeserver/server.go Outdated
Comment thread internal/controller/reconciler/setup_envtest_test.go Outdated
Comment thread internal/controller/reconciler/setup_envtest_test.go Outdated
Comment thread fakeserver/server.go
byjustina and others added 2 commits July 30, 2026 14:43
The merge of main (#452) into reconciler-tests kept the specField usages
but dropped its declaration during conflict resolution in policy.go,
breaking the build (undefined: specField). Re-add the constant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The checked-in generated code registered OneofWrappers against
msgTypes[62]/[64], but the messages carrying those oneofs are at
[63]/[65] — off by one because a message was added to the .proto but
the .pb.go was never fully regenerated after the merge. At init the
runtime attached oneof metadata to the wrong messages, so marshaling
ConfiguredKubernetesObjectMutation hit a missing wrapper and paniced
(fieldInfoForOneof nil deref / SIGSEGV) in envtest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rigdomin-illumio
rigdomin-illumio self-requested a review August 3, 2026 20:54
byjustina and others added 2 commits August 5, 2026 09:04
Add MinVersion: tls.VersionTLS13 to satisfy missing-ssl-minversion, and
suppress the bypass-tls-verification finding with a reviewed nosemgrep
comment: DialGRPC is test-only, dials the in-process fakeserver's
self-signed cert, so cert verification is intentionally skipped and no
MITM surface exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rigdomin-illumio

Copy link
Copy Markdown
Contributor

Need to update this PR with latest changes in Main.

@rigdomin-illumio rigdomin-illumio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get these items done:

  • Fix conflicts
  • Update EO proto change for compatability
  • Fix Nebula tests that may get impacted by this (if needed)

@rigdomin-illumio
rigdomin-illumio self-requested a review August 10, 2026 21:49
@rigdomin-illumio
rigdomin-illumio self-requested a review August 11, 2026 04:46
@byjustina
byjustina merged commit 6bb94f9 into main Aug 11, 2026
10 checks passed
@byjustina
byjustina deleted the reconciler-tests branch August 11, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants