Skip to content

Commit

Permalink
e2e: set log level to 5 in csi pods
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Madhu-1 committed Sep 12, 2024
1 parent cc35e91 commit 0949fa2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions e2e/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
9 changes: 9 additions & 0 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\"")
}
Expand Down

0 comments on commit 0949fa2

Please sign in to comment.