Replace os.Stat with IsDir, simplifying FS abstraction.

This commit is contained in:
Jeffrey Regan
2018-07-18 11:33:30 -07:00
parent 8fda0f87ab
commit 9432671887
15 changed files with 83 additions and 69 deletions

View File

@@ -18,11 +18,12 @@ package resmap
import (
"context"
"os"
"os/exec"
"path/filepath"
"time"
"os"
"github.com/kubernetes-sigs/kustomize/pkg/resource"
"github.com/kubernetes-sigs/kustomize/pkg/types"
"github.com/pkg/errors"
@@ -62,6 +63,7 @@ func makeSecret(p string, sArgs types.SecretArgs) (*corev1.Secret, error) {
return s, nil
}
// Run a command, return its output as the secret.
func createSecretKey(wd string, command string) ([]byte, error) {
fi, err := os.Stat(wd)
if err != nil || !fi.IsDir() {