File tree 3 files changed +18
-7
lines changed
3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -87,12 +87,26 @@ test_collector_ctl_with_samecfg_restart() {
87
87
}
88
88
89
89
test_collector_ctl_with_featureflag () {
90
- # staart coll default conf by starting without -c
90
+ # start collector with default config
91
91
$ADOT_CTL -a start -f " -adot.exporter.datadogexporter.deprecation"
92
92
93
93
echo " ${FUNCNAME[0]} ... OK"
94
94
}
95
95
96
+ test_collector_ctl_with_featureflag_samecfg_restart () {
97
+ # populate default conf by starting without -c
98
+ $ADOT_CTL -a start -f " -adot.exporter.signalfx.deprecation"
99
+
100
+ # restarting with different flags and -c should start collector as expected
101
+ $ADOT_CTL -a start -c " file:/opt/aws/aws-otel-collector/etc/config.yaml" -f " -adot.exporter.datadogexporter.deprecation"
102
+ $ADOT_CTL -a status
103
+ echo " ==============================================="
104
+ echo " Contents of $ENV_FILE :"
105
+ cat " $ENV_FILE "
106
+ echo " ==============================================="
107
+ echo " ${FUNCNAME[0]} ... OK"
108
+ }
109
+
96
110
setup
97
111
98
112
# # Tests
@@ -101,3 +115,4 @@ test_collector_ctl_with_sed_special_chars
101
115
test_collector_ctl_with_samecfg
102
116
test_collector_ctl_with_samecfg_restart
103
117
test_collector_ctl_with_featureflag
118
+ test_collector_ctl_with_featureflag_samecfg_restart
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ aoc_config_local_uri() {
75
75
76
76
77
77
if [ -n " $config " ] && [ -f " $config " ]; then
78
- # do not copy if the default congif directory is provided for the -f flag.
78
+ # do not copy if the default config directory is provided for the -f flag.
79
79
# copying a file to the same location produces an error.
80
80
if [ ! " $config " = " $CONFDIR /config.yaml" ]; then
81
81
cp " $config " $CONFDIR /config.yaml
@@ -91,11 +91,10 @@ aoc_config_feature_gates() {
91
91
92
92
sed -i ' /^feature_gates=.*$/d' $ENV_FILE
93
93
if [ -n " $feature_gates " ]; then
94
- echo " feature_gates=\" --feature-gates= '${feature_gates} '\" " >> $ENV_FILE
94
+ echo " feature_gates=\" --feature-gates '${feature_gates} '\" " >> $ENV_FILE
95
95
fi
96
96
}
97
97
98
-
99
98
# Used in case the collector starts for the first time without a configuration parameter
100
99
# Safe to run as this will not overwrite a file if one exists in default location already.
101
100
aoc_ensure_default_config () {
Original file line number Diff line number Diff line change @@ -89,8 +89,6 @@ Function Get-Service-Config-Uri() {
89
89
return $Matches.1
90
90
}
91
91
92
-
93
-
94
92
Function Set-Service-Config-Uri ([string ]$uri ) {
95
93
$aoc_cmd = " \"" ${AOCProgramFiles} \.aws-otel-collector.exe\"" --config=\"" ${uri} \"" "
96
94
sc.exe config " ${AOCServiceName} " binPath= " ${aoc_cmd} "
@@ -112,7 +110,6 @@ Function AOCStart() {
112
110
113
111
# Check for feature gates before configuring service
114
112
if ($FeatureGates ) {
115
- Write-Output " Applying feature gate"
116
113
if (Test-Remote - Uri $ConfigLocation ) {
117
114
Set-Service - Config- Uri- With- FeatureGates ${ConfigLocation} ${FeatureGates}
118
115
} else {
You can’t perform that action at this time.
0 commit comments