@@ -22,8 +22,6 @@ import (
22
22
"io"
23
23
"io/ioutil"
24
24
"math"
25
- "os/exec"
26
- "strings"
27
25
"sync"
28
26
"time"
29
27
@@ -53,7 +51,6 @@ import (
53
51
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/log"
54
52
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/schema/latest"
55
53
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/status"
56
- "github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util"
57
54
)
58
55
59
56
// Verifier verifies deployments using kubernetes libs/CLI.
@@ -75,15 +72,7 @@ type Verifier struct {
75
72
76
73
// NewVerifier returns a new Verifier for a VerifyConfig filled
77
74
// with the needed configuration for `kubectl apply`
78
- func NewVerifier (ctx context.Context , cfg kubectl.Config , labeller * label.DefaultLabeller , testCases []* latest.VerifyTestCase , artifacts []* latest.Artifact , envMap map [string ]string ) (* Verifier , error ) {
79
- defaultNamespace := ""
80
- b , err := (& util.Commander {}).RunCmdOut (context .Background (), exec .Command ("kubectl" , "config" , "view" , "--minify" , "-o" , "jsonpath='{..namespace}'" ))
81
- if err == nil {
82
- defaultNamespace = strings .Trim (string (b ), "'" )
83
- if defaultNamespace == "default" {
84
- defaultNamespace = ""
85
- }
86
- }
75
+ func NewVerifier (ctx context.Context , cfg kubectl.Config , labeller * label.DefaultLabeller , testCases []* latest.VerifyTestCase , artifacts []* latest.Artifact , envMap map [string ]string , defaultNamespace string ) (* Verifier , error ) {
87
76
kubectl := kubectl .NewCLI (cfg , latest.KubectlFlags {}, defaultNamespace )
88
77
// default namespace must be "default" not "" when used to create and stream logs from Job(s)
89
78
if defaultNamespace == "" {
0 commit comments