Skip to content

Commit

Permalink
Merge pull request #396 from ZipRecruiter/fix-deps-rebased
Browse files Browse the repository at this point in the history
Fix deps
  • Loading branch information
k8s-ci-robot committed Nov 23, 2021
2 parents 729e87b + 5de74c7 commit d1861ea
Show file tree
Hide file tree
Showing 15 changed files with 89 additions and 1,084 deletions.
22 changes: 19 additions & 3 deletions cmd/aws-iam-authenticator/version.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package main

import (
"encoding/json"
"fmt"
"os"

"github.com/spf13/cobra"
goversion "go.hein.dev/go-version"
"gopkg.in/yaml.v2"
"sigs.k8s.io/aws-iam-authenticator/pkg"
)

Expand All @@ -17,8 +19,22 @@ var (
Short: "Version will output the current build information",
Long: ``,
Run: func(_ *cobra.Command, _ []string) {
resp := goversion.FuncWithOutput(shortened, pkg.Version, pkg.CommitID, pkg.BuildDate, output)
fmt.Print(resp)
ver := struct {
Version string `json:"Version,omitempty"`
Commit string `json:"Commit,omitempty"`
Date string `json:"Date,omitempty"`
}{pkg.Version, pkg.CommitID, date}

switch {
case shortened:
fmt.Println(pkg.Version)
case output == "json":
json.NewEncoder(os.Stdout).Encode(ver)
case output == "yaml":
yaml.NewEncoder(os.Stdout).Encode(ver)
default:
fmt.Fprintln(os.Stderr, "unknown version option")
}
return
},
}
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ require (
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.0
go.hein.dev/go-version v0.1.0
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.22.1 // indirect
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
k8s.io/code-generator v0.22.1
Expand Down
449 changes: 70 additions & 379 deletions go.sum

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion vendor/go.hein.dev/go-version/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/go.hein.dev/go-version/.travis.yml

This file was deleted.

36 changes: 0 additions & 36 deletions vendor/go.hein.dev/go-version/CHANGELOG.md

This file was deleted.

31 changes: 0 additions & 31 deletions vendor/go.hein.dev/go-version/CONTRIBUTING.adoc

This file was deleted.

201 changes: 0 additions & 201 deletions vendor/go.hein.dev/go-version/LICENSE.txt

This file was deleted.

38 changes: 0 additions & 38 deletions vendor/go.hein.dev/go-version/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion vendor/go.hein.dev/go-version/VERSION

This file was deleted.

Loading

0 comments on commit d1861ea

Please sign in to comment.