You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor Otel Collector Googlecloud ConfigMap Generation to Use Go Struct and YAML Marshaling
Refactor the generation of the otel-collector Googlecloud ConfigMap to construct the configuration using a Go map and marshal it to YAML, replacing the previous approach of using a static YAML string. This change improves maintainability and reduces the risk of formatting errors in the generated config.
Add GooglecloudCollectorConfigYAML() in pkg/metrics/otel.go to build the config as a Go map and marshal it to YAML.
Update OtelReconciler in pkg/reconcilermanager/controllers/otel_controller.go to use the new function when creating/updating the ConfigMap.
Update related tests to use the new function for expected config values.
Deprecate the old CollectorConfigGooglecloud string constant.
This refactor makes the config generation more robust and easier to extend or validate in the future.
0 commit comments