Skip to content

Commit 2dc544e

Browse files
committed
Add mode priority order for OTel Container Insights
1 parent 2534ea1 commit 2dc544e

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

translator/translate/otel/pipeline/opentelemetry/containerinsights/common_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package containerinsights
55

66
import (
7-
"os"
87
"testing"
98

109
"github.com/stretchr/testify/assert"
@@ -72,7 +71,6 @@ func TestGetMode_EnvVarFallback(t *testing.T) {
7271
}
7372

7473
func TestGetMode_DefaultsToNode(t *testing.T) {
75-
os.Unsetenv(envCWAgentRole)
7674
cfg := confmap.NewFromStringMap(map[string]interface{}{
7775
"opentelemetry": map[string]interface{}{
7876
"collect": map[string]interface{}{
@@ -119,4 +117,4 @@ func TestLogsEnabled(t *testing.T) {
119117
assert.Equal(t, tt.want, logsEnabled(tt.cfg))
120118
})
121119
}
122-
}
120+
}

translator/translate/otel/pipeline/opentelemetry/containerinsights/translators_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package containerinsights
55

66
import (
7-
"os"
87
"testing"
98

109
"github.com/stretchr/testify/assert"
@@ -71,7 +70,6 @@ func TestNewTranslators_ModeCluster(t *testing.T) {
7170

7271
func TestNewTranslators_DefaultMode(t *testing.T) {
7372
// No mode specified, no env var - should default to node
74-
os.Unsetenv(envCWAgentRole)
7573
cfg := confmap.NewFromStringMap(map[string]interface{}{
7674
"opentelemetry": map[string]interface{}{
7775
"collect": map[string]interface{}{

0 commit comments

Comments
 (0)