Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
78240925
Commit
78240925
authored
Feb 07, 2019
by
Manjunath A Kumatagi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ioutil.TempDir for temporary dir creating
parent
a0aa2222
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
server_test.go
cmd/kube-proxy/app/server_test.go
+7
-2
No files found.
cmd/kube-proxy/app/server_test.go
View file @
78240925
...
@@ -20,6 +20,7 @@ import (
...
@@ -20,6 +20,7 @@ import (
"fmt"
"fmt"
"io/ioutil"
"io/ioutil"
"os"
"os"
"path/filepath"
"reflect"
"reflect"
"runtime"
"runtime"
"strings"
"strings"
...
@@ -415,8 +416,12 @@ func TestProcessHostnameOverrideFlag(t *testing.T) {
...
@@ -415,8 +416,12 @@ func TestProcessHostnameOverrideFlag(t *testing.T) {
func
TestConfigChange
(
t
*
testing
.
T
)
{
func
TestConfigChange
(
t
*
testing
.
T
)
{
setUp
:=
func
()
(
*
os
.
File
,
string
,
error
)
{
setUp
:=
func
()
(
*
os
.
File
,
string
,
error
)
{
tempDir
:=
os
.
TempDir
()
tempDir
,
err
:=
ioutil
.
TempDir
(
""
,
"kubeproxy-config-change"
)
file
,
err
:=
ioutil
.
TempFile
(
tempDir
,
"kube-proxy-config-"
)
if
err
!=
nil
{
return
nil
,
""
,
fmt
.
Errorf
(
"Unable to create temporary directory: %v"
,
err
)
}
fullPath
:=
filepath
.
Join
(
tempDir
,
"kube-proxy-config"
)
file
,
err
:=
os
.
Create
(
fullPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
""
,
fmt
.
Errorf
(
"unexpected error when creating temp file: %v"
,
err
)
return
nil
,
""
,
fmt
.
Errorf
(
"unexpected error when creating temp file: %v"
,
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment