Skip to content

Commit

Permalink
Otel collector: fix lost config on update
Browse files Browse the repository at this point in the history
The global settings of the config domain
(which is empty for otel -- there are no
options) was mixed up with the configuration
of the collectors running on various sites.

This resulted in all collector configs being
lost upon upgrade.

CMK-21081

Change-Id: If3484283876b3862aa88b8c463b5ba14a153d553
  • Loading branch information
mo-ki committed Jan 15, 2025
1 parent 3d78e9d commit 1de96ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions tests/unit/cmk/gui/watolib/test_activate_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,7 @@ def _expected_replication_paths(edition: cmk_version.Edition) -> list[Replicatio
ReplicationPath("dir", "dcd", "etc/check_mk/dcd.d/wato/", []),
ReplicationPath("dir", "mknotify", "etc/check_mk/mknotifyd.d/wato", []),
# CMK-20769
ReplicationPath(
ty="file",
ident="otel_collector",
site_path="etc/check_mk/otel_collector.d/wato/otel_collector.mk",
excludes=[],
),
ReplicationPath("dir", "otel_collector", "etc/check_mk/otel_collector.d/wato", []),
]

expected += [
Expand Down Expand Up @@ -189,12 +184,7 @@ def _expected_replication_paths(edition: cmk_version.Edition) -> list[Replicatio
ReplicationPath("dir", "mknotify", "etc/check_mk/mknotifyd.d/wato", []),
ReplicationPath("dir", "liveproxyd", "etc/check_mk/liveproxyd.d/wato/", []),
# CMK-20769
ReplicationPath(
ty="file",
ident="otel_collector",
site_path="etc/check_mk/otel_collector.d/wato/otel_collector.mk",
excludes=[],
),
ReplicationPath("dir", "otel_collector", "etc/check_mk/otel_collector.d/wato/", []),
]

if is_managed_repo() and edition is not cmk_version.Edition.CME:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cmk/gui/watolib/test_config_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def _get_expected_paths(
expected_paths += [
"etc/check_mk/otel_collector.d",
"etc/check_mk/otel_collector.d/wato",
"etc/check_mk/otel_collector.d/wato/otel_collector.mk",
"etc/check_mk/otel_collector.d/wato/sitespecific.mk",
]

return expected_paths
Expand Down

0 comments on commit 1de96ca

Please sign in to comment.