From 8d5afaf2faf5f6a4fad4800d61c372566ef9a802 Mon Sep 17 00:00:00 2001 From: Paolo Chila Date: Thu, 20 Mar 2025 12:11:21 +0100 Subject: [PATCH] Skip FIPS components when packaging elastic-agent from a Manifest 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. --- dev-tools/mage/checksums.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dev-tools/mage/checksums.go b/dev-tools/mage/checksums.go index f76ab54c849..9cd4cef0ce2 100644 --- a/dev-tools/mage/checksums.go +++ b/dev-tools/mage/checksums.go @@ -110,7 +110,11 @@ func ChecksumsWithManifest(requiredPackage string, versionedFlatPath string, ver // Iterate over the external binaries that we care about for packaging agent for _, spec := range manifest.ExpectedBinaries { // If the individual package doesn't match the expected prefix, then continue - if !strings.HasPrefix(pkgName, spec.BinaryName) { + // FIXME temporarily skip fips packages until elastic-agent FIPS is in place + if !strings.HasPrefix(pkgName, spec.BinaryName) || strings.Contains(pkgName, "-fips-") { + if mg.Verbose() { + log.Printf(">>>>>>> Package [%s] skipped", pkgName) + } continue } @@ -197,7 +201,8 @@ func getComponentVersion(componentName string, requiredPackage string, component // Only care about the external binaries that we want to package for _, spec := range manifest.ExpectedBinaries { // If the given component name doesn't match the external binary component, skip - if componentName != spec.ProjectName { + // FIXME temporarily skip fips packages until elastic-agent FIPS is in place + if componentName != spec.ProjectName || strings.Contains(pkgName, "-fips-") { continue }