Skip to content

Commit

Permalink
[agent6-docker] Cleaned code
Browse files Browse the repository at this point in the history
  • Loading branch information
CelianR committed Feb 13, 2025
1 parent c00b936 commit da987d8
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions components/datadog/agent/docker_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package agent

import (
"fmt"
"os"

"github.com/DataDog/test-infra-definitions/common/config"
"github.com/DataDog/test-infra-definitions/common/utils"
Expand Down Expand Up @@ -128,14 +127,7 @@ func dockerClusterAgentFullImagePath(e config.Env, repositoryPath string) string
func dockerAgentImageTag(e config.Env, semverVersion func(config.Env) (*semver.Version, error)) string {
// default tag
var agentImageTag string

fmt.Printf("Major version: %s\n", e.MajorVersion())
fmt.Printf("IS_AGENT_6: %s\n", os.Getenv("IS_AGENT_6"))
fmt.Printf("DD_AGENT_MAJOR_VERSION: %s\n", os.Getenv("DD_AGENT_MAJOR_VERSION"))

// agentImageTag = defaultAgent6ImageTag
// TODO A: don't use os.Getenv but e.MajorVersion()
if e.MajorVersion() == "6" || os.Getenv("DD_AGENT_MAJOR_VERSION") == "6" || os.Getenv("IS_AGENT_6") == "true" {
if e.MajorVersion() == "6" {
agentImageTag = defaultAgent6ImageTag
} else {
agentImageTag = defaultAgentImageTag
Expand All @@ -149,7 +141,5 @@ func dockerAgentImageTag(e config.Env, semverVersion func(config.Env) (*semver.V
e.Ctx().Log.Debug("Unable to parse agent version, using latest", nil)
}

fmt.Printf("Agent image tag: %s\n", agentImageTag)

return agentImageTag
}

0 comments on commit da987d8

Please sign in to comment.