mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Delete some unnecessary parameter passing.
This commit is contained in:
@@ -19,9 +19,8 @@ package fs
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
||||
"sigs.k8s.io/kustomize/pkg/constants"
|
||||
"sort"
|
||||
)
|
||||
|
||||
var _ FileSystem = &FakeFS{}
|
||||
@@ -54,13 +53,6 @@ configMapGenerator: []
|
||||
secretGenerator: []
|
||||
`
|
||||
|
||||
// WriteTestKustomization writes a standard test file.
|
||||
func (fs *FakeFS) WriteTestKustomization() {
|
||||
fs.WriteFile(
|
||||
constants.KustomizationFileName,
|
||||
[]byte(kustomizationContent))
|
||||
}
|
||||
|
||||
// Create assures a fake file appears in the in-memory file system.
|
||||
func (fs *FakeFS) Create(name string) (File, error) {
|
||||
f := &FakeFile{}
|
||||
@@ -123,6 +115,10 @@ func (fs *FakeFS) ReadFile(name string) ([]byte, error) {
|
||||
return nil, fmt.Errorf("cannot read file %q", name)
|
||||
}
|
||||
|
||||
func (fs *FakeFS) ReadTestKustomization() ([]byte, error) {
|
||||
return fs.ReadFile(constants.KustomizationFileName)
|
||||
}
|
||||
|
||||
// WriteFile always succeeds and does nothing.
|
||||
func (fs *FakeFS) WriteFile(name string, c []byte) error {
|
||||
ff := &FakeFile{}
|
||||
@@ -131,6 +127,16 @@ func (fs *FakeFS) WriteFile(name string, c []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// WriteTestKustomization writes a standard test file.
|
||||
func (fs *FakeFS) WriteTestKustomization() {
|
||||
fs.WriteTestKustomizationWith([]byte(kustomizationContent))
|
||||
}
|
||||
|
||||
// WriteTestKustomizationWith writes a standard test file.
|
||||
func (fs *FakeFS) WriteTestKustomizationWith(bytes []byte) {
|
||||
fs.WriteFile(constants.KustomizationFileName, bytes)
|
||||
}
|
||||
|
||||
func (fs *FakeFS) pathMatch(path, pattern string) bool {
|
||||
match, _ := filepath.Match(pattern, path)
|
||||
return match
|
||||
|
||||
Reference in New Issue
Block a user