diff --git a/components/kserve/feature_resources.go b/components/kserve/feature_resources.go index c15971cc430..060973a6422 100644 --- a/components/kserve/feature_resources.go +++ b/components/kserve/feature_resources.go @@ -18,14 +18,14 @@ var Resources = struct { InstallDir string // GatewaysDir is the path to the Serving Istio gateways templates. GatewaysDir string - // Source the templates to be used - Source fs.FS + // Location specifies the file system that contains the templates to be used. + Location fs.FS // BaseDir is the path to the base of the embedded FS BaseDir string }{ ServiceMeshDir: path.Join(baseDir, "servicemesh"), InstallDir: path.Join(baseDir, "serving-install"), GatewaysDir: path.Join(baseDir, "servicemesh", "routing"), - Source: kserveEmbeddedFS, + Location: kserveEmbeddedFS, BaseDir: baseDir, } diff --git a/components/kserve/serverless_setup.go b/components/kserve/serverless_setup.go index 1078ebf2097..cc1ec4bfb7e 100644 --- a/components/kserve/serverless_setup.go +++ b/components/kserve/serverless_setup.go @@ -12,7 +12,7 @@ func (k *Kserve) configureServerlessFeatures() feature.FeaturesProvider { return func(handler *feature.FeaturesHandler) error { servingDeploymentErr := feature.CreateFeature("serverless-serving-deployment"). For(handler). - ManifestSource(Resources.Source). + ManifestsLocation(Resources.Location). Manifests( path.Join(Resources.InstallDir), ). @@ -33,7 +33,7 @@ func (k *Kserve) configureServerlessFeatures() feature.FeaturesProvider { servingNetIstioSecretFilteringErr := feature.CreateFeature("serverless-net-istio-secret-filtering"). For(handler). - ManifestSource(Resources.Source). + ManifestsLocation(Resources.Location). Manifests( path.Join(Resources.BaseDir, "serving-net-istio-secret-filtering.patch.tmpl.yaml"), ). @@ -56,7 +56,7 @@ func (k *Kserve) configureServerlessFeatures() feature.FeaturesProvider { serverless.ServingIngressDomain, ). WithResources(serverless.ServingCertificateResource). - ManifestSource(Resources.Source). + ManifestsLocation(Resources.Location). Manifests( path.Join(Resources.GatewaysDir), ). diff --git a/components/kserve/servicemesh_setup.go b/components/kserve/servicemesh_setup.go index 6cd09b0dfc8..4135e9ea38a 100644 --- a/components/kserve/servicemesh_setup.go +++ b/components/kserve/servicemesh_setup.go @@ -40,7 +40,7 @@ func (k *Kserve) defineServiceMeshFeatures(cli client.Client) feature.FeaturesPr if authorinoInstalled { kserveExtAuthzErr := feature.CreateFeature("kserve-external-authz"). For(handler). - ManifestSource(Resources.Source). + ManifestsLocation(Resources.Location). Manifests( path.Join(Resources.ServiceMeshDir, "activator-envoyfilter.tmpl.yaml"), path.Join(Resources.ServiceMeshDir, "envoy-oauth-temp-fix.tmpl.yaml"), @@ -59,7 +59,7 @@ func (k *Kserve) defineServiceMeshFeatures(cli client.Client) feature.FeaturesPr temporaryFixesErr := feature.CreateFeature("kserve-temporary-fixes"). For(handler). - ManifestSource(Resources.Source). + ManifestsLocation(Resources.Location). Manifests( path.Join(Resources.ServiceMeshDir, "grpc-envoyfilter-temp-fix.tmpl.yaml"), ). diff --git a/controllers/dscinitialization/feature_resources.go b/controllers/dscinitialization/feature_resources.go index ed282a2c50b..00fc32897dc 100644 --- a/controllers/dscinitialization/feature_resources.go +++ b/controllers/dscinitialization/feature_resources.go @@ -18,14 +18,14 @@ var Templates = struct { AuthorinoDir string // MetricsDir is the path to the Metrics Collection templates. MetricsDir string - // Source the templates to be used - Source fs.FS + // Location specifies the file system that contains the templates to be used. + Location fs.FS // BaseDir is the path to the base of the embedded FS BaseDir string }{ ServiceMeshDir: path.Join(baseDir, "servicemesh"), AuthorinoDir: path.Join(baseDir, "authorino"), MetricsDir: path.Join(baseDir, "metrics-collection"), - Source: dsciEmbeddedFS, + Location: dsciEmbeddedFS, BaseDir: baseDir, } diff --git a/controllers/dscinitialization/servicemesh_setup.go b/controllers/dscinitialization/servicemesh_setup.go index 5dedee1a285..d0e74e8b0a9 100644 --- a/controllers/dscinitialization/servicemesh_setup.go +++ b/controllers/dscinitialization/servicemesh_setup.go @@ -118,7 +118,7 @@ func (r *DSCInitializationReconciler) serviceMeshCapabilityFeatures(instance *ds serviceMeshSpec := instance.Spec.ServiceMesh smcpCreationErr := feature.CreateFeature("mesh-control-plane-creation"). For(handler). - ManifestSource(Templates.Source). + ManifestsLocation(Templates.Location). Manifests( path.Join(Templates.ServiceMeshDir), ). @@ -141,7 +141,7 @@ func (r *DSCInitializationReconciler) serviceMeshCapabilityFeatures(instance *ds PreConditions( servicemesh.EnsureServiceMeshInstalled, ). - ManifestSource(Templates.Source). + ManifestsLocation(Templates.Location). Manifests( path.Join(Templates.MetricsDir), ). @@ -169,7 +169,7 @@ func (r *DSCInitializationReconciler) authorizationFeatures(instance *dsciv1.DSC extAuthzErr := feature.CreateFeature("mesh-control-plane-external-authz"). For(handler). - ManifestSource(Templates.Source). + ManifestsLocation(Templates.Location). Manifests( path.Join(Templates.AuthorinoDir, "auth-smm.tmpl.yaml"), path.Join(Templates.AuthorinoDir, "base"), diff --git a/pkg/feature/builder.go b/pkg/feature/builder.go index eb54333a624..3d593e398ef 100644 --- a/pkg/feature/builder.go +++ b/pkg/feature/builder.go @@ -65,13 +65,13 @@ func (u *usingFeaturesHandler) For(featuresHandler *FeaturesHandler) *featureBui return fb } -// Used to enforce that Manifests() is called after ManifestSource() in the chain. +// Used to enforce that Manifests() is called after ManifestsLocation() in the chain. type featureBuilderWithManifestSource struct { *featureBuilder } -// ManifestSource sets the root file system (fsys) from which manifest paths are loaded. -func (fb *featureBuilder) ManifestSource(fsys fs.FS) *featureBuilderWithManifestSource { +// ManifestsLocation sets the root file system (fsys) from which manifest paths are loaded. +func (fb *featureBuilder) ManifestsLocation(fsys fs.FS) *featureBuilderWithManifestSource { fb.fsys = fsys return &featureBuilderWithManifestSource{featureBuilder: fb} } diff --git a/tests/integration/features/manifests_int_test.go b/tests/integration/features/manifests_int_test.go index 2f3059644a6..4b148c27d25 100644 --- a/tests/integration/features/manifests_int_test.go +++ b/tests/integration/features/manifests_int_test.go @@ -47,7 +47,7 @@ var _ = Describe("Manifest sources", func() { createNamespaceErr := feature.CreateFeature("create-namespace"). For(handler). UsingConfig(envTest.Config). - ManifestSource(fixtures.TestEmbeddedFiles). + ManifestsLocation(fixtures.TestEmbeddedFiles). Manifests(path.Join(fixtures.BaseDir, "namespace.yaml")). Load() @@ -72,7 +72,7 @@ var _ = Describe("Manifest sources", func() { createServiceErr := feature.CreateFeature("create-local-gw-svc"). For(handler). UsingConfig(envTest.Config). - ManifestSource(fixtures.TestEmbeddedFiles). + ManifestsLocation(fixtures.TestEmbeddedFiles). Manifests(path.Join(fixtures.BaseDir, "local-gateway-svc.tmpl.yaml")). Load() @@ -105,7 +105,7 @@ metadata: createServiceErr := feature.CreateFeature("create-namespace"). For(handler). UsingConfig(envTest.Config). - ManifestSource(os.DirFS(tempDir)). + ManifestsLocation(os.DirFS(tempDir)). Manifests(path.Join("namespace.yaml")). // must be relative to root DirFS defined above Load() diff --git a/tests/integration/features/resources_int_test.go b/tests/integration/features/resources_int_test.go index efa50960ad8..d69bad77c7c 100644 --- a/tests/integration/features/resources_int_test.go +++ b/tests/integration/features/resources_int_test.go @@ -107,7 +107,7 @@ func createAndApplyFeature(dsci *dsciv1.DSCInitialization, managed bool, feature creator := feature.CreateFeature(featureName). For(handler). UsingConfig(envTest.Config). - ManifestSource(fixtures.TestEmbeddedFiles). + ManifestsLocation(fixtures.TestEmbeddedFiles). Manifests(path.Join(fixtures.BaseDir, yamlFile)) if managed { creator.Managed() diff --git a/tests/integration/features/servicemesh_feature_test.go b/tests/integration/features/servicemesh_feature_test.go index 4d7ce8a9dcd..fc3e95532fe 100644 --- a/tests/integration/features/servicemesh_feature_test.go +++ b/tests/integration/features/servicemesh_feature_test.go @@ -198,7 +198,7 @@ var _ = Describe("Service Mesh setup", func() { handler := feature.ClusterFeaturesHandler(dsci, func(handler *feature.FeaturesHandler) error { return feature.CreateFeature("control-plane-with-external-authz-provider"). For(handler). - ManifestSource(fixtures.TestEmbeddedFiles). + ManifestsLocation(fixtures.TestEmbeddedFiles). Manifests(path.Join("templates", "mesh-authz-ext-provider.patch.tmpl.yaml")). OnDelete( servicemesh.RemoveExtensionProvider,