Skip to content

Commit 0185fd6

Browse files
Remove ubi suffix for 9.x images (#8509)
* remove ubi suffix for 9.x images
1 parent f0529b3 commit 0185fd6

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

cmd/manager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ func Command() *cobra.Command {
322322
cmd.Flags().Bool(
323323
operator.UBIOnlyFlag,
324324
false,
325-
fmt.Sprintf("Use only UBI container images to deploy Elastic Stack applications. UBI images are only available from 7.10.0 onward. Cannot be combined with %s", operator.ContainerSuffixFlag),
325+
fmt.Sprintf("Use only UBI container images to deploy Elastic Stack applications. UBI images are only available from 7.10.0 onward. Ignored from 9.x as default images are based on UBI. Cannot be combined with %s", operator.ContainerSuffixFlag),
326326
)
327327
cmd.Flags().Bool(
328328
operator.ValidateStorageClassFlag,

pkg/controller/common/container/container.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ func ImageRepository(img Image, ver version.Version) string {
8686
if useUBISuffix || isOlderMapsServerImg(img, ver) {
8787
suffix = getUBISuffix(ver)
8888
}
89-
// Starting with 9.x ubi is the default for APM server, there's no -ubi image.
89+
// Starting with 9.x ubi is the default for all stack images
9090
if useUBISuffix && ver.Major >= 9 {
91-
if img == APMServerImage {
92-
suffix = ""
93-
}
91+
suffix = ""
9492
}
9593
// use the global container suffix in non-UBI mode
9694
if !useUBISuffix {

pkg/controller/common/container/container_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ func TestImageRepository(t *testing.T) {
6969
suffix: "-obi1",
7070
want: testRegistry + "/elastic/elasticsearch-obi1:42.0.0",
7171
},
72+
{
73+
name: "Elasticsearch 9 image in ubi mode",
74+
image: ElasticsearchImage,
75+
version: "9.0.0",
76+
repository: "elastic",
77+
suffix: "-ubi",
78+
want: testRegistry + "/elastic/elasticsearch:9.0.0",
79+
},
7280
{
7381
name: "Elasticsearch 8 image in ubi mode",
7482
image: ElasticsearchImage,

0 commit comments

Comments
 (0)