forked from rook/rook
Merge pull request #2218 from anguslees/fmtfix
Don't misinterpret command output as string format
This commit is contained in:
@@ -208,7 +208,7 @@ func (a *OsdAgent) removeDevices(context *clusterd.Context, removedDevicesScheme
|
||||
|
||||
if len(errorMessages) > 0 {
|
||||
// at least one OSD failed, return an overall error
|
||||
return fmt.Errorf(strings.Join(errorMessages, "\n"))
|
||||
return fmt.Errorf("%s", strings.Join(errorMessages, "\n"))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -192,7 +192,7 @@ func (a *Agent) discoverFlexvolumeDir() (flexvolumeDirPath, source string) {
|
||||
// determining where the path of the flexvolume dir on the node
|
||||
nodeConfigURI, err := k8sutil.NodeConfigURI()
|
||||
if err != nil {
|
||||
logger.Warningf(err.Error())
|
||||
logger.Warning(err.Error())
|
||||
return getDefaultFlexvolumeDir()
|
||||
}
|
||||
nodeConfig, err := a.clientset.CoreV1().RESTClient().Get().RequestURI(nodeConfigURI).DoRaw()
|
||||
|
||||
@@ -98,11 +98,11 @@ func startRGWPods(context *clusterd.Context, store cephv1beta1.ObjectStore, vers
|
||||
if update {
|
||||
err := k8sutil.DeleteDeployment(context.Clientset, store.Namespace, instanceName(store))
|
||||
if err != nil {
|
||||
logger.Warningf(err.Error())
|
||||
logger.Warning(err.Error())
|
||||
}
|
||||
err = k8sutil.DeleteDaemonset(context.Clientset, store.Namespace, instanceName(store))
|
||||
if err != nil {
|
||||
logger.Warningf(err.Error())
|
||||
logger.Warning(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,11 +157,11 @@ func DeleteStore(context *clusterd.Context, store cephv1beta1.ObjectStore) error
|
||||
// Make a best effort to delete the rgw pods
|
||||
err = k8sutil.DeleteDeployment(context.Clientset, store.Namespace, instanceName(store))
|
||||
if err != nil {
|
||||
logger.Warningf(err.Error())
|
||||
logger.Warning(err.Error())
|
||||
}
|
||||
err = k8sutil.DeleteDaemonset(context.Clientset, store.Namespace, instanceName(store))
|
||||
if err != nil {
|
||||
logger.Warningf(err.Error())
|
||||
logger.Warning(err.Error())
|
||||
}
|
||||
|
||||
// Delete the rgw keyring
|
||||
|
||||
@@ -154,7 +154,7 @@ func (*CommandExecutor) ExecuteCommandWithOutputFile(debug bool, actionName stri
|
||||
cmdOut, err := cmd.CombinedOutput()
|
||||
// if there was anything that went to stdout/stderr then log it, even before we return an error
|
||||
if string(cmdOut) != "" {
|
||||
logger.Infof(string(cmdOut))
|
||||
logger.Info(string(cmdOut))
|
||||
}
|
||||
if err != nil {
|
||||
return string(cmdOut), err
|
||||
@@ -203,7 +203,7 @@ func logOutput(name string, stdout, stderr io.ReadCloser) {
|
||||
lastLine := ""
|
||||
for in.Scan() {
|
||||
lastLine = in.Text()
|
||||
childLogger.Infof(lastLine)
|
||||
childLogger.Info(lastLine)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user