ceph: enable debug logging in the osd prepare job

All processes created with the exec package will now only have debug logging
for the commands and their output. The osd prepare job relies heavily
on many of these commands so we can enable debug logging for the entire
job.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This commit is contained in:
Travis Nielsen committed 2020-03-19 07:49:54 -06:00
1 parent e8f9cfcb71
commit 4a2ca1c1ef
1 file changed
+11
+11
View File
@@ -823,6 +823,9 @@ func (c *Cluster) provisionOSDContainer(osdProps osdProperties, copyBinariesMoun
osdOnPVCMetadata := osdProps.metadataPVC.ClaimName != ""
envVars := c.getConfigEnvVars(osdProps, k8sutil.DataDir)
// enable debug logging in the prepare job
envVars = append(envVars, setDebugLogLevelEnvVar(true))
// only 1 of device list, device filter, device path filter and use all devices can be specified. We prioritize in that order.
if len(osdProps.devices) > 0 {
deviceNames := make([]string, len(osdProps.devices))
@@ -1010,6 +1013,14 @@ func pvcBackedOSDEnvVar(pvcBacked string) v1.EnvVar {
return v1.EnvVar{Name: pvcBackedOSDVarName, Value: pvcBacked}
}
func setDebugLogLevelEnvVar(debug bool) v1.EnvVar {
level := "INFO"
if debug {
level = "DEBUG"
}
return v1.EnvVar{Name: "ROOK_LOG_LEVEL", Value: level}
}
func blockPathEnvVariable(lvPath string) v1.EnvVar {
return v1.EnvVar{Name: blockPathVarName, Value: lvPath}
}