Skip to content

Commit

Permalink
Merge pull request kubernetes#46281 from zjj2wry/err
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

add error info

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue authored May 30, 2017
2 parents 61693bf + 586ebdb commit 69c4a8f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
7 changes: 5 additions & 2 deletions pkg/kubectl/cmd/config/current_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ func TestCurrentContextWithUnsetContext(t *testing.T) {
}

func (test currentContextTest) run(t *testing.T) {
fakeKubeFile, _ := ioutil.TempFile("", "")
fakeKubeFile, err := ioutil.TempFile("", "")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
defer os.Remove(fakeKubeFile.Name())
err := clientcmd.WriteToFile(test.startingConfig, fakeKubeFile.Name())
err = clientcmd.WriteToFile(test.startingConfig, fakeKubeFile.Name())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/kubectl/cmd/config/delete_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ func TestDeleteCluster(t *testing.T) {
}

func (test deleteClusterTest) run(t *testing.T) {
fakeKubeFile, _ := ioutil.TempFile("", "")
fakeKubeFile, err := ioutil.TempFile("", "")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
defer os.Remove(fakeKubeFile.Name())
err := clientcmd.WriteToFile(test.config, fakeKubeFile.Name())
err = clientcmd.WriteToFile(test.config, fakeKubeFile.Name())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/kubectl/cmd/config/delete_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ func TestDeleteContext(t *testing.T) {
}

func (test deleteContextTest) run(t *testing.T) {
fakeKubeFile, _ := ioutil.TempFile("", "")
fakeKubeFile, err := ioutil.TempFile("", "")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
defer os.Remove(fakeKubeFile.Name())
err := clientcmd.WriteToFile(test.config, fakeKubeFile.Name())
err = clientcmd.WriteToFile(test.config, fakeKubeFile.Name())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/kubectl/cmd/config/get_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ func TestGetClustersEmpty(t *testing.T) {
}

func (test getClustersTest) run(t *testing.T) {
fakeKubeFile, _ := ioutil.TempFile("", "")
fakeKubeFile, err := ioutil.TempFile("", "")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
defer os.Remove(fakeKubeFile.Name())
err := clientcmd.WriteToFile(test.config, fakeKubeFile.Name())
err = clientcmd.WriteToFile(test.config, fakeKubeFile.Name())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/kubectl/cmd/config/get_contexts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ func TestGetContextsSelectOneOfTwo(t *testing.T) {
}

func (test getContextsTest) run(t *testing.T) {
fakeKubeFile, _ := ioutil.TempFile("", "")
fakeKubeFile, err := ioutil.TempFile("", "")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
defer os.Remove(fakeKubeFile.Name())
err := clientcmd.WriteToFile(test.startingConfig, fakeKubeFile.Name())
err = clientcmd.WriteToFile(test.startingConfig, fakeKubeFile.Name())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down

0 comments on commit 69c4a8f

Please sign in to comment.