fix return value of "kubectl auth cani --quiet"

Before this change:
$ kubectl auth can-i get pod
no
$ kubectl auth can-i get pod --quiet
$ echo $?
0

After this change:
$ kubectl auth can-i get pod
no
$ kubectl auth can-i get pod --quiet
$ echo $?
1
This commit is contained in:
Cao Shufeng 2017-03-31 07:02:52 -04:00
parent cf7a4f8f51
commit 70a2643fdf

View File

@ -90,11 +90,9 @@ func NewCmdCanI(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
allowed, err := o.RunAccessCheck()
if err == nil {
return
}
if o.Quiet && !allowed {
os.Exit(1)
if o.Quiet && !allowed {
os.Exit(1)
}
}
cmdutil.CheckErr(err)