Less warnings, consistent info messages

pull/3679/head
Thomas Stromberg 2019-02-15 09:11:46 -08:00
parent cd156b3f98
commit f345fe4b08
2 changed files with 3 additions and 4 deletions

View File

@ -43,18 +43,18 @@ func listCRIContainers(cr CommandRunner, filter string) ([]string, error) {
// criCRIContainers kills a list of containers using crictl // criCRIContainers kills a list of containers using crictl
func killCRIContainers(cr CommandRunner, ids []string) error { func killCRIContainers(cr CommandRunner, ids []string) error {
if len(ids) == 0 { if len(ids) == 0 {
glog.Warningf("KillContainers was called with an empty list of ids, nothing to do.")
return nil return nil
} }
glog.Infof("Killing containers: %s", ids)
return cr.Run(fmt.Sprintf("sudo crictl rm %s", strings.Join(ids, " "))) return cr.Run(fmt.Sprintf("sudo crictl rm %s", strings.Join(ids, " ")))
} }
// stopCRIContainers stops containers using crictl // stopCRIContainers stops containers using crictl
func stopCRIContainers(cr CommandRunner, ids []string) error { func stopCRIContainers(cr CommandRunner, ids []string) error {
if len(ids) == 0 { if len(ids) == 0 {
glog.Warningf("StopContainers was called with an empty list of ids, nothing to do.")
return nil return nil
} }
glog.Infof("Stopping containers: %s", ids)
return cr.Run(fmt.Sprintf("sudo crictl stop %s", strings.Join(ids, " "))) return cr.Run(fmt.Sprintf("sudo crictl stop %s", strings.Join(ids, " ")))
} }

View File

@ -110,10 +110,9 @@ func (r *Docker) KillContainers(ids []string) error {
// StopContainers stops a running container based on ID // StopContainers stops a running container based on ID
func (r *Docker) StopContainers(ids []string) error { func (r *Docker) StopContainers(ids []string) error {
if len(ids) == 0 { if len(ids) == 0 {
glog.Warningf("StopContainers was called with an empty list of ids, nothing to do.")
return nil return nil
} }
glog.Infof("Killing containers: %s", ids) glog.Infof("Stopping containers: %s", ids)
return r.Runner.Run(fmt.Sprintf("docker stop %s", strings.Join(ids, " "))) return r.Runner.Run(fmt.Sprintf("docker stop %s", strings.Join(ids, " ")))
} }