Skip to content

Commit 8f3ba42

Browse files
Trim possible v prefixes in release code (#445)
Issue #, if available: aws-controllers-k8s/community#1715 Description of changes: This pull request updates the release Go code paths and ensures that all `ReleaseVersion` template variables do not contain the `v` prefix. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 440b484 commit 8f3ba42

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/generate/ack/release.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func Release(
7777
releaseVars := &templateReleaseVars{
7878
metaVars,
7979
ImageReleaseVars{
80-
ReleaseVersion: releaseVersion,
80+
ReleaseVersion: strings.TrimPrefix(releaseVersion, "v"),
8181
ImageRepository: imageRepository,
8282
},
8383
metadata,

pkg/generate/olm/olm.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ func BundleAssets(
5959
return nil, err
6060
}
6161

62-
olmVersion := strings.TrimLeft(releaseVersion, "v")
62+
// Remove any `v` index that may have been included
63+
strippedVersion := strings.TrimPrefix(releaseVersion, "v")
64+
6365
olmVars := templateOLMVars{
6466
ackgenerate.ImageReleaseVars{
65-
ReleaseVersion: releaseVersion,
67+
ReleaseVersion: strippedVersion,
6668
ImageRepository: imageRepository,
6769
},
68-
olmVersion,
70+
strippedVersion,
6971
time.Now().Format("2006-01-02 15:04:05"),
7072
m.MetaVars(),
7173
commonMeta,

0 commit comments

Comments
 (0)