Closed grafvonb closed 1 year ago
Visit the deploys page to approve it
Name | Link |
---|---|
Latest commit | 12767d16a333ea47177c94cb9dea3ee9277a012f |
/assign @rajatjindal
Hi @grafvonb
Thank you for opening the PR.
I was wondering if something like {{ trimPrefix \"v\" .TagName }}
will work you?
Please note that trimPrefix
is currently not available in templating, but we can add that.
Hi @rajatjindal, my idea was to have a function that is able to "extract" the version from any string, even if someone would use a tag like "V1.0.1-beta" if required, but your solution might be simpler especially if we just want to cover standard behavior of goreleaser
which creates files without v
. Actually I would be happy to have both possibilities :).
The thing that concerns me is that exposing both tag
and version
as template variables will create confusion for the users.
Also, the krew-release-bot
does not support beta versions.krew-index
enforces that the tag version is a semantic version string. (see https://krew.sigs.k8s.io/docs/developer-guide/plugin-manifest/)
Keeping this in mind, I am not convinced to add another template variable and would request you consider using the solution I suggested earlier.
Although I might be missing some scenarios that may force me to change my opinion here, in that case, please feel free to share your thoughts.
Sometimes it is necessary to use a pure version instead of a tag value, e.g. instead of
v0.0.1
simply0.0.1
. This feature extends the data structure passed to the.krew.yaml
template, allowing the use of{{ .Version }}
when necessary. If the tag does not contain a version, the value of the tag is used without any modification to avoid returning an empty string.