Commit 3f8b03aa authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #32349 from lojies/execerrnil

Automatic merge from submit-queue when err is nil,remove it from glog err can be nil here.
parents aaae3b25 e687f58d
...@@ -118,7 +118,12 @@ func (plugin *execNetworkPlugin) Init(host network.Host, hairpinMode componentco ...@@ -118,7 +118,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()
if err != nil {
glog.V(5).Infof("Init 'exec' network plugin output: %s, %v", string(out), err) 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
} }
...@@ -142,21 +147,32 @@ func (plugin *execNetworkPlugin) validate() error { ...@@ -142,21 +147,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()
if err != nil {
glog.V(5).Infof("SetUpPod 'exec' network plugin output: %s, %v", string(out), err) 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()
if err != nil {
glog.V(5).Infof("TearDownPod 'exec' network plugin output: %s, %v", string(out), err) 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment