diff --git a/pkg/document/plugin/templater/extlib/fs.go b/pkg/document/plugin/templater/extlib/fs.go deleted file mode 100644 index e727c18e0..000000000 --- a/pkg/document/plugin/templater/extlib/fs.go +++ /dev/null @@ -1,24 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package extlib - -import ( - "opendev.org/airship/airshipctl/pkg/fs" -) - -func fileExists(path string) bool { - docfs := fs.NewDocumentFs() - return docfs.Exists(path) -} diff --git a/pkg/document/plugin/templater/extlib/fs_test.go b/pkg/document/plugin/templater/extlib/fs_test.go deleted file mode 100644 index 55c76b72a..000000000 --- a/pkg/document/plugin/templater/extlib/fs_test.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package extlib - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestFileExists(t *testing.T) { - assert.Equal(t, true, fileExists("fs_test.go")) - assert.Equal(t, false, fileExists("fs_test_nonexistent.go")) -} diff --git a/pkg/document/plugin/templater/extlib/funcmap.go b/pkg/document/plugin/templater/extlib/funcmap.go index 2de52ebea..c6b5d1474 100644 --- a/pkg/document/plugin/templater/extlib/funcmap.go +++ b/pkg/document/plugin/templater/extlib/funcmap.go @@ -32,7 +32,6 @@ var genericMap = map[string]interface{}{ "genCAWithKeyEx": generateCertificateAuthorityWithPEMKeyEx, "genSignedCertEx": generateSignedCertificateEx, "genSignedCertWithKeyEx": generateSignedCertificateWithPEMKeyEx, - "fileExists": fileExists, "regexGen": regexGen, "toYaml": toYaml, "toUint32": toUint32, diff --git a/pkg/document/plugin/templater/templater_test.go b/pkg/document/plugin/templater/templater_test.go index f8b478f4c..c19ec5c68 100644 --- a/pkg/document/plugin/templater/templater_test.go +++ b/pkg/document/plugin/templater/templater_test.go @@ -186,20 +186,6 @@ template: | "at : error calling " + "regexGen: error parsing regexp: missing closing ]: `[a-z`", }, - { - cfg: ` -apiVersion: airshipit.org/v1alpha1 -kind: Templater -metadata: - name: notImportantHere -template: | - FileExists: {{ fileExists "./templater.go" }} - NoFileExists: {{ fileExists "./templater1.go" }} -`, - expectedOut: `FileExists: true -NoFileExists: false -`, - }, } for _, tc := range testCases {