Skip to content

Commit

Permalink
Fake k8s context for test
Browse files Browse the repository at this point in the history
Fixes #1787

Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot committed Mar 13, 2019
1 parent 4aae6af commit 1439ba5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/skaffold/build/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/GoogleContainerTools/skaffold/testutil"
"github.com/docker/docker/api/types"
yaml "gopkg.in/yaml.v2"
"k8s.io/client-go/tools/clientcmd/api"
)

var (
Expand Down Expand Up @@ -122,6 +123,8 @@ func Test_NewCache(t *testing.T) {

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
restore := testutil.SetupFakeKubernetesContext(t, api.Config{CurrentContext: "cluster1"})
defer restore()

cacheFile := createTempCacheFile(t, test.cacheFileContents)
if test.updateCacheFile {
Expand Down

0 comments on commit 1439ba5

Please sign in to comment.