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
00144659
Commit
00144659
authored
Jan 22, 2016
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix nil pointer in addons test
parent
3a15a374
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
addon_update.go
test/e2e/addon_update.go
+11
-10
No files found.
test/e2e/addon_update.go
View file @
00144659
...
@@ -399,16 +399,17 @@ func writeRemoteFile(sshClient *ssh.Client, data, dir, fileName string, mode os.
...
@@ -399,16 +399,17 @@ func writeRemoteFile(sshClient *ssh.Client, data, dir, fileName string, mode os.
defer
session
.
Close
()
defer
session
.
Close
()
fileSize
:=
len
(
data
)
fileSize
:=
len
(
data
)
go
func
()
{
pipe
,
err
:=
session
.
StdinPipe
()
// ignore errors here. scp whould return errors if something goes wrong.
if
err
!=
nil
{
pipe
,
_
:=
session
.
StdinPipe
()
return
err
defer
pipe
.
Close
()
}
fmt
.
Fprintf
(
pipe
,
"C%#o %d %s
\n
"
,
mode
,
fileSize
,
fileName
)
defer
pipe
.
Close
()
io
.
Copy
(
pipe
,
strings
.
NewReader
(
data
))
if
err
:=
session
.
Start
(
fmt
.
Sprintf
(
"scp -t %s"
,
dir
));
err
!=
nil
{
fmt
.
Fprint
(
pipe
,
"
\x00
"
)
}()
if
err
:=
session
.
Run
(
fmt
.
Sprintf
(
"scp -t %s"
,
dir
));
err
!=
nil
{
return
err
return
err
}
}
return
nil
fmt
.
Fprintf
(
pipe
,
"C%#o %d %s
\n
"
,
mode
,
fileSize
,
fileName
)
io
.
Copy
(
pipe
,
strings
.
NewReader
(
data
))
fmt
.
Fprint
(
pipe
,
"
\x00
"
)
pipe
.
Close
()
return
session
.
Wait
()
}
}
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