From 7f7cdda1d21e430c259eb24a82c6b5784606cbac Mon Sep 17 00:00:00 2001 From: Ahsan Khan Date: Tue, 10 Jan 2023 21:42:05 -0800 Subject: [PATCH] feat: Print version with Client and Server (#108) Issue #, if available: #12 *Description of changes:* Update the implementation `finch version` according to https://github.com/runfinch/finch/issues/12#issuecomment-1347252973 #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Ahsan Khan Signed-off-by: Ahsan Khan --- Makefile | 3 +- cmd/finch/main.go | 22 +++-- cmd/finch/main_test.go | 10 ++- cmd/finch/version.go | 107 ++++++++++++++++++++-- cmd/finch/version_test.go | 184 +++++++++++++++++++++++++++++++++----- e2e/version_test.go | 16 ++-- go.mod | 2 +- go.sum | 4 +- pkg/version/version.go | 6 +- 9 files changed, 305 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index 2c2eced8a..2f334ce8b 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,8 @@ CORE_OUTDIR := $(CURDIR)/$(CORE_FILENAME)/_output CORE_VDE_PREFIX ?= $(OUTDIR)/dependencies/vde/opt/finch LICENSEDIR := $(OUTDIR)/license-files VERSION := $(shell git describe --match 'v[0-9]*' --dirty='.modified' --always --tags) -LDFLAGS := "-X $(PACKAGE)/pkg/version.Version=$(VERSION)" +GITCOMMIT := $(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi) +LDFLAGS := "-X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.GitCommit=$(GITCOMMIT)" .DEFAULT_GOAL := all diff --git a/cmd/finch/main.go b/cmd/finch/main.go index 9ed00c6be..6b301b8fc 100644 --- a/cmd/finch/main.go +++ b/cmd/finch/main.go @@ -6,6 +6,8 @@ package main import ( "fmt" + "io" + "os" "github.com/runfinch/finch/pkg/disk" @@ -18,6 +20,7 @@ import ( "github.com/runfinch/finch/pkg/fssh" "github.com/runfinch/finch/pkg/path" "github.com/runfinch/finch/pkg/system" + "github.com/runfinch/finch/pkg/version" "github.com/spf13/afero" "github.com/spf13/cobra" @@ -30,12 +33,19 @@ func main() { stdLib := system.NewStdLib() fs := afero.NewOsFs() mem := fmemory.NewMemory() - if err := xmain(logger, stdLib, fs, stdLib, mem); err != nil { + stdOut := os.Stdout + if err := xmain(logger, stdLib, fs, stdLib, mem, stdOut); err != nil { logger.Fatal(err) } } -func xmain(logger flog.Logger, ffd path.FinchFinderDeps, fs afero.Fs, loadCfgDeps config.LoadSystemDeps, mem fmemory.Memory) error { +func xmain(logger flog.Logger, + ffd path.FinchFinderDeps, + fs afero.Fs, + loadCfgDeps config.LoadSystemDeps, + mem fmemory.Memory, + stdOut io.Writer, +) error { fp, err := path.FindFinch(ffd) if err != nil { return fmt.Errorf("failed to find the installation path of Finch: %w", err) @@ -46,17 +56,17 @@ func xmain(logger flog.Logger, ffd path.FinchFinderDeps, fs afero.Fs, loadCfgDep return fmt.Errorf("failed to load config: %w", err) } - return newApp(logger, fp, fs, fc).Execute() + return newApp(logger, fp, fs, fc, stdOut).Execute() } -var newApp = func(logger flog.Logger, fp path.Finch, fs afero.Fs, fc *config.Finch) *cobra.Command { +var newApp = func(logger flog.Logger, fp path.Finch, fs afero.Fs, fc *config.Finch, stdOut io.Writer) *cobra.Command { usage := fmt.Sprintf("%v ", finchRootCmd) rootCmd := &cobra.Command{ Use: usage, Short: "Finch: open-source container development tool", SilenceUsage: true, SilenceErrors: true, - Version: finchVersion, + Version: version.Version, } // TODO: Decide when to forward --debug to the dependencies // (e.g. nerdctl for container commands and limactl for VM commands). @@ -83,7 +93,7 @@ var newApp = func(logger flog.Logger, fp path.Finch, fs afero.Fs, fc *config.Fin allCommands := initializeNerdctlCommands(lcc, logger) // append finch specific commands allCommands = append(allCommands, - newVersionCommand(), + newVersionCommand(lcc, logger, stdOut), virtualMachineCommands(logger, fp, lcc, ecc, fs, fc), ) diff --git a/cmd/finch/main_test.go b/cmd/finch/main_test.go index 369067912..09a16f50a 100644 --- a/cmd/finch/main_test.go +++ b/cmd/finch/main_test.go @@ -6,6 +6,7 @@ package main import ( "errors" "fmt" + "os" "testing" "gopkg.in/yaml.v3" @@ -14,6 +15,7 @@ import ( "github.com/runfinch/finch/pkg/flog" "github.com/runfinch/finch/pkg/mocks" "github.com/runfinch/finch/pkg/path" + "github.com/runfinch/finch/pkg/version" "github.com/golang/mock/gomock" "github.com/spf13/afero" @@ -111,8 +113,9 @@ func TestXmain(t *testing.T) { loadCfgDeps := mocks.NewLoadSystemDeps(ctrl) mem := mocks.NewMemory(ctrl) fs := afero.NewMemMapFs() + stdOut := os.Stdout tc.mockSvc(logger, ffd, fs, loadCfgDeps, mem) - err := xmain(logger, ffd, fs, loadCfgDeps, mem) + err := xmain(logger, ffd, fs, loadCfgDeps, mem, stdOut) assert.Equal(t, err, tc.wantErr) }) } @@ -125,13 +128,14 @@ func TestNewApp(t *testing.T) { l := mocks.NewLogger(ctrl) fp := path.Finch("") fs := afero.NewMemMapFs() + stdOut := os.Stdout require.NoError(t, afero.WriteFile(fs, "/real/config.yaml", []byte(configStr), 0o600)) - cmd := newApp(l, fp, fs, &config.Finch{}) + cmd := newApp(l, fp, fs, &config.Finch{}, stdOut) assert.Equal(t, cmd.Name(), finchRootCmd) - assert.Equal(t, cmd.Version, finchVersion) + assert.Equal(t, cmd.Version, version.Version) assert.Equal(t, cmd.SilenceUsage, true) assert.Equal(t, cmd.SilenceErrors, true) // confirm the number of command, comprised of nerdctl commands + finch commands (version, vm) diff --git a/cmd/finch/version.go b/cmd/finch/version.go index bf3e39632..6c885c089 100644 --- a/cmd/finch/version.go +++ b/cmd/finch/version.go @@ -4,27 +4,122 @@ package main import ( + "encoding/json" + "errors" "fmt" + "io" "github.com/spf13/cobra" + "github.com/runfinch/finch/pkg/command" + "github.com/runfinch/finch/pkg/flog" + "github.com/runfinch/finch/pkg/lima" "github.com/runfinch/finch/pkg/version" ) -var finchVersion = version.Version - -func newVersionCommand() *cobra.Command { +func newVersionCommand(limaCmdCreator command.LimaCmdCreator, logger flog.Logger, stdOut io.Writer) *cobra.Command { versionCommand := &cobra.Command{ Use: "version", Args: cobra.NoArgs, Short: "Shows Finch version information", - RunE: versionAction, + RunE: newVersionAction(limaCmdCreator, logger, stdOut).runAdapter, } return versionCommand } -func versionAction(cmd *cobra.Command, args []string) error { - fmt.Println("Finch version:", finchVersion) +type versionAction struct { + creator command.LimaCmdCreator + logger flog.Logger + stdOut io.Writer +} + +// NerdctlVersionOutput captures the nerdctl version. +type NerdctlVersionOutput struct { + Client NerdctlClientOuput `json:"Client"` + Server NerdctlServerOutput `json:"Server"` +} + +// NerdctlClientOuput captures the nerdctl Client output. +type NerdctlClientOuput struct { + Version string `json:"Version"` + GitCommit string `json:"GitCommit"` + GoVersion string `json:"GoVersion"` + Os string `json:"Os"` + Arch string `json:"Arch"` + Components []NerdctlComponentsOutput `json:"Components"` +} + +// NerdctlServerOutput captures the nerdctl Server output. +type NerdctlServerOutput struct { + Components []NerdctlComponentsOutput `json:"Components"` +} + +// NerdctlComponentsOutput captures the nerdctl components output. +type NerdctlComponentsOutput struct { + Name string `json:"Name"` + Version string `json:"Version"` + Details struct { + GitCommit string `json:"GitCommit"` + } +} + +func newVersionAction(creator command.LimaCmdCreator, logger flog.Logger, stdOut io.Writer) *versionAction { + return &versionAction{creator: creator, logger: logger, stdOut: stdOut} +} + +func (va *versionAction) runAdapter(cmd *cobra.Command, args []string) error { + return va.run() +} + +func (va *versionAction) run() error { + status, err := lima.GetVMStatus(va.creator, va.logger, limaInstanceName) + if err != nil { + va.printVersion() + return fmt.Errorf("failed to get VM status: %w", err) + } + if status != lima.Running { + va.printVersion() + return errors.New("detailed version info is unavailable because VM is not running") + } + + limaArgs := []string{"shell", limaInstanceName, "nerdctl", "version", "--format", "json"} + out, err := va.creator.CreateWithoutStdio(limaArgs...).Output() + if err != nil { + return fmt.Errorf("failed to create the nerdctl version command: %w", err) + } + + var nerdctlVersion NerdctlVersionOutput + err = json.Unmarshal(out, &nerdctlVersion) + + if err != nil { + va.printVersion() + return fmt.Errorf("failed to JSON-unmarshal the nerdctl version output: %w", err) + } + + fmt.Fprintf(va.stdOut, "Client:\n") + fmt.Fprintf(va.stdOut, " Version:\t%s\n", version.Version) + fmt.Fprintf(va.stdOut, " OS/Arch:\t%s/%s\n", nerdctlVersion.Client.Os, nerdctlVersion.Client.Arch) + fmt.Fprintf(va.stdOut, " GitCommit:\t%s\n", version.GitCommit) + fmt.Fprintf(va.stdOut, " nerdctl:\n") + fmt.Fprintf(va.stdOut, " Version:\t%s\n", nerdctlVersion.Client.Version) + fmt.Fprintf(va.stdOut, " GitCommit:\t%s\n", nerdctlVersion.Client.GitCommit) + for _, compo := range nerdctlVersion.Client.Components { + fmt.Fprintf(va.stdOut, " %s:\n", compo.Name) + fmt.Fprintf(va.stdOut, " Version:\t%s\n", compo.Version) + fmt.Fprintf(va.stdOut, " GitCommit:\t%s\n", compo.Details.GitCommit) + } + fmt.Fprintf(va.stdOut, "\n") + fmt.Fprintf(va.stdOut, "Server:\n") + for _, compo := range nerdctlVersion.Server.Components { + fmt.Fprintf(va.stdOut, " %s:\n", compo.Name) + fmt.Fprintf(va.stdOut, " Version:\t%s\n", compo.Version) + fmt.Fprintf(va.stdOut, " GitCommit:\t%s\n", compo.Details.GitCommit) + } + return nil } + +func (va *versionAction) printVersion() { + (fmt.Fprintf(va.stdOut, "Finch version:\t%s\n", version.Version)) +} diff --git a/cmd/finch/version_test.go b/cmd/finch/version_test.go index 28fcb64d4..7499dfc0d 100644 --- a/cmd/finch/version_test.go +++ b/cmd/finch/version_test.go @@ -5,44 +5,180 @@ package main import ( "bytes" - "io" - "os" + "errors" + "fmt" + "strings" "testing" + "github.com/spf13/cobra" + + "github.com/runfinch/finch/pkg/mocks" + + "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -func captureStdout(t *testing.T, f func()) string { - temp := os.Stdout - read, write, _ := os.Pipe() - os.Stdout = write +func TestNewVersionCommand(t *testing.T) { + t.Parallel() + + ctrl := gomock.NewController(t) + logger := mocks.NewLogger(ctrl) + lcc := mocks.NewLimaCmdCreator(ctrl) + var stdOut bytes.Buffer + cmd := newVersionCommand(lcc, logger, &stdOut) + assert.Equal(t, cmd.Name(), "version") +} + +func TestVersionAction_runAdaptor(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + cmd *cobra.Command + args []string + mockSvc func(*mocks.LimaCmdCreator, *mocks.Logger, *gomock.Controller) + }{ + { + name: "happy path", + cmd: &cobra.Command{ + Use: "version", + }, + args: []string{}, + mockSvc: func(lcc *mocks.LimaCmdCreator, logger *mocks.Logger, ctrl *gomock.Controller) { + getVMStatusC := mocks.NewCommand(ctrl) + lcc.EXPECT().CreateWithoutStdio("ls", "-f", "{{.Status}}", limaInstanceName).Return(getVMStatusC) + getVMStatusC.EXPECT().Output().Return([]byte("Running"), nil) + logger.EXPECT().Debugf("Status of virtual machine: %s", "Running") + + command := mocks.NewCommand(ctrl) + lcc.EXPECT().CreateWithoutStdio("shell", limaInstanceName, "nerdctl", "version", "--format", "json").Return(command) + //nolint: lll // Version output format is larger than 500 + command.EXPECT().Output().Return([]byte(`{"Client":{"Version":"v1.0.0","GitCommit":"c00780a1f5b905b09812722459c54936c9e070e6","GoVersion":"go1.19.2","Os":"linux","Arch":"arm64","Components":[{"Name":"buildctl","Version":"v0.10.5","Details":{"GitCommit":"bc26045116045516ff2427201abd299043eaf8f7"}}]},"Server":{"Components":[{"Name":"containerd","Version":"v1.6.8","Details":{"GitCommit":"9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6"}},{"Name":"runc","Version":"1.1.4","Details":{"GitCommit":"v1.1.4-0-g5fd4c4d1"}}]}}`), nil) + }, + }, + } - f() + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() - require.NoError(t, write.Close()) - os.Stdout = temp + ctrl := gomock.NewController(t) + logger := mocks.NewLogger(ctrl) + lcc := mocks.NewLimaCmdCreator(ctrl) + var stdOut bytes.Buffer + tc.mockSvc(lcc, logger, ctrl) - var buffer bytes.Buffer - _, err := io.Copy(&buffer, read) - require.NoError(t, err) - return buffer.String() + assert.NoError(t, newVersionAction(lcc, logger, &stdOut).runAdapter(tc.cmd, tc.args)) + }) + } } -func TestVersionCommand(t *testing.T) { +func TestVersionAction_run(t *testing.T) { t.Parallel() - cmd := newVersionCommand() - assert.Equal(t, cmd.Name(), "version") -} + testCases := []struct { + name string + wantErr error + cmd *cobra.Command + mockSvc func(*mocks.LimaCmdCreator, *mocks.Logger, *gomock.Controller) + postRunCheck func(t *testing.T, stdout []byte) + }{ + { + name: "print finch version with Client and Server", + wantErr: nil, + cmd: &cobra.Command{ + Use: "version", + }, + mockSvc: func(lcc *mocks.LimaCmdCreator, logger *mocks.Logger, ctrl *gomock.Controller) { + getVMStatusC := mocks.NewCommand(ctrl) + lcc.EXPECT().CreateWithoutStdio("ls", "-f", "{{.Status}}", limaInstanceName).Return(getVMStatusC) + getVMStatusC.EXPECT().Output().Return([]byte("Running"), nil) + logger.EXPECT().Debugf("Status of virtual machine: %s", "Running") + + command := mocks.NewCommand(ctrl) + lcc.EXPECT().CreateWithoutStdio("shell", limaInstanceName, "nerdctl", "version", "--format", "json").Return(command) + //nolint: lll // Version output format is larger than 500 + command.EXPECT().Output().Return([]byte(`{"Client":{"Version":"v1.0.0","GitCommit":"c00780a1f5b905b09812722459c54936c9e070e6","GoVersion":"go1.19.2","Os":"linux","Arch":"arm64","Components":[{"Name":"buildctl","Version":"v0.10.5","Details":{"GitCommit":"bc26045116045516ff2427201abd299043eaf8f7"}}]},"Server":{"Components":[{"Name":"containerd","Version":"v1.6.8","Details":{"GitCommit":"9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6"}},{"Name":"runc","Version":"1.1.4","Details":{"GitCommit":"v1.1.4-0-g5fd4c4d1"}}]}}`), nil) + }, + postRunCheck: func(t *testing.T, stdout []byte) { + lines := strings.SplitAfter(string(stdout), "\n") + require.Len(t, lines, 19) -//nolint:paralleltest // TODO: Add t.Parallel after using dependency injection to pass a io.Writer to newVersionCommand. -func TestVersionAction(t *testing.T) { - mockCmd := newVersionCommand() - versionActionFunc := func() { - require.NoError(t, versionAction(mockCmd, []string{})) + assert.Equal(t, lines[0], "Client:\n") + assert.Equal(t, lines[1], " Version:\t\n") + assert.Equal(t, lines[2], " OS/Arch:\tlinux/arm64\n") + assert.Equal(t, lines[3], " GitCommit:\t\n") + assert.Equal(t, lines[4], " nerdctl:\n") + assert.Equal(t, lines[5], " Version:\tv1.0.0\n") + assert.Equal(t, lines[6], " GitCommit:\tc00780a1f5b905b09812722459c54936c9e070e6\n") + assert.Equal(t, lines[7], " buildctl:\n") + assert.Equal(t, lines[8], " Version:\tv0.10.5\n") + assert.Equal(t, lines[9], " GitCommit:\tbc26045116045516ff2427201abd299043eaf8f7\n") + assert.Equal(t, lines[10], "\n") + assert.Equal(t, lines[11], "Server:\n") + assert.Equal(t, lines[12], " containerd:\n") + assert.Equal(t, lines[13], " Version:\tv1.6.8\n") + assert.Equal(t, lines[14], " GitCommit:\t9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6\n") + assert.Equal(t, lines[15], " runc:\n") + assert.Equal(t, lines[16], " Version:\t1.1.4\n") + assert.Equal(t, lines[17], " GitCommit:\tv1.1.4-0-g5fd4c4d1\n") + assert.Equal(t, lines[18], "") + }, + }, + { + name: "print only finch version only while VM not running", + wantErr: errors.New("detailed version info is unavailable because VM is not running"), + cmd: &cobra.Command{ + Use: "version", + }, + mockSvc: func(lcc *mocks.LimaCmdCreator, logger *mocks.Logger, ctrl *gomock.Controller) { + getVMStatusC := mocks.NewCommand(ctrl) + lcc.EXPECT().CreateWithoutStdio("ls", "-f", "{{.Status}}", limaInstanceName).Return(getVMStatusC) + getVMStatusC.EXPECT().Output().Return([]byte("Stopped"), nil) + logger.EXPECT().Debugf("Status of virtual machine: %s", "Stopped") + }, + postRunCheck: func(t *testing.T, stdout []byte) { + assert.Equal(t, string(stdout), "Finch version:\t\n") + }, + }, + { + name: "print only finch version if VM getting error", + wantErr: fmt.Errorf( + "failed to get VM status: %w", + errors.New("get status error"), + ), + cmd: &cobra.Command{ + Use: "version", + }, + mockSvc: func(lcc *mocks.LimaCmdCreator, logger *mocks.Logger, ctrl *gomock.Controller) { + getVMStatusC := mocks.NewCommand(ctrl) + lcc.EXPECT().CreateWithoutStdio("ls", "-f", "{{.Status}}", limaInstanceName).Return(getVMStatusC) + getVMStatusC.EXPECT().Output().Return([]byte("Broken"), errors.New("get status error")) + }, + postRunCheck: func(t *testing.T, stdout []byte) { + assert.Equal(t, string(stdout), "Finch version:\t\n") + }, + }, } - output := captureStdout(t, versionActionFunc) - assert.Contains(t, output, finchVersion) + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + ctrl := gomock.NewController(t) + logger := mocks.NewLogger(ctrl) + lcc := mocks.NewLimaCmdCreator(ctrl) + + tc.mockSvc(lcc, logger, ctrl) + var stdOut bytes.Buffer + + err := newVersionAction(lcc, logger, &stdOut).run() + assert.Equal(t, tc.wantErr, err) + + tc.postRunCheck(t, stdOut.Bytes()) + }) + } } diff --git a/e2e/version_test.go b/e2e/version_test.go index add2a22a1..405688bb5 100644 --- a/e2e/version_test.go +++ b/e2e/version_test.go @@ -4,8 +4,6 @@ package e2e import ( - "fmt" - "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" "github.com/runfinch/common-tests/command" @@ -14,10 +12,18 @@ import ( "github.com/runfinch/finch/pkg/version" ) +// Checks finch version. var testVersion = func(o *option.Option) { - ginkgo.Context("Version", func() { - ginkgo.Specify("Test version", func() { - gomega.Expect(command.StdoutStr(o, "version")).To(gomega.Equal(fmt.Sprintf("Finch version: %s", version.Version))) + ginkgo.Describe("Check finch version", func() { + ginkgo.It("Should print finch version information", func() { + versionInfo := command.StdoutStr(o, "version") + gomega.Expect(versionInfo).Should(gomega.ContainSubstring(version.Version)) + gomega.Expect(versionInfo).Should(gomega.ContainSubstring(version.GitCommit)) + }) + + ginkgo.It("Should print finch version information", func() { + //nolint: lll // Version output format is larger than 500 character + gomega.Expect(command.StdoutStr(o, "version")).Should(gomega.MatchRegexp("Client:\\s+Version:\\s+v([0-9]+(\\.[0-9]+)+)-[0-9]+-[A-Za-z0-9]+\\s+OS/Arch:\\s+[A-Za-z0-9]+/[A-Za-z0-9]+\\s+GitCommit:\\s+[A-Za-z0-9]+\\s+nerdctl:\\s+Version:\\s+v([0-9]+(\\.[0-9]+)+)\\s+GitCommit:\\s+[A-Za-z0-9]+\\s+buildctl:\\s+Version:\\s+v([0-9]+(\\.[0-9]+)+)\\s+GitCommit:\\s+[A-Za-z0-9]+\\s+Server:\\s+containerd:\\s+Version:\\s+v([0-9]+(\\.[0-9]+)+)\\s+GitCommit:\\s+[A-Za-z0-9]+\\s+runc:\\s+Version:\\s+([A-Za-z0-9]+(\\.[A-Za-z0-9]+)+)\\s+GitCommit:\\s+v([0-9]+(\\.[0-9]+)+)-[0-9]+-[A-Za-z0-9]+")) }) }) } diff --git a/go.mod b/go.mod index 54cc91673..be19e1d81 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/spf13/cobra v1.6.1 github.com/stretchr/testify v1.8.1 github.com/xorcare/pointer v1.2.2 - golang.org/x/crypto v0.5.0 + golang.org/x/crypto v0.4.0 golang.org/x/tools v0.5.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/apimachinery v0.26.0 diff --git a/go.sum b/go.sum index 33faf5aeb..631b1f05a 100644 --- a/go.sum +++ b/go.sum @@ -609,8 +609,8 @@ golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/pkg/version/version.go b/pkg/version/version.go index 568eeca32..9e14d105b 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -5,4 +5,8 @@ package version // Version will be filled via Makefile. -var Version string +var ( + Version string + // GitCommit is filled via Makefile. + GitCommit string +)