From 8259e188d7e040f5b52362a489c3714d88155630 Mon Sep 17 00:00:00 2001 From: Bartosz Majsak Date: Tue, 9 Jul 2024 15:12:21 +0200 Subject: [PATCH] chore(feature): removes unused tmpl func (#1105) ReplaceChar is not used anywhere in the templates, so there is no point in keeping it around. Most likely spill over from infamous #605. (cherry picked from commit 0c363cfbf550486d52b8bce74dcbe665b3f8cecb) --- pkg/feature/manifest.go | 1 - pkg/feature/types.go | 6 ------ 2 files changed, 7 deletions(-) diff --git a/pkg/feature/manifest.go b/pkg/feature/manifest.go index 2cf994e3a5a..89b270675e5 100644 --- a/pkg/feature/manifest.go +++ b/pkg/feature/manifest.go @@ -82,7 +82,6 @@ func (t *templateManifest) Process(data any) ([]*unstructured.Unstructured, erro tmpl, parseErr := template.New(t.name). Option("missingkey=error"). - Funcs(template.FuncMap{"ReplaceChar": ReplaceChar}). Parse(string(content)) if parseErr != nil { return nil, fmt.Errorf("failed to parse template %s: %w", t.path, parseErr) diff --git a/pkg/feature/types.go b/pkg/feature/types.go index e5c04270e72..c84c71c8c2c 100644 --- a/pkg/feature/types.go +++ b/pkg/feature/types.go @@ -1,8 +1,6 @@ package feature import ( - "strings" - featurev1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/features/v1" infrav1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/infrastructure/v1" ) @@ -28,7 +26,3 @@ type OAuth struct { ClientSecret, Hmac string } - -func ReplaceChar(s string, oldChar, newChar string) string { - return strings.ReplaceAll(s, oldChar, newChar) -}