mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 09:51:23 +00:00
Merge pull request #3963 from natasha41575/KustomizeEditFix
small `api` changes for kustomize fix
This commit is contained in:
@@ -349,6 +349,29 @@ func (n *fsNode) IsDir(path string) bool {
|
||||
return result.isNodeADir()
|
||||
}
|
||||
|
||||
// ReadDir implements FileSystem.
|
||||
func (n *fsNode) ReadDir(path string) ([]string, error) {
|
||||
if !n.IsDir(path) {
|
||||
return nil, fmt.Errorf("%s is not a directory", path)
|
||||
}
|
||||
|
||||
dir, err := n.Find(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if dir == nil {
|
||||
return nil, fmt.Errorf("could not find directory %s", path)
|
||||
}
|
||||
|
||||
keys := make([]string, len(dir.dir))
|
||||
i := 0
|
||||
for k := range dir.dir {
|
||||
keys[i] = k
|
||||
i++
|
||||
}
|
||||
return keys, nil
|
||||
}
|
||||
|
||||
// Size returns the size of the node.
|
||||
func (n *fsNode) Size() int64 {
|
||||
if n.isNodeADir() {
|
||||
|
||||
Reference in New Issue
Block a user