[release-1.28] Migrate to fs.FS as the sole resource loading interface#1594
Merged
istio-testing merged 3 commits intoistio-ecosystem:release-1.28from Mar 17, 2026
Conversation
6 tasks
dgn
approved these changes
Feb 12, 2026
Replace string-based ResourceDirectory with fs.FS throughout the codebase to provide a unified abstraction for loading Helm charts and profiles. Changes: - ReconcilerConfig.ResourceDirectory string → ResourceFS fs.FS - cmd/main.go wraps flag value with os.DirFS() at startup - All controllers use ResourceFS directly (no path construction with ResourceDirectory) - UpgradeOrInstallChart now takes (fs.FS, chartPath) instead of chartDir - Renamed getChartDir() → getChartPath() (returns relative path) - Added pkg/helm/fsloader.go with LoadChart() for loading charts from fs.FS This enables consumers to use embed.FS for bundled resources or os.DirFS for filesystem-based resources through a single consistent interface. BREAKING CHANGE: ReconcilerConfig.ResourceDirectory replaced with ResourceFS fs.FS. ChartManager.UpgradeOrInstallChart signature changed to accept fs.FS. Signed-off-by: Aslak Knutsen <aslak@4fs.no>
Provide an embed.FS in the resources package so downstream consumers
can bundle Helm charts and profiles directly in their binary instead
of relying on filesystem paths.
The Sail Operator itself does not import this package, keeping its
binary size unchanged. This is intended for library consumers who
want self-contained binaries with embedded resources.
Usage:
import "github.com/istio-ecosystem/sail-operator/resources"
cfg := config.ReconcilerConfig{ResourceFS: resources.FS}
Signed-off-by: Aslak Knutsen <aslak@4fs.no>
Add embedded fs.FS from the resources package and use it as the default resource source. The operator now embeds all Helm charts and profiles directly in the binary, eliminating the need for external resource files. Changes: - Change --resource-directory default from /var/lib/sail-operator/resources to "" - When --resource-directory is empty (default), use embedded resources.FS - When --resource-directory is specified, use os.DirFS for filesystem access - Removed --resource-directory from Makefile - Removed --resource-directory from Dockerfile This increases binary size by ~10MB but simplifies deployment by removing the dependency on external resource files mounted into the container. Signed-off-by: Aslak Knutsen <aslak@4fs.no>
f919825 to
6f8f882
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-1.28 #1594 +/- ##
================================================
+ Coverage 71.22% 80.63% +9.41%
================================================
Files 39 46 +7
Lines 2040 2345 +305
================================================
+ Hits 1453 1891 +438
+ Misses 424 337 -87
+ Partials 163 117 -46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
/hold actually this includes bigger changes (e.g. changing the default to embedded) that we probably don't want |
Collaborator
|
/retest |
openshift-service-mesh-bot
pushed a commit
to openshift-service-mesh-bot/sail-operator
that referenced
this pull request
Mar 18, 2026
* upstream/release-1.28: [release-1.28] Migrate to fs.FS as the sole resource loading interface (istio-ecosystem#1594) Adding FIPS_CLUSTER variable to E2E test (istio-ecosystem#1698) (istio-ecosystem#1704)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #1561