File tree 3 files changed +16
-0
lines changed
3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import (
30
30
"github.com/GoogleContainerTools/skaffold/testutil"
31
31
"github.com/docker/docker/api/types"
32
32
yaml "gopkg.in/yaml.v2"
33
+ "k8s.io/client-go/tools/clientcmd/api"
33
34
)
34
35
35
36
var (
@@ -122,6 +123,8 @@ func Test_NewCache(t *testing.T) {
122
123
123
124
for _ , test := range tests {
124
125
t .Run (test .name , func (t * testing.T ) {
126
+ restore := testutil .SetupFakeKubernetesContext (t , api.Config {CurrentContext : "cluster1" })
127
+ defer restore ()
125
128
126
129
cacheFile := createTempCacheFile (t , test .cacheFileContents )
127
130
if test .updateCacheFile {
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import (
28
28
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/sync"
29
29
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/watch"
30
30
"github.com/GoogleContainerTools/skaffold/testutil"
31
+ "k8s.io/client-go/tools/clientcmd/api"
31
32
)
32
33
33
34
type NoopWatcher struct {}
@@ -92,6 +93,9 @@ func discardOutput() *config.Output {
92
93
}
93
94
94
95
func TestDevFailFirstCycle (t * testing.T ) {
96
+ restore := testutil .SetupFakeKubernetesContext (t , api.Config {CurrentContext : "cluster1" })
97
+ defer restore ()
98
+
95
99
var tests = []struct {
96
100
description string
97
101
testBench * TestBench
@@ -148,6 +152,9 @@ func TestDevFailFirstCycle(t *testing.T) {
148
152
}
149
153
150
154
func TestDev (t * testing.T ) {
155
+ restore := testutil .SetupFakeKubernetesContext (t , api.Config {CurrentContext : "cluster1" })
156
+ defer restore ()
157
+
151
158
var tests = []struct {
152
159
description string
153
160
testBench * TestBench
@@ -280,6 +287,9 @@ func TestDev(t *testing.T) {
280
287
}
281
288
282
289
func TestDevSync (t * testing.T ) {
290
+ restore := testutil .SetupFakeKubernetesContext (t , api.Config {CurrentContext : "cluster1" })
291
+ defer restore ()
292
+
283
293
var tests = []struct {
284
294
description string
285
295
testBench * TestBench
Original file line number Diff line number Diff line change @@ -290,6 +290,9 @@ func TestNewForConfig(t *testing.T) {
290
290
}
291
291
292
292
func TestRun (t * testing.T ) {
293
+ restore := testutil .SetupFakeKubernetesContext (t , api.Config {CurrentContext : "cluster1" })
294
+ defer restore ()
295
+
293
296
var tests = []struct {
294
297
description string
295
298
testBench * TestBench
You can’t perform that action at this time.
0 commit comments