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
e687f58d
Commit
e687f58d
authored
Sep 09, 2016
by
lojies
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
when err is nil,remove err from glog
parent
99493570
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
exec.go
pkg/kubelet/network/exec/exec.go
+20
-4
No files found.
pkg/kubelet/network/exec/exec.go
View file @
e687f58d
...
@@ -113,7 +113,12 @@ func (plugin *execNetworkPlugin) Init(host network.Host, hairpinMode componentco
...
@@ -113,7 +113,12 @@ func (plugin *execNetworkPlugin) Init(host network.Host, hairpinMode componentco
plugin
.
host
=
host
plugin
.
host
=
host
// call the init script
// call the init script
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
initCmd
)
.
CombinedOutput
()
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
initCmd
)
.
CombinedOutput
()
glog
.
V
(
5
)
.
Infof
(
"Init 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"Init 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
}
else
{
glog
.
V
(
5
)
.
Infof
(
"Init 'exec' network plugin output: %s"
,
string
(
out
))
}
return
err
return
err
}
}
...
@@ -137,21 +142,32 @@ func (plugin *execNetworkPlugin) validate() error {
...
@@ -137,21 +142,32 @@ func (plugin *execNetworkPlugin) validate() error {
func
(
plugin
*
execNetworkPlugin
)
SetUpPod
(
namespace
string
,
name
string
,
id
kubecontainer
.
ContainerID
)
error
{
func
(
plugin
*
execNetworkPlugin
)
SetUpPod
(
namespace
string
,
name
string
,
id
kubecontainer
.
ContainerID
)
error
{
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
setUpCmd
,
namespace
,
name
,
id
.
ID
)
.
CombinedOutput
()
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
setUpCmd
,
namespace
,
name
,
id
.
ID
)
.
CombinedOutput
()
glog
.
V
(
5
)
.
Infof
(
"SetUpPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"SetUpPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
}
else
{
glog
.
V
(
5
)
.
Infof
(
"SetUpPod 'exec' network plugin output: %s"
,
string
(
out
))
}
return
err
return
err
}
}
func
(
plugin
*
execNetworkPlugin
)
TearDownPod
(
namespace
string
,
name
string
,
id
kubecontainer
.
ContainerID
)
error
{
func
(
plugin
*
execNetworkPlugin
)
TearDownPod
(
namespace
string
,
name
string
,
id
kubecontainer
.
ContainerID
)
error
{
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
tearDownCmd
,
namespace
,
name
,
id
.
ID
)
.
CombinedOutput
()
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
tearDownCmd
,
namespace
,
name
,
id
.
ID
)
.
CombinedOutput
()
glog
.
V
(
5
)
.
Infof
(
"TearDownPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"TearDownPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
}
else
{
glog
.
V
(
5
)
.
Infof
(
"TearDownPod 'exec' network plugin output: %s"
,
string
(
out
))
}
return
err
return
err
}
}
func
(
plugin
*
execNetworkPlugin
)
GetPodNetworkStatus
(
namespace
string
,
name
string
,
id
kubecontainer
.
ContainerID
)
(
*
network
.
PodNetworkStatus
,
error
)
{
func
(
plugin
*
execNetworkPlugin
)
GetPodNetworkStatus
(
namespace
string
,
name
string
,
id
kubecontainer
.
ContainerID
)
(
*
network
.
PodNetworkStatus
,
error
)
{
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
statusCmd
,
namespace
,
name
,
id
.
ID
)
.
CombinedOutput
()
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
statusCmd
,
namespace
,
name
,
id
.
ID
)
.
CombinedOutput
()
glog
.
V
(
5
)
.
Infof
(
"Status 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"Status 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
return
nil
,
err
return
nil
,
err
}
else
{
glog
.
V
(
5
)
.
Infof
(
"Status 'exec' network plugin output: %s"
,
string
(
out
))
}
}
if
string
(
out
)
==
""
{
if
string
(
out
)
==
""
{
return
nil
,
nil
return
nil
,
nil
...
...
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