Merge pull request #387 from droot/glog
integrated glog in command structure
This commit is contained in:
commit
d005de0dab
|
|
@ -19,10 +19,14 @@ package main
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/golang/glog"
|
||||||
|
|
||||||
"k8s.io/kubectl/pkg/kinflate/commands"
|
"k8s.io/kubectl/pkg/kinflate/commands"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
defer glog.Flush()
|
||||||
|
|
||||||
if err := commands.NewDefaultCommand().Execute(); err != nil {
|
if err := commands.NewDefaultCommand().Execute(); err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
|
@ -50,6 +51,13 @@ Find more information at:
|
||||||
newCmdSet(stdOut, stdErr, fsys),
|
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
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue