Skip to content

Commit b1c867e

Browse files
mergify[bot]pchila
andauthored
Skip FIPS components when packaging elastic-agent from a Manifest (#7486) (#7546)
ChecksumsWithManifest function assumes that all (actually only one) packages matching a component binary name prefix and the target platform are downloaded and available but since -fips packages are available in manifests this is no longer true (see endpoint-security-fips-9.1.0-SNAPSHOT-linux-x86_64.tar.gz and endpoint-security-9.1.0-SNAPSHOT-linux-x86_64.tar.gz which are both present in recent manifest versions). This is a short term hack to avoid breaking elastic-agent packaging now that -fips package variants are available. (cherry picked from commit ab1a614) Co-authored-by: Paolo Chilà <[email protected]>
1 parent 0628668 commit b1c867e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dev-tools/mage/checksums.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ func ChecksumsWithManifest(requiredPackage string, versionedFlatPath string, ver
110110
// Iterate over the external binaries that we care about for packaging agent
111111
for _, spec := range manifest.ExpectedBinaries {
112112
// If the individual package doesn't match the expected prefix, then continue
113-
if !strings.HasPrefix(pkgName, spec.BinaryName) {
113+
// FIXME temporarily skip fips packages until elastic-agent FIPS is in place
114+
if !strings.HasPrefix(pkgName, spec.BinaryName) || strings.Contains(pkgName, "-fips-") {
115+
if mg.Verbose() {
116+
log.Printf(">>>>>>> Package [%s] skipped", pkgName)
117+
}
114118
continue
115119
}
116120

@@ -217,7 +221,8 @@ func getComponentVersion(componentName string, requiredPackage string, component
217221
// Only care about the external binaries that we want to package
218222
for _, spec := range manifest.ExpectedBinaries {
219223
// If the given component name doesn't match the external binary component, skip
220-
if componentName != spec.ProjectName {
224+
// FIXME temporarily skip fips packages until elastic-agent FIPS is in place
225+
if componentName != spec.ProjectName || strings.Contains(pkgName, "-fips-") {
221226
continue
222227
}
223228

0 commit comments

Comments
 (0)