Skip to content

Commit dd0095a

Browse files
authored
Resolve fips specific metricbeat and filebeat libs for ES fips image (#126312) (#126343)
Also updated DRA handling to reflect resolving fips specific artifacts
1 parent b121ee2 commit dd0095a

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

Diff for: build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/dra/DraResolvePlugin.java

+10
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ private void configureDraRepository(
7373
patternLayout.artifact(
7474
String.format("/%s/%s/downloads/%s/[module]/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
7575
);
76+
77+
if ("beats".equals(draKey)) {
78+
// we don't have a good pattern here for beats fips specific images
79+
patternLayout.artifact(
80+
String.format("/%s/%s/downloads/%s/metricbeat/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
81+
);
82+
patternLayout.artifact(
83+
String.format("/%s/%s/downloads/%s/filebeat/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
84+
);
85+
}
7686
});
7787
repo.metadataSources(metadataSources -> metadataSources.artifact());
7888
repo.content(repositoryContentDescriptor -> repositoryContentDescriptor.includeVersionByRegex(".*", ".*", includeVersionRegex));

Diff for: distribution/docker/build.gradle

+17-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ if (useDra == false) {
5757
patternLayout {
5858
if (VersionProperties.isElasticsearchSnapshot()) {
5959
artifact '/[organization]/[revision]/downloads/[organization]/[module]/[module]-[revision]-[classifier].[ext]'
60+
artifact '/[organization]/[revision]/downloads/[organization]/filebeat/[module]-[revision]-[classifier].[ext]'
61+
artifact '/[organization]/[revision]/downloads/[organization]/metricbeat/[module]-[revision]-[classifier].[ext]'
6062
} else {
6163
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
6264
// Release builds are always done with a local repo.
6365
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/[module]/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
66+
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/filebeat/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
67+
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/metricbeat/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
6468
}
6569
}
6670
}
@@ -93,9 +97,13 @@ configurations {
9397
tini
9498
allPlugins
9599
filebeat_aarch64
100+
filebeat_fips_aarch64
96101
filebeat_x86_64
102+
filebeat_fips_x86_64
97103
metricbeat_aarch64
104+
metricbeat_fips_aarch64
98105
metricbeat_x86_64
106+
metricbeat_fips_x86_64
99107
fips
100108
}
101109

@@ -111,8 +119,15 @@ dependencies {
111119
allPlugins project(path: ':plugins', configuration: 'allPlugins')
112120
filebeat_aarch64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
113121
filebeat_x86_64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
122+
filebeat_fips_aarch64 "beats:filebeat-fips:${VersionProperties.elasticsearch}:[email protected]"
123+
filebeat_fips_x86_64 "beats:filebeat-fips:${VersionProperties.elasticsearch}:[email protected]"
124+
114125
metricbeat_aarch64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
115126
metricbeat_x86_64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
127+
128+
metricbeat_fips_aarch64 "beats:metricbeat-fips:${VersionProperties.elasticsearch}:[email protected]"
129+
metricbeat_fips_x86_64 "beats:metricbeat-fips:${VersionProperties.elasticsearch}:[email protected]"
130+
116131
fips "org.bouncycastle:bc-fips:1.0.2.5"
117132
fips "org.bouncycastle:bctls-fips:1.0.19"
118133
}
@@ -301,8 +316,8 @@ void addBuildDockerContextTask(Architecture architecture, DockerBase base) {
301316
boolean includeBeats = VersionProperties.isElasticsearchSnapshot() == true || buildId != null || useDra
302317

303318
if (includeBeats) {
304-
from configurations.getByName("filebeat_${architecture.classifier}")
305-
from configurations.getByName("metricbeat_${architecture.classifier}")
319+
from configurations.getByName("filebeat_fips_${architecture.classifier}")
320+
from configurations.getByName("metricbeat_fips_${architecture.classifier}")
306321
// For some reason, the artifact name can differ depending on what repository we used.
307322
rename ~/((?:file|metric)beat)-.*\.tar\.gz$/, "\$1-${VersionProperties.elasticsearch}.tar.gz"
308323
}

Diff for: gradle/verification-metadata.xml

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<verify-signatures>false</verify-signatures>
66
<trusted-artifacts>
77
<trust group="beats" name="filebeat"/>
8+
<trust group="beats" name="filebeat-fips"/>
89
<trust group="beats" name="metricbeat"/>
10+
<trust group="beats" name="metricbeat-fips"/>
911
<trust group="elasticsearch-distribution" name="elasticsearch"/>
1012
<trust group="org.elasticsearch"/>
1113
<trust group="org.elasticsearch.distribution.zip" name="elasticsearch"/>

0 commit comments

Comments
 (0)