mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
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:
parent
cf7a4f8f51
commit
70a2643fdf
@ -90,12 +90,10 @@ func NewCmdCanI(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
|
|||||||
|
|
||||||
allowed, err := o.RunAccessCheck()
|
allowed, err := o.RunAccessCheck()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if o.Quiet && !allowed {
|
if o.Quiet && !allowed {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cmdutil.CheckErr(err)
|
cmdutil.CheckErr(err)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user