From 132487b8cedc4d793a0aff0e64bf872d2cae12fb Mon Sep 17 00:00:00 2001 From: alvarocabanas Date: Mon, 13 Jan 2025 18:41:02 +0100 Subject: [PATCH] Compute the conflict name with a placeholder replaced before rendering, since the conflicts field in goreleaser is not templatable --- build/goreleaser/linux/al2023_amd64.yml | 5 +++-- build/goreleaser/linux/al2023_arm64.yml | 3 ++- build/goreleaser/linux/al2_amd64.yml | 3 ++- build/goreleaser/linux/al2_arm64.yml | 3 ++- build/goreleaser/linux/centos_7_amd64.yml | 3 ++- build/goreleaser/linux/centos_7_arm64.yml | 3 ++- build/goreleaser/linux/centos_8_amd64.yml | 3 ++- build/goreleaser/linux/centos_8_arm64.yml | 3 ++- build/goreleaser/linux/debian_systemd_amd64.yml | 3 ++- build/goreleaser/linux/debian_systemd_arm64.yml | 3 ++- build/goreleaser/linux/debian_upstart_amd64.yml | 3 ++- build/goreleaser/linux/rhel_9_amd64.yml | 3 ++- build/goreleaser/linux/rhel_9_arm64.yml | 3 ++- build/goreleaser/linux/sles_125_amd64.yml | 3 ++- build/goreleaser/linux/sles_125_arm64.yml | 3 ++- build/goreleaser/linux/sles_152_amd64.yml | 4 ++-- build/goreleaser/linux/sles_152_arm64.yml | 3 ++- build/goreleaser/linux/sles_153_amd64.yml | 3 ++- build/goreleaser/linux/sles_153_arm64.yml | 3 ++- build/goreleaser/linux/sles_154_amd64.yml | 3 ++- build/goreleaser/linux/sles_154_arm64.yml | 3 ++- build/goreleaser/linux/sles_155_amd64.yml | 3 ++- build/goreleaser/linux/sles_155_arm64.yml | 3 ++- build/goreleaser/linux/sles_156_amd64.yml | 3 ++- build/goreleaser/linux/sles_156_arm64.yml | 3 ++- build/release.mk | 12 ++++++++---- 26 files changed, 59 insertions(+), 31 deletions(-) diff --git a/build/goreleaser/linux/al2023_amd64.yml b/build/goreleaser/linux/al2023_amd64.yml index dbe57a236..63da5aa37 100644 --- a/build/goreleaser/linux/al2023_amd64.yml +++ b/build/goreleaser/linux/al2023_amd64.yml @@ -88,7 +88,8 @@ # Required packages. rpm version 4.11.3 does not support weak dependencies recommends: - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} - + - newrelic-infra#conflicts-suffix-placeholder# + # end AL2023 adm64 diff --git a/build/goreleaser/linux/al2023_arm64.yml b/build/goreleaser/linux/al2023_arm64.yml index 18b8e1cad..49f27ce0e 100644 --- a/build/goreleaser/linux/al2023_arm64.yml +++ b/build/goreleaser/linux/al2023_arm64.yml @@ -81,7 +81,8 @@ # Recommended packages. If they fail to install installation of the agent will not be interrupted. recommends: - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end AL2023 arm64 diff --git a/build/goreleaser/linux/al2_amd64.yml b/build/goreleaser/linux/al2_amd64.yml index 54da3b83f..feb79232b 100644 --- a/build/goreleaser/linux/al2_amd64.yml +++ b/build/goreleaser/linux/al2_amd64.yml @@ -89,7 +89,8 @@ dependencies: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end AL2 adm64 diff --git a/build/goreleaser/linux/al2_arm64.yml b/build/goreleaser/linux/al2_arm64.yml index 82aad5180..e0296b44b 100644 --- a/build/goreleaser/linux/al2_arm64.yml +++ b/build/goreleaser/linux/al2_arm64.yml @@ -82,7 +82,8 @@ dependencies: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end AL2 arm64 diff --git a/build/goreleaser/linux/centos_7_amd64.yml b/build/goreleaser/linux/centos_7_amd64.yml index 4a490354e..c119c06f1 100644 --- a/build/goreleaser/linux/centos_7_amd64.yml +++ b/build/goreleaser/linux/centos_7_amd64.yml @@ -88,7 +88,8 @@ dependencies: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end CentOS 7 amd64 diff --git a/build/goreleaser/linux/centos_7_arm64.yml b/build/goreleaser/linux/centos_7_arm64.yml index 10fd94d25..d12da4eaf 100644 --- a/build/goreleaser/linux/centos_7_arm64.yml +++ b/build/goreleaser/linux/centos_7_arm64.yml @@ -83,7 +83,8 @@ dependencies: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end CentOS 7 arm64 diff --git a/build/goreleaser/linux/centos_8_amd64.yml b/build/goreleaser/linux/centos_8_amd64.yml index 2f88f54ce..462666084 100644 --- a/build/goreleaser/linux/centos_8_amd64.yml +++ b/build/goreleaser/linux/centos_8_amd64.yml @@ -89,7 +89,8 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end CentOS 8 amd64 diff --git a/build/goreleaser/linux/centos_8_arm64.yml b/build/goreleaser/linux/centos_8_arm64.yml index 395ddf86e..3e88b9be4 100644 --- a/build/goreleaser/linux/centos_8_arm64.yml +++ b/build/goreleaser/linux/centos_8_arm64.yml @@ -82,7 +82,8 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end CentOS 8 arm64 diff --git a/build/goreleaser/linux/debian_systemd_amd64.yml b/build/goreleaser/linux/debian_systemd_amd64.yml index 684919991..6beda6f5b 100644 --- a/build/goreleaser/linux/debian_systemd_amd64.yml +++ b/build/goreleaser/linux/debian_systemd_amd64.yml @@ -73,7 +73,8 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end Debian systemd amd64 diff --git a/build/goreleaser/linux/debian_systemd_arm64.yml b/build/goreleaser/linux/debian_systemd_arm64.yml index d373168fc..100728b78 100644 --- a/build/goreleaser/linux/debian_systemd_arm64.yml +++ b/build/goreleaser/linux/debian_systemd_arm64.yml @@ -73,7 +73,8 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end Debian systemd arm64 diff --git a/build/goreleaser/linux/debian_upstart_amd64.yml b/build/goreleaser/linux/debian_upstart_amd64.yml index 1a839b42b..dcad15a38 100644 --- a/build/goreleaser/linux/debian_upstart_amd64.yml +++ b/build/goreleaser/linux/debian_upstart_amd64.yml @@ -69,7 +69,8 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end Debian upstart amd64 diff --git a/build/goreleaser/linux/rhel_9_amd64.yml b/build/goreleaser/linux/rhel_9_amd64.yml index 7259b48c8..b09211bf1 100644 --- a/build/goreleaser/linux/rhel_9_amd64.yml +++ b/build/goreleaser/linux/rhel_9_amd64.yml @@ -88,7 +88,8 @@ # Recommended packages. If they fail to install installation of the agent will not be interrupted. recommends: - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end RHEL 9 amd64 diff --git a/build/goreleaser/linux/rhel_9_arm64.yml b/build/goreleaser/linux/rhel_9_arm64.yml index 46d32e2a4..7dccbf2bc 100644 --- a/build/goreleaser/linux/rhel_9_arm64.yml +++ b/build/goreleaser/linux/rhel_9_arm64.yml @@ -81,7 +81,8 @@ # Recommended packages. If they fail to install installation of the agent will not be interrupted. recommends: - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end RHEL 9 arm64 diff --git a/build/goreleaser/linux/sles_125_amd64.yml b/build/goreleaser/linux/sles_125_amd64.yml index 06c3514a9..9e3001769 100644 --- a/build/goreleaser/linux/sles_125_amd64.yml +++ b/build/goreleaser/linux/sles_125_amd64.yml @@ -91,7 +91,8 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end SLES 12.5 amd64 diff --git a/build/goreleaser/linux/sles_125_arm64.yml b/build/goreleaser/linux/sles_125_arm64.yml index 924ccf551..1536cabd5 100644 --- a/build/goreleaser/linux/sles_125_arm64.yml +++ b/build/goreleaser/linux/sles_125_arm64.yml @@ -79,8 +79,9 @@ posttrans: "build/package/rpm/postinst-systemd.sh" summary: "New Relic Infrastructure Agent" group: default + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # Recommended packages. If they fail to install installation of the agent will not be interrupted. # recommends: # FB not supported yet diff --git a/build/goreleaser/linux/sles_152_amd64.yml b/build/goreleaser/linux/sles_152_amd64.yml index 4e5e4fda4..9f61d2629 100644 --- a/build/goreleaser/linux/sles_152_amd64.yml +++ b/build/goreleaser/linux/sles_152_amd64.yml @@ -89,7 +89,7 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} - + - newrelic-infra#conflicts-suffix-placeholder# # end SLES 15.2 amd64 diff --git a/build/goreleaser/linux/sles_152_arm64.yml b/build/goreleaser/linux/sles_152_arm64.yml index 8737ee9f1..e0f5e0253 100644 --- a/build/goreleaser/linux/sles_152_arm64.yml +++ b/build/goreleaser/linux/sles_152_arm64.yml @@ -79,8 +79,9 @@ posttrans: "build/package/rpm/postinst-systemd.sh" summary: "New Relic Infrastructure Agent" group: default + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # Recommended packages. If they fail to install installation of the agent will not be interrupted. # recommends: # FB not supported yet diff --git a/build/goreleaser/linux/sles_153_amd64.yml b/build/goreleaser/linux/sles_153_amd64.yml index 60eb708d6..f79301aa5 100644 --- a/build/goreleaser/linux/sles_153_amd64.yml +++ b/build/goreleaser/linux/sles_153_amd64.yml @@ -89,7 +89,8 @@ recommends: - td-agent-bit #To be removed on removal of the ff fluent_bit_19 - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end SLES 15.3 amd64 diff --git a/build/goreleaser/linux/sles_153_arm64.yml b/build/goreleaser/linux/sles_153_arm64.yml index c7744347a..12435fa8d 100644 --- a/build/goreleaser/linux/sles_153_arm64.yml +++ b/build/goreleaser/linux/sles_153_arm64.yml @@ -79,8 +79,9 @@ posttrans: "build/package/rpm/postinst-systemd.sh" summary: "New Relic Infrastructure Agent" group: default + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # Recommended packages. If they fail to install installation of the agent will not be interrupted. # recommends: # FB not supported yet diff --git a/build/goreleaser/linux/sles_154_amd64.yml b/build/goreleaser/linux/sles_154_amd64.yml index 250811726..d64d8d146 100644 --- a/build/goreleaser/linux/sles_154_amd64.yml +++ b/build/goreleaser/linux/sles_154_amd64.yml @@ -88,7 +88,8 @@ # Recommended packages. If they fail to install installation of the agent will not be interrupted. recommends: - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end SLES 15.4 amd64 diff --git a/build/goreleaser/linux/sles_154_arm64.yml b/build/goreleaser/linux/sles_154_arm64.yml index ec59b1cbc..76b47b79c 100644 --- a/build/goreleaser/linux/sles_154_arm64.yml +++ b/build/goreleaser/linux/sles_154_arm64.yml @@ -79,8 +79,9 @@ posttrans: "build/package/rpm/postinst-systemd.sh" summary: "New Relic Infrastructure Agent" group: default + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # Recommended packages. If they fail to install installation of the agent will not be interrupted. # recommends: # FB not supported yet diff --git a/build/goreleaser/linux/sles_155_amd64.yml b/build/goreleaser/linux/sles_155_amd64.yml index f99d4cef0..aa3a5fec0 100644 --- a/build/goreleaser/linux/sles_155_amd64.yml +++ b/build/goreleaser/linux/sles_155_amd64.yml @@ -88,7 +88,8 @@ # Recommended packages. If they fail to install installation of the agent will not be interrupted. recommends: - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end SLES 15.5 amd64 diff --git a/build/goreleaser/linux/sles_155_arm64.yml b/build/goreleaser/linux/sles_155_arm64.yml index 97238c146..a45f56934 100644 --- a/build/goreleaser/linux/sles_155_arm64.yml +++ b/build/goreleaser/linux/sles_155_arm64.yml @@ -79,8 +79,9 @@ posttrans: "build/package/rpm/postinst-systemd.sh" summary: "New Relic Infrastructure Agent" group: default + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # Recommended packages. If they fail to install installation of the agent will not be interrupted. # recommends: # FB not supported yet diff --git a/build/goreleaser/linux/sles_156_amd64.yml b/build/goreleaser/linux/sles_156_amd64.yml index e9ad6b829..c822597c2 100644 --- a/build/goreleaser/linux/sles_156_amd64.yml +++ b/build/goreleaser/linux/sles_156_amd64.yml @@ -88,7 +88,8 @@ # Recommended packages. If they fail to install installation of the agent will not be interrupted. recommends: - fluent-bit + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # end SLES 15.6 amd64 diff --git a/build/goreleaser/linux/sles_156_arm64.yml b/build/goreleaser/linux/sles_156_arm64.yml index aaef64c52..dec29a364 100644 --- a/build/goreleaser/linux/sles_156_arm64.yml +++ b/build/goreleaser/linux/sles_156_arm64.yml @@ -68,8 +68,9 @@ posttrans: "build/package/rpm/postinst-systemd.sh" summary: "New Relic Infrastructure Agent" group: default + # conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later conflicts: - - newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }} + - newrelic-infra#conflicts-suffix-placeholder# # Recommended packages. If they fail to install installation of the agent will not be interrupted. # recommends: # FB not supported yet diff --git a/build/release.mk b/build/release.mk index e1ff64a0b..d853e116d 100644 --- a/build/release.mk +++ b/build/release.mk @@ -208,7 +208,8 @@ generate-goreleaser-amd64: $(CURDIR)/build/goreleaser/linux/sles_153_amd64.yml\ $(CURDIR)/build/goreleaser/linux/sles_154_amd64.yml\ $(CURDIR)/build/goreleaser/linux/sles_155_amd64.yml\ - $(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\ + $(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml | \ + sed "s/#conflicts-suffix-placeholder#/$(shell [ -n '$(FIPS)' ] && echo '' || echo '-fips')/g" \ > $(GORELEASER_CONFIG_LINUX) .PHONY : generate-goreleaser-arm @@ -258,7 +259,8 @@ generate-goreleaser-arm64: $(CURDIR)/build/goreleaser/linux/sles_153_arm64.yml\ $(CURDIR)/build/goreleaser/linux/sles_154_arm64.yml\ $(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\ - $(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\ + $(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml | \ + sed "s/#conflicts-suffix-placeholder#/$(shell [ -n '$(FIPS)' ] && echo '' || echo '-fips')/g" \ > $(GORELEASER_CONFIG_LINUX) .PHONY : generate-goreleaser-legacy @@ -333,7 +335,8 @@ generate-goreleaser-multiarch: $(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\ $(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\ $(CURDIR)/build/goreleaser/linux/sles_156_arm.yml\ - $(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\ + $(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml |\ + sed "s/#conflicts-suffix-placeholder#/-fips/g" \ > $(GORELEASER_CONFIG_LINUX) .PHONY : generate-goreleaser-multiarch-fips @@ -369,7 +372,8 @@ generate-goreleaser-multiarch-fips: $(CURDIR)/build/goreleaser/linux/sles_155_amd64.yml\ $(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\ $(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\ - $(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\ + $(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml |\ + sed "s/#conflicts-suffix-placeholder#//g" \ > $(GORELEASER_CONFIG_LINUX) .PHONY : generate-goreleaser-for-docker