chart-testing
chart-testing copied to clipboard
Print proper version when installing via "go install"
BUG REPORT
What happened:
When installing ct via go install:
go install github.com/helm/chart-testing/v3/[email protected]
ct version prints right now ambiguous version information:
$ ct version
Version: unreleased
Git commit: unknown
Date: unknown
License: Apache 2.0
What you expected to happen:
ct version prints correct version.
How to reproduce it (as minimally and precisely as possible):
Run docker run -it golang:1.17-alpine sh -c 'go install github.com/helm/chart-testing/v3/[email protected] && ct version'
Example:
$ docker run -it golang:1.17-alpine sh -c 'go install github.com/helm/chart-testing/v3/[email protected] && ct version'
Unable to find image 'golang:1.17-alpine' locally
1.17-alpine: Pulling from library/golang
a0d0a0d46f8b: Already exists
31adcdaf11c8: Already exists
b8b176561691: Already exists
0a181aec76ea: Pull complete
b7e85de490b3: Pull complete
Digest: sha256:13919fb9091f6667cb375d5fdf016ecd6d3a5d5995603000d422b04583de4ef9
Status: Downloaded newer image for golang:1.17-alpine
go: downloading github.com/helm/chart-testing/v3 v3.4.0
go: downloading github.com/MakeNowJust/heredoc v1.0.0
go: downloading github.com/spf13/cobra v1.1.3
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/spf13/viper v1.7.1
go: downloading github.com/hashicorp/go-multierror v1.0.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/hashicorp/go-retryablehttp v0.6.8
go: downloading github.com/mattn/go-shellwords v1.0.10
go: downloading github.com/hashicorp/go-cleanhttp v0.5.1
go: downloading github.com/hashicorp/errwrap v1.0.0
go: downloading github.com/spf13/cast v1.3.1
go: downloading github.com/mitchellh/mapstructure v1.4.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading github.com/pelletier/go-toml v1.8.1
go: downloading github.com/magiconair/properties v1.8.4
go: downloading github.com/spf13/afero v1.4.1
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading gopkg.in/ini.v1 v1.62.0
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750
go: downloading golang.org/x/text v0.3.6
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
Version: unreleased
Git commit: unknown
Date: unknown
License: Apache 2.0
Anything else we need to know:
One can use debug.ReadBuildInfo() to get the right information. See https://github.com/sigstore/rekor/issues/212#issuecomment-894805808 for more details.