Skip to content

Commit 74f2583

Browse files
authored
[deployment/chef] Fix custom variables handling on Windows (#6271)
* [chore][deployment/chef] Upgrade version of Collector used in testing * add debugging * Fix linting error * Use registry for custom variables on Windows * add chef release notes and upgrade release version * Remove debugging * Update deployments/chef/recipes/default.rb * Update deployments/chef/recipes/default.rb * Move changes to `0.17.0`
1 parent e26dffc commit 74f2583

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

deployments/chef/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## chef-v0.17.0
44

5+
- Bug fix: Fix bug that caused custom variables to not be set when running on Windows
6+
with a Splunk OTel Collector version >= `0.98.0`.
57
- Remove the option `with_signalfx_dotnet_auto_instrumentation` used to
68
install the deprecated `SignalFx Auto Instrumentation for .NET` on Windows.
79

deployments/chef/kitchen.windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ suites:
5555
splunk_memory_total_mib: "256"
5656
splunk_hec_token: fake-hec-token
5757
splunk_listen_interface: "0.0.0.0"
58-
collector_version: 0.48.0
58+
collector_version: 0.126.0
5959
collector_additional_env_vars:
6060
MY_CUSTOM_VAR1: value1
6161
MY_CUSTOM_VAR2: value2

deployments/chef/metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
maintainer_email '[email protected]'
44
license 'Apache-2.0'
55
description 'Install/Configure the Splunk OpenTelemetry Collector'
6-
version '0.16.0'
6+
version '0.17.0'
77
chef_version '>= 16.0'
88

99
supports 'amazon'

deployments/chef/recipes/default.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
# Older MSI versions can't properly setup the collector configuration
1616
# in this case, we need to use the registry to set the environment variables.
17-
unless node['splunk_otel_collector']['collector_msi_is_configurable']
17+
# Custom variables also require using the registry, as the MSI doesn't support it.
18+
if !node['splunk_otel_collector']['collector_msi_is_configurable'] || !node['splunk_otel_collector']['collector_additional_env_vars'].empty?
1819
include_recipe 'splunk_otel_collector::collector_win_registry'
1920
end
2021

deployments/chef/test/integration/custom_vars/test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
end
4141
collector_env_vars_strings.sort!
4242
describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\splunk-otel-collector') do
43+
it { should have_property 'Environment' }
4344
it { should have_property_value('Environment', :multi_string, collector_env_vars_strings) }
4445
end
4546
describe service('fluentdwinsvc') do

0 commit comments

Comments
 (0)