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

fix: default.metrics source is not imported when metrics are disabled… #2547

Merged
merged 4 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- fix(openshift): fix remote write proxy - use unprivileged NGINX [#2510][#2510]
- fix(openshift): fix remote write proxy - use unprivileged NGINX [#2510], [#2510]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't remember exactly the reason now, but I think that some check was failing

- fix: default.metrics source is not imported when metrics are disabled and traces are enabled [#2547]

[#2483]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2483
[#2512]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2512
Expand All @@ -36,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2510]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2510
[#2526]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2526
[#2544]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2544
[#2547]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2547
[#2554]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2554
[#2549]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2549
[#2572]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2572
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/sumologic/conf/setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ true # prevent to render empty if; then
terraform import sumologic_http_source.{{ template "terraform.sources.name" (dict "Name" $key "Type" $type) }} "${COLLECTOR_NAME}/{{ $source.name }}"
{{- end }}
{{- end }}
{{- else if and (eq $type "metrics") $ctx.sumologic.traces.enabled }}
{{- /*
If traces are enabled and metrics are disabled, create default metrics source anyway
*/}}
{{- if hasKey $sources "default" }}
terraform import sumologic_http_source.{{ template "terraform.sources.name" (dict "Name" "default" "Type" $type) }} "${COLLECTOR_NAME}/{{ $sources.default.name }}"
{{- end }}
{{- end }}
{{- end }}
fi
Expand Down
1 change: 1 addition & 0 deletions tests/helm/terraform/static/traces.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ data:
# Only import sources when collector exists.
if terraform import sumologic_collector.collector "${COLLECTOR_NAME}"; then
true # prevent to render empty if; then
terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)"
terraform import sumologic_http_source.default_traces_source "${COLLECTOR_NAME}/traces"
fi

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
metrics:
enabled: false
traces:
enabled: true
Loading