Fix linting issues

This commit is contained in:
Ian Howell 2019-05-01 12:27:03 -05:00
parent 1d624fb05f
commit 97280aa62d
2 changed files with 8 additions and 3 deletions
internal/test
pkg/kube

@ -37,12 +37,14 @@ func executeCmd(t *testing.T, command string) {
args := strings.Fields(command)
rootCmd.SetArgs(args)
rootCmd.Execute()
if err := rootCmd.Execute(); err != nil {
t.Fatalf(err.Error())
}
goldenFilePath := filepath.Join(goldenFileDir, filepath.FromSlash(t.Name())+".golden")
if *updateGolden {
t.Logf("updating golden file: %s", goldenFilePath)
if err := ioutil.WriteFile(goldenFilePath, actual.Bytes(), 0644); err != nil {
if err := ioutil.WriteFile(goldenFilePath, normalize(actual.Bytes()), 0644); err != nil {
t.Fatalf("failed to update golden file: %s", err)
}
return

@ -16,7 +16,10 @@ func GetClient() *kubernetes.Clientset {
if err != nil {
panic(err.Error())
}
kubeconfig = flag.String("kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file")
// TODO(howell): This was example code. The flag parsing needs to be
// moved to a command
fp := filepath.Join(home, ".kube", "config")
kubeconfig = flag.String("kubeconfig", fp, "(optional) absolute path to the kubeconfig file")
flag.Parse()
// use the current context in kubeconfig