Skip to content

Commit 3b49619

Browse files
authored
build: Fix image tags in release manifests (#516)
Previous releases incorrectly missed the `v` prefix in the image when generating the `runtime-extensions-components.yaml`. This commit fixes that always inculding the `v`. This commit also ensures that the use of `trimPrefix` to remove the `v` prefix is consistently applied. As documented at https://goreleaser.com/customization/templates/#fn:version-prefix, the `Version` variable does not include the `v` prefix, but this is only for releases, and the `v` prefix is actually included in `Version` for snapshot or nightly builds.
1 parent 0737286 commit 3b49619

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.goreleaser.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ before:
3434
apiVersion: v1
3535
kind: Namespace
3636
metadata:
37-
name: {{.ProjectName}}-system
38-
$(helm template {{.ProjectName}} ./charts/{{.ProjectName}} \
39-
--namespace {{.ProjectName}}-system \
40-
--set-string image.tag={{ .Version }} \
37+
name: {{ .ProjectName }}-system
38+
$(helm template {{ .ProjectName }} ./charts/{{ .ProjectName }} \
39+
--namespace {{ .ProjectName }}-system \
40+
--set-string image.tag=v{{ trimprefix .Version "v" }} \
4141
{{ if .IsSnapshot }}--set-string image.repository=ko.local/{{ .ProjectName }}{{ end }} \
4242
)
4343
EOF'
@@ -75,12 +75,12 @@ builds:
7575
KO_DOCKER_REPO=ko.local/{{ .ProjectName }} \
7676
ko build \
7777
--bare \
78-
-t {{ .Version }} \
78+
-t v{{ trimprefix .Version "v" }} \
7979
./cmd
8080
fi'
8181
8282
archives:
83-
- name_template: '{{ .ProjectName }}_v{{trimprefix .Version "v"}}_{{ .Os }}_{{ .Arch }}'
83+
- name_template: '{{ .ProjectName }}_v{{ trimprefix .Version "v" }}_{{ .Os }}_{{ .Arch }}'
8484
rlcp: true
8585
builds:
8686
- cluster-api-runtime-extensions-nutanix
@@ -102,15 +102,15 @@ kos:
102102
org.opencontainers.image.created: "{{ .CommitDate }}"
103103
org.opencontainers.image.title: "{{ .ProjectName }}"
104104
org.opencontainers.image.revision: "{{ .FullCommit }}"
105-
org.opencontainers.image.version: v{{trimprefix .Version "v"}}
105+
org.opencontainers.image.version: v{{ .Version }}
106106
org.opencontainers.image.source: "{{ .GitURL }}"
107107
platforms:
108108
- linux/amd64
109109
- linux/arm64
110110
repository: ghcr.io/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix
111111
bare: true
112112
tags:
113-
- v{{trimprefix .Version "v"}}
113+
- v{{ trimprefix .Version "v" }}
114114

115115
checksum:
116116
name_template: 'checksums.txt'

0 commit comments

Comments
 (0)