Skip to content

[KC] Add DirectSourceFetch feature gate to bypass cache for source objects#1586

Open
dipti-pai wants to merge 1 commit intofluxcd:mainfrom
dipti-pai:direct-source-fetch
Open

[KC] Add DirectSourceFetch feature gate to bypass cache for source objects#1586
dipti-pai wants to merge 1 commit intofluxcd:mainfrom
dipti-pai:direct-source-fetch

Conversation

@dipti-pai
Copy link
Member

@dipti-pai dipti-pai commented Feb 13, 2026

This feature gate enables fetching source objects (GitRepository, OCIRepository, Bucket) directly from the API server using APIReader, bypassing the controller's cache. This can be useful when immediate consistency is required for source object reads.

When enabled via --feature-gates=DirectSourceFetch=true:

  • Source objects are fetched using r.APIReader instead of r.Client
  • A log message is emitted at startup indicating the feature is active

Changes:

  • Add DirectSourceFetch field to KustomizationReconciler struct
  • Update getSource() to use APIReader when feature is enabled
  • Register feature gate with default value false (opt-in)
  • Add unit tests for GitRepository, OCIRepository, and Bucket sources
  • Update pkg/runtime dependency to v0.100.1

Fixes: #1583

@dipti-pai dipti-pai marked this pull request as ready for review February 13, 2026 22:04
@dipti-pai dipti-pai changed the title Add DirectSourceFetch feature gate to bypass cache for source objects [KC] Add DirectSourceFetch feature gate to bypass cache for source objects Feb 13, 2026
This feature gate enables fetching source objects (GitRepository,
OCIRepository, Bucket) directly from the API server using APIReader,
bypassing the controller's cache. This can be useful when immediate
consistency is required for source object reads.

When enabled via --feature-gates=DirectSourceFetch=true:
- Source objects are fetched using r.APIReader instead of r.Client
- A log message is emitted at startup indicating the feature is active

Changes:
- Add DirectSourceFetch field to KustomizationReconciler struct
- Update getSource() to use APIReader when feature is enabled
- Register feature gate with default value false (opt-in)
- Add unit tests for GitRepository, OCIRepository, and Bucket sources
- Update pkg/runtime dependency to v0.100.1
- Downgrade pkg/ssa to v0.67.1

Signed-off-by: Dipti Pai <diptipai89@outlook.com>

Downgrade ssa

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
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.

Kustomize-controller is reconciling stale source artifact revision

1 participant