diff --git a/.buildkite/e2e/nightly-main-matrix.yaml b/.buildkite/e2e/nightly-main-matrix.yaml index 76b9d26bec..3cb3fd5a6b 100644 --- a/.buildkite/e2e/nightly-main-matrix.yaml +++ b/.buildkite/e2e/nightly-main-matrix.yaml @@ -45,7 +45,6 @@ fixed: E2E_PROVIDER: eks-arm E2E_TEST_ENV_TAGS: arch:arm - E2E_TAGS: "es,kb,apm,ent,beat,agent" TEST_LICENSE: "" # disabled b/c https://github.com/elastic/elasticsearch/issues/68083 MONITORING_SECRETS: "" # disabled b/c beats cannot run on ARM diff --git a/.buildkite/e2e/release-branch-matrix.yaml b/.buildkite/e2e/release-branch-matrix.yaml index 759f0bb921..5ed56747b8 100644 --- a/.buildkite/e2e/release-branch-matrix.yaml +++ b/.buildkite/e2e/release-branch-matrix.yaml @@ -61,7 +61,6 @@ fixed: E2E_PROVIDER: eks-arm E2E_TEST_ENV_TAGS: arch:arm - E2E_TAGS: "es,kb,apm,ent,beat,agent" TEST_LICENSE: "" # disabled b/c https://github.com/elastic/elasticsearch/issues/68083 MONITORING_SECRETS: "" # disabled b/c beats cannot run on ARM diff --git a/pkg/controller/common/container/container.go b/pkg/controller/common/container/container.go index c824251676..235fc5d311 100644 --- a/pkg/controller/common/container/container.go +++ b/pkg/controller/common/container/container.go @@ -67,6 +67,8 @@ const ( LogstashImage Image = "logstash/logstash" ) +var MinMapsVersionOnARM = version.MinFor(8, 16, 0) + // ImageRepository returns the full container image name by concatenating the current container registry and the image path with the given version. // A UBI suffix (-ubi8 or -ubi suffix depending on the version) is appended to the image name for the maps image, // or any image if the operator is configured with --ubi-only. @@ -81,7 +83,7 @@ func ImageRepository(img Image, ver version.Version) string { suffix := "" useUBISuffix := containerSuffix == UBISuffix // use an UBI suffix for maps server image or any image in UBI mode - if useUBISuffix || img == MapsImage { + if useUBISuffix || isOlderMapsServerImg(img, ver) { suffix = getUBISuffix(ver) } // use the global container suffix in non-UBI mode @@ -92,6 +94,13 @@ func ImageRepository(img Image, ver version.Version) string { return fmt.Sprintf("%s/%s%s:%s", containerRegistry, image, suffix, ver) } +// isOderMapsServerImg returns true if the given image is a Maps server image and +// older than 8.16.0 as of which release the Maps server images are multi-arch similar to +// other stack images and come in non-UBI variants as well. +func isOlderMapsServerImg(img Image, ver version.Version) bool { + return img == MapsImage && ver.LT(MinMapsVersionOnARM) +} + // getUBISuffix returns the UBI suffix to use depending on the given version. func getUBISuffix(ver version.Version) string { if ver.Major == 7 && ver.LT(major7UbiSuffixMinVersion) { diff --git a/pkg/controller/common/container/container_test.go b/pkg/controller/common/container/container_test.go index 2934ba882d..e2c0883262 100644 --- a/pkg/controller/common/container/container_test.go +++ b/pkg/controller/common/container/container_test.go @@ -141,6 +141,19 @@ func TestImageRepository(t *testing.T) { suffix: "-obi1", want: testRegistry + "/elastic-maps-service/elastic-maps-server-ubi8-obi1:8.11.0", }, + { + name: "Maps 8 image post 8.16 wolfi-based", + image: MapsImage, + version: "8.16.0", + want: testRegistry + "/elastic-maps-service/elastic-maps-server:8.16.0", + }, + { + name: "Maps 8 image post 8.16 ubi requested", + image: MapsImage, + version: "8.16.0", + suffix: "-ubi", + want: testRegistry + "/elastic-maps-service/elastic-maps-server-ubi:8.16.0", + }, } for _, tc := range testCases { diff --git a/test/e2e/test/maps/builder.go b/test/e2e/test/maps/builder.go index 378c8fe88b..6d839b8383 100644 --- a/test/e2e/test/maps/builder.go +++ b/test/e2e/test/maps/builder.go @@ -12,6 +12,7 @@ import ( commonv1 "github.com/elastic/cloud-on-k8s/v2/pkg/apis/common/v1" "github.com/elastic/cloud-on-k8s/v2/pkg/apis/maps/v1alpha1" + "github.com/elastic/cloud-on-k8s/v2/pkg/controller/common/container" "github.com/elastic/cloud-on-k8s/v2/pkg/controller/common/version" "github.com/elastic/cloud-on-k8s/v2/pkg/utils/k8s" "github.com/elastic/cloud-on-k8s/v2/test/e2e/cmd/run" @@ -152,6 +153,10 @@ func (b Builder) SkipTest() bool { return true } ver := version.MustParse(b.EMS.Spec.Version) + // ARM is only supported as of 8.16.0 + if test.Ctx().HasTag(test.ArchARMTag) && ver.LT(container.MinMapsVersionOnARM) { + return true + } return version.SupportedMapsVersions.WithinRange(ver) != nil }