Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1852846: pkg/manifests/manifests.go: Set logLevel for prometheus Operator #875

Merged
merged 1 commit into from Jul 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/manifests/manifests.go
Expand Up @@ -1842,6 +1842,7 @@ func (f *Factory) PrometheusOperatorDeployment(namespaces []string) (*appsv1.Dep
if err != nil {
return nil, err
}

if len(f.config.ClusterMonitoringConfiguration.PrometheusOperatorConfig.NodeSelector) > 0 {

d.Spec.Template.Spec.NodeSelector = f.config.ClusterMonitoringConfiguration.PrometheusOperatorConfig.NodeSelector
Expand Down Expand Up @@ -1880,6 +1881,9 @@ func (f *Factory) PrometheusOperatorDeployment(namespaces []string) (*appsv1.Dep
args[i] = PrometheusOperatorPrometheusInstanceNamespacesFlag + f.namespace
}
}
if f.config.ClusterMonitoringConfiguration.PrometheusOperatorConfig.LogLevel != "" {
args = append(args, fmt.Sprintf("--log-level=%s", f.config.ClusterMonitoringConfiguration.PrometheusOperatorConfig.LogLevel))
}
d.Spec.Template.Spec.Containers[i].Args = args
}
}
Expand All @@ -1893,6 +1897,7 @@ func (f *Factory) PrometheusOperatorUserWorkloadDeployment(denyNamespaces []stri
if err != nil {
return nil, err
}

if len(f.config.UserWorkloadConfiguration.PrometheusOperator.NodeSelector) > 0 {
d.Spec.Template.Spec.NodeSelector = f.config.UserWorkloadConfiguration.PrometheusOperator.NodeSelector
}
Expand Down Expand Up @@ -1941,10 +1946,12 @@ func (f *Factory) PrometheusOperatorUserWorkloadDeployment(denyNamespaces []stri
args[i] = PrometheusOperatorPrometheusInstanceNamespacesFlag + f.namespaceUserWorkload
}
}
if f.config.UserWorkloadConfiguration.PrometheusOperator.LogLevel != "" {
args = append(args, fmt.Sprintf("--log-level=%s", f.config.UserWorkloadConfiguration.PrometheusOperator.LogLevel))
}
d.Spec.Template.Spec.Containers[i].Args = args
}
}

d.Namespace = f.namespaceUserWorkload

return d, nil
Expand Down