Skip to content

Commit

Permalink
fix(fleet): Ignore public.ecr.aws overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptisteFoy committed Nov 6, 2024
1 parent eb4fbb5 commit 2fb61d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/fleet/internal/oci/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ var (
defaultRegistriesProd = []string{
"install.datadoghq.com",
"gcr.io/datadoghq",
"public.ecr.aws/datadog",
"docker.io/datadog",
}
)
Expand Down Expand Up @@ -210,7 +209,8 @@ func getRefAndKeychain(env *env.Env, url string) urlWithKeychain {
}
}
ref := url
if registryOverride != "" {
// public.ecr.aws/datadog is ignored for now as there are issues with it
if registryOverride != "" && registryOverride != "public.ecr.aws/datadog" {
if !strings.HasSuffix(registryOverride, "/") {
registryOverride += "/"
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/fleet/internal/oci/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ func TestGetRefAndKeychains(t *testing.T) {
expectedRefAndKeychains: []urlWithKeychain{
{ref: "install.datadoghq.com/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "gcr.io/datadoghq/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "public.ecr.aws/datadog/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "docker.io/datadog/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
},
},
Expand All @@ -291,7 +290,6 @@ func TestGetRefAndKeychains(t *testing.T) {
{ref: "mysuperregistry.tv/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "install.datadoghq.com/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "gcr.io/datadoghq/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "public.ecr.aws/datadog/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "docker.io/datadog/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
},
},
Expand All @@ -305,7 +303,6 @@ func TestGetRefAndKeychains(t *testing.T) {
{ref: "mysuperregistry.tv/agent-package@sha256:1234", keychain: google.Keychain},
{ref: "install.datadoghq.com/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "gcr.io/datadoghq/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "public.ecr.aws/datadog/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
{ref: "docker.io/datadog/agent-package@sha256:1234", keychain: authn.DefaultKeychain},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (s *testAgentUpgradeSuite) TestDowngradeAgentPackage() {

// Act
_, err = s.Installer().InstallExperiment(installerwindows.AgentPackage,
installer.WithRegistry("public.ecr.aws/datadog"),
installer.WithRegistry("install.datadoghq.com"),
installer.WithVersion(s.StableAgentVersion().PackageVersion()),
installer.WithAuthentication(""),
)
Expand All @@ -69,7 +69,7 @@ func (s *testAgentUpgradeSuite) TestExperimentFailure() {

// Act
_, err := s.Installer().InstallExperiment(installerwindows.AgentPackage,
installer.WithRegistry("public.ecr.aws/datadog"),
installer.WithRegistry("install.datadoghq.com"),
installer.WithVersion("unknown-version"),
installer.WithAuthentication(""),
)
Expand All @@ -88,7 +88,7 @@ func (s *testAgentUpgradeSuite) TestExperimentCurrentVersion() {

// Act
_, err := s.Installer().InstallExperiment(installerwindows.AgentPackage,
installer.WithRegistry("public.ecr.aws/datadog"),
installer.WithRegistry("install.datadoghq.com"),
installer.WithVersion(s.StableAgentVersion().PackageVersion()),
installer.WithAuthentication(""),
)
Expand Down Expand Up @@ -121,7 +121,7 @@ func (s *testAgentUpgradeSuite) installStableAgent() {

// Act
output, err := s.Installer().InstallPackage(installerwindows.AgentPackage,
installer.WithRegistry("public.ecr.aws/datadog"),
installer.WithRegistry("install.datadoghq.com"),
installer.WithVersion(s.StableAgentVersion().PackageVersion()),
installer.WithAuthentication(""),
)
Expand Down

0 comments on commit 2fb61d7

Please sign in to comment.