Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(installer): use install.datadoghq.com by default #30765

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/fleet/installer/default_packages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ func TestDefaultPackagesAPMInjectEnabled(t *testing.T) {
packages := DefaultPackages(env)

assert.Equal(t, []string{
"oci://gcr.io/datadoghq/apm-inject-package:latest",
"oci://gcr.io/datadoghq/apm-library-java-package:1",
"oci://gcr.io/datadoghq/apm-library-ruby-package:2",
"oci://gcr.io/datadoghq/apm-library-js-package:5",
"oci://gcr.io/datadoghq/apm-library-dotnet-package:3",
"oci://gcr.io/datadoghq/apm-library-python-package:2",
"oci://install.datadoghq.com/apm-inject-package:latest",
"oci://install.datadoghq.com/apm-library-java-package:1",
"oci://install.datadoghq.com/apm-library-ruby-package:2",
"oci://install.datadoghq.com/apm-library-js-package:5",
"oci://install.datadoghq.com/apm-library-dotnet-package:3",
"oci://install.datadoghq.com/apm-library-python-package:2",
}, packages)
}

Expand All @@ -49,7 +49,7 @@ func TestDefaultPackagesAgentVersion(t *testing.T) {
}
packages := DefaultPackages(env)

assert.Equal(t, []string{"oci://gcr.io/datadoghq/agent-package:7.42.0-1"}, packages)
assert.Equal(t, []string{"oci://install.datadoghq.com/agent-package:7.42.0-1"}, packages)
}

func TestDefaultPackagesAgentMinorVersion(t *testing.T) {
Expand All @@ -61,7 +61,7 @@ func TestDefaultPackagesAgentMinorVersion(t *testing.T) {
}
packages := DefaultPackages(env)

assert.Equal(t, []string{"oci://gcr.io/datadoghq/agent-package:7.42.0-1"}, packages)
assert.Equal(t, []string{"oci://install.datadoghq.com/agent-package:7.42.0-1"}, packages)
}

func TestDefaultPackages(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions pkg/fleet/internal/oci/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ const (

var (
defaultRegistriesStaging = []string{
"install.datad0g.com",
"docker.io/datadog",
}
defaultRegistriesProd = []string{
"install.datadoghq.com",
"gcr.io/datadoghq",
"public.ecr.aws/datadog",
"docker.io/datadog",
Expand Down Expand Up @@ -349,9 +351,9 @@ func (d *DownloadedPackage) WriteOCILayout(dir string) error {
func PackageURL(env *env.Env, pkg string, version string) string {
switch env.Site {
case "datad0g.com":
return fmt.Sprintf("oci://docker.io/datadog/%s-package-dev:%s", strings.TrimPrefix(pkg, "datadog-"), version)
return fmt.Sprintf("oci://install.datad0g.com/%s-package-dev:%s", strings.TrimPrefix(pkg, "datadog-"), version)
default:
return fmt.Sprintf("oci://gcr.io/datadoghq/%s-package:%s", strings.TrimPrefix(pkg, "datadog-"), version)
return fmt.Sprintf("oci://install.datadoghq.com/%s-package:%s", strings.TrimPrefix(pkg, "datadog-"), version)
}
}

Expand Down
12 changes: 8 additions & 4 deletions pkg/fleet/internal/oci/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ func TestPackageURL(t *testing.T) {
}

tests := []test{
{site: "datad0g.com", pkg: "datadog-agent", version: "latest", expected: "oci://docker.io/datadog/agent-package-dev:latest"},
{site: "datadoghq.com", pkg: "datadog-agent", version: "1.2.3", expected: "oci://gcr.io/datadoghq/agent-package:1.2.3"},
{site: "datad0g.com", pkg: "datadog-agent", version: "latest", expected: "oci://install.datad0g.com/agent-package-dev:latest"},
{site: "datadoghq.com", pkg: "datadog-agent", version: "1.2.3", expected: "oci://install.datadoghq.com/agent-package:1.2.3"},
}

for _, tt := range tests {
Expand Down Expand Up @@ -266,16 +266,18 @@ func TestGetRefAndKeychains(t *testing.T) {
tests := []test{
{
name: "no override - staging",
url: "docker.io/datadog/agent-package-dev:latest",
url: "install.datad0g.com/agent-package-dev:latest",
expectedRefAndKeychains: []urlWithKeychain{
{ref: "install.datad0g.com/agent-package-dev:latest", keychain: authn.DefaultKeychain},
{ref: "docker.io/datadog/agent-package-dev:latest", keychain: authn.DefaultKeychain},
},
},
{
name: "no override - prod",
url: "gcr.io/datadoghq/agent-package@sha256:1234",
url: "install.datadoghq.com/agent-package@sha256:1234",
isProd: true,
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 @@ -287,6 +289,7 @@ func TestGetRefAndKeychains(t *testing.T) {
isProd: true,
expectedRefAndKeychains: []urlWithKeychain{
{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 @@ -300,6 +303,7 @@ func TestGetRefAndKeychains(t *testing.T) {
isProd: true,
expectedRefAndKeychains: []urlWithKeychain{
{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
10 changes: 5 additions & 5 deletions test/new-e2e/tests/installer/unix/upgrade_scenario_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ var testCatalog = catalog{
{
Package: string(datadogAgent),
Version: latestAgentImageVersion,
URL: fmt.Sprintf("oci://gcr.io/datadoghq/agent-package:%s", latestAgentImageVersion),
URL: fmt.Sprintf("oci://install.datadoghq.com/agent-package:%s", latestAgentImageVersion),
},
{
Package: string(datadogAgent),
Version: previousAgentImageVersion,
URL: fmt.Sprintf("oci://gcr.io/datadoghq/agent-package:%s", previousAgentImageVersion),
URL: fmt.Sprintf("oci://install.datadoghq.com/agent-package:%s", previousAgentImageVersion),
},
{
Package: string(datadogInstaller),
Version: latestInstallerImageVersion,
URL: fmt.Sprintf("oci://gcr.io/datadoghq/installer-package:%s", latestInstallerImageVersion),
URL: fmt.Sprintf("oci://install.datadoghq.com/installer-package:%s", latestInstallerImageVersion),
},
{
Package: string(datadogInstaller),
Version: previousInstallerImageVersion,
URL: fmt.Sprintf("oci://gcr.io/datadoghq/installer-package:%s", previousInstallerImageVersion),
URL: fmt.Sprintf("oci://install.datadoghq.com/installer-package:%s", previousInstallerImageVersion),
},
},
}
Expand Down Expand Up @@ -209,7 +209,7 @@ func (s *upgradeScenarioSuite) TestExperimentCurrentVersion() {
{
Package: "datadog-agent",
Version: currentVersion,
URL: fmt.Sprintf("oci://gcr.io/datadoghq/agent-package:%s", currentVersion),
URL: fmt.Sprintf("oci://install.datadoghq.com/agent-package:%s", currentVersion),
},
},
}
Expand Down
Loading