Skip to content

Commit d344cf2

Browse files
committed
Set install.registry.url when installing DDOT extension
1 parent 1878794 commit d344cf2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/fleet/installer/packages/otel_config_common.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
"strings"
1212

1313
"go.yaml.in/yaml/v2"
14+
15+
"github.com/DataDog/datadog-agent/pkg/fleet/installer/env"
1416
)
1517

1618
// enableOTelCollectorConfigInDatadogYAML adds otelcollector.enabled and agent_ipc defaults to the given datadog.yaml path
@@ -32,6 +34,15 @@ func enableOTelCollectorConfigInDatadogYAML(ctx HookContext, datadogYamlPath str
3234
}
3335
existing["otelcollector"] = map[string]any{"enabled": true}
3436
existing["agent_ipc"] = map[string]any{"port": 5009, "config_refresh_interval": 60}
37+
38+
_, ok := existing["installer"]
39+
registryURL := env.FromEnv().RegistryOverride
40+
if !ok && registryURL != "" {
41+
existing["installer"] = map[string]any{
42+
"registry": map[string]any{"url": registryURL},
43+
}
44+
}
45+
3546
updated, err := yaml.Marshal(existing)
3647
if err != nil {
3748
return fmt.Errorf("failed to serialize datadog.yaml: %w", err)

0 commit comments

Comments
 (0)