diff --git a/e2e/deployment.go b/e2e/deployment.go index 15e6ce885..12b86acda 100644 --- a/e2e/deployment.go +++ b/e2e/deployment.go @@ -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) } diff --git a/e2e/utils.go b/e2e/utils.go index 247c9b89e..9f05604f8 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -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= 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\"") }