Avoid unnecessary shell execution in secretFactory.

This commit is contained in:
Jeffrey Regan
2018-12-17 10:59:27 -08:00
parent 29694e5b6a
commit d4ba22191a
2 changed files with 17 additions and 20 deletions

View File

@@ -17,7 +17,6 @@ limitations under the License.
package configmapandsecret
import (
"strings"
"testing"
"sigs.k8s.io/kustomize/pkg/fs"
@@ -55,11 +54,8 @@ func TestMakeSecretNoCommandsBadDir(t *testing.T) {
EnvCommand: "",
}}
_, err := factory.MakeSecret(&args, nil)
if err == nil {
t.Fatalf("expected error: %v", err)
}
if !strings.Contains(err.Error(), "not a directory") {
t.Fatalf("unexpected error: %v", err)
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
}