Skip to content

Commit

Permalink
Merge pull request kubernetes#387 from droot/glog
Browse files Browse the repository at this point in the history
integrated glog in command structure
  • Loading branch information
k8s-ci-robot authored Mar 30, 2018
2 parents a3fb1a1 + 04ab592 commit d005de0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/kinflate/kinflate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ package main
import (
"os"

"github.com/golang/glog"

"k8s.io/kubectl/pkg/kinflate/commands"
)

func main() {
defer glog.Flush()

if err := commands.NewDefaultCommand().Execute(); err != nil {
os.Exit(1)
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/kinflate/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package commands

import (
"flag"
"io"
"os"

Expand Down Expand Up @@ -50,6 +51,13 @@ Find more information at:
newCmdSet(stdOut, stdErr, fsys),
)

// add the glog flags
c.PersistentFlags().AddGoFlagSet(flag.CommandLine)

// Workaround for this issue:
// https://github.com/kubernetes/kubernetes/issues/17162
flag.CommandLine.Parse([]string{})

return c
}

Expand Down

0 comments on commit d005de0

Please sign in to comment.