mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
e2e: set log level to 5 in csi pods
all the sidecar log level is not set to 5 by default, without debug logs we cannot understand what is wrong in the tests, this commits sets the log level to 5 for csi pods. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
c48f5bff37
commit
5c621d2e82
@ -250,6 +250,8 @@ func (yrn *yamlResourceNamespaced) Do(action kubectlAction) error {
|
||||
return fmt.Errorf("failed to read content from %q: %w", yrn.filename, err)
|
||||
}
|
||||
|
||||
data = replaceLogLevelInTemplate(data)
|
||||
|
||||
if yrn.oneReplica {
|
||||
data = oneReplicaDeployYaml(data)
|
||||
}
|
||||
|
@ -823,6 +823,15 @@ func oneReplicaDeployYaml(template string) string {
|
||||
return re.ReplaceAllString(template, `$1 1`)
|
||||
}
|
||||
|
||||
// replaceLogLevelInTemplate replaces the log level in the template file to 5.
|
||||
func replaceLogLevelInTemplate(template string) string {
|
||||
// Regular expression to find --v=<number> arguments
|
||||
re := regexp.MustCompile(`--v=\d+`)
|
||||
|
||||
// template can contain different log levels, replace it with --v=5
|
||||
return re.ReplaceAllString(template, "--v=5")
|
||||
}
|
||||
|
||||
func enableReadAffinityInTemplate(template string) string {
|
||||
return strings.ReplaceAll(template, "# - \"--enable-read-affinity=true\"", "- \"--enable-read-affinity=true\"")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user