Skip to content

Commit c06584d

Browse files
Compute the conflict name with a placeholder replaced before rendering, since the conflicts field in goreleaser is not templatable (#1993)
1 parent b86d898 commit c06584d

26 files changed

+59
-31
lines changed

build/goreleaser/linux/al2023_amd64.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
# Required packages. rpm version 4.11.3 does not support weak dependencies
8989
recommends:
9090
- fluent-bit
91+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9192
conflicts:
92-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
93-
93+
- newrelic-infra#conflicts-suffix-placeholder#
94+
9495
# end AL2023 adm64

build/goreleaser/linux/al2023_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8282
recommends:
8383
- fluent-bit
84+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8485
conflicts:
85-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
86+
- newrelic-infra#conflicts-suffix-placeholder#
8687

8788
# end AL2023 arm64

build/goreleaser/linux/al2_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
dependencies:
9090
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
9191
- fluent-bit
92+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9293
conflicts:
93-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
94+
- newrelic-infra#conflicts-suffix-placeholder#
9495

9596
# end AL2 adm64

build/goreleaser/linux/al2_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
dependencies:
8383
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
8484
- fluent-bit
85+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8586
conflicts:
86-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
87+
- newrelic-infra#conflicts-suffix-placeholder#
8788

8889
# end AL2 arm64

build/goreleaser/linux/centos_7_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
dependencies:
8989
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
9090
- fluent-bit
91+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9192
conflicts:
92-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
93+
- newrelic-infra#conflicts-suffix-placeholder#
9394

9495
# end CentOS 7 amd64

build/goreleaser/linux/centos_7_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
dependencies:
8484
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
8585
- fluent-bit
86+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8687
conflicts:
87-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
88+
- newrelic-infra#conflicts-suffix-placeholder#
8889

8990
# end CentOS 7 arm64

build/goreleaser/linux/centos_8_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
recommends:
9090
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
9191
- fluent-bit
92+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9293
conflicts:
93-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
94+
- newrelic-infra#conflicts-suffix-placeholder#
9495

9596
# end CentOS 8 amd64

build/goreleaser/linux/centos_8_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
recommends:
8383
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
8484
- fluent-bit
85+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8586
conflicts:
86-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
87+
- newrelic-infra#conflicts-suffix-placeholder#
8788

8889
# end CentOS 8 arm64

build/goreleaser/linux/debian_systemd_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
recommends:
7474
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
7575
- fluent-bit
76+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
7677
conflicts:
77-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
78+
- newrelic-infra#conflicts-suffix-placeholder#
7879

7980
# end Debian systemd amd64

build/goreleaser/linux/debian_systemd_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
recommends:
7474
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
7575
- fluent-bit
76+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
7677
conflicts:
77-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
78+
- newrelic-infra#conflicts-suffix-placeholder#
7879

7980
# end Debian systemd arm64

build/goreleaser/linux/debian_upstart_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
recommends:
7070
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
7171
- fluent-bit
72+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
7273
conflicts:
73-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
74+
- newrelic-infra#conflicts-suffix-placeholder#
7475

7576
# end Debian upstart amd64

build/goreleaser/linux/rhel_9_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8989
recommends:
9090
- fluent-bit
91+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9192
conflicts:
92-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
93+
- newrelic-infra#conflicts-suffix-placeholder#
9394

9495
# end RHEL 9 amd64

build/goreleaser/linux/rhel_9_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8282
recommends:
8383
- fluent-bit
84+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8485
conflicts:
85-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
86+
- newrelic-infra#conflicts-suffix-placeholder#
8687

8788
# end RHEL 9 arm64

build/goreleaser/linux/sles_125_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
recommends:
9292
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
9393
- fluent-bit
94+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9495
conflicts:
95-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
96+
- newrelic-infra#conflicts-suffix-placeholder#
9697

9798
# end SLES 12.5 amd64

build/goreleaser/linux/sles_125_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@
7979
posttrans: "build/package/rpm/postinst-systemd.sh"
8080
summary: "New Relic Infrastructure Agent"
8181
group: default
82+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8283
conflicts:
83-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
84+
- newrelic-infra#conflicts-suffix-placeholder#
8485
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8586
# recommends:
8687
# FB not supported yet

build/goreleaser/linux/sles_152_amd64.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
recommends:
9090
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
9191
- fluent-bit
92+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9293
conflicts:
93-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
94-
94+
- newrelic-infra#conflicts-suffix-placeholder#
9595
# end SLES 15.2 amd64

build/goreleaser/linux/sles_152_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@
7979
posttrans: "build/package/rpm/postinst-systemd.sh"
8080
summary: "New Relic Infrastructure Agent"
8181
group: default
82+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8283
conflicts:
83-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
84+
- newrelic-infra#conflicts-suffix-placeholder#
8485
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8586
# recommends:
8687
# FB not supported yet

build/goreleaser/linux/sles_153_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
recommends:
9090
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
9191
- fluent-bit
92+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9293
conflicts:
93-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
94+
- newrelic-infra#conflicts-suffix-placeholder#
9495

9596
# end SLES 15.3 amd64

build/goreleaser/linux/sles_153_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@
7979
posttrans: "build/package/rpm/postinst-systemd.sh"
8080
summary: "New Relic Infrastructure Agent"
8181
group: default
82+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8283
conflicts:
83-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
84+
- newrelic-infra#conflicts-suffix-placeholder#
8485
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8586
# recommends:
8687
# FB not supported yet

build/goreleaser/linux/sles_154_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8989
recommends:
9090
- fluent-bit
91+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9192
conflicts:
92-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
93+
- newrelic-infra#conflicts-suffix-placeholder#
9394

9495
# end SLES 15.4 amd64

build/goreleaser/linux/sles_154_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@
7979
posttrans: "build/package/rpm/postinst-systemd.sh"
8080
summary: "New Relic Infrastructure Agent"
8181
group: default
82+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8283
conflicts:
83-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
84+
- newrelic-infra#conflicts-suffix-placeholder#
8485
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8586
# recommends:
8687
# FB not supported yet

build/goreleaser/linux/sles_155_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8989
recommends:
9090
- fluent-bit
91+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9192
conflicts:
92-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
93+
- newrelic-infra#conflicts-suffix-placeholder#
9394

9495
# end SLES 15.5 amd64

build/goreleaser/linux/sles_155_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@
7979
posttrans: "build/package/rpm/postinst-systemd.sh"
8080
summary: "New Relic Infrastructure Agent"
8181
group: default
82+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
8283
conflicts:
83-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
84+
- newrelic-infra#conflicts-suffix-placeholder#
8485
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8586
# recommends:
8687
# FB not supported yet

build/goreleaser/linux/sles_156_amd64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
8989
recommends:
9090
- fluent-bit
91+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
9192
conflicts:
92-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
93+
- newrelic-infra#conflicts-suffix-placeholder#
9394

9495
# end SLES 15.6 amd64

build/goreleaser/linux/sles_156_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@
6868
posttrans: "build/package/rpm/postinst-systemd.sh"
6969
summary: "New Relic Infrastructure Agent"
7070
group: default
71+
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
7172
conflicts:
72-
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
73+
- newrelic-infra#conflicts-suffix-placeholder#
7374
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
7475
# recommends:
7576
# FB not supported yet

build/release.mk

+8-4
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ generate-goreleaser-amd64:
208208
$(CURDIR)/build/goreleaser/linux/sles_153_amd64.yml\
209209
$(CURDIR)/build/goreleaser/linux/sles_154_amd64.yml\
210210
$(CURDIR)/build/goreleaser/linux/sles_155_amd64.yml\
211-
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\
211+
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml | \
212+
sed "s/#conflicts-suffix-placeholder#/$(shell [ -n '$(FIPS)' ] && echo '' || echo '-fips')/g" \
212213
> $(GORELEASER_CONFIG_LINUX)
213214

214215
.PHONY : generate-goreleaser-arm
@@ -258,7 +259,8 @@ generate-goreleaser-arm64:
258259
$(CURDIR)/build/goreleaser/linux/sles_153_arm64.yml\
259260
$(CURDIR)/build/goreleaser/linux/sles_154_arm64.yml\
260261
$(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\
261-
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\
262+
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml | \
263+
sed "s/#conflicts-suffix-placeholder#/$(shell [ -n '$(FIPS)' ] && echo '' || echo '-fips')/g" \
262264
> $(GORELEASER_CONFIG_LINUX)
263265

264266
.PHONY : generate-goreleaser-legacy
@@ -333,7 +335,8 @@ generate-goreleaser-multiarch:
333335
$(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\
334336
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\
335337
$(CURDIR)/build/goreleaser/linux/sles_156_arm.yml\
336-
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\
338+
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml |\
339+
sed "s/#conflicts-suffix-placeholder#/-fips/g" \
337340
> $(GORELEASER_CONFIG_LINUX)
338341

339342
.PHONY : generate-goreleaser-multiarch-fips
@@ -369,7 +372,8 @@ generate-goreleaser-multiarch-fips:
369372
$(CURDIR)/build/goreleaser/linux/sles_155_amd64.yml\
370373
$(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\
371374
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\
372-
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\
375+
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml |\
376+
sed "s/#conflicts-suffix-placeholder#//g" \
373377
> $(GORELEASER_CONFIG_LINUX)
374378

375379
.PHONY : generate-goreleaser-for-docker

0 commit comments

Comments
 (0)