Skip to content

Commit 355d281

Browse files
authored
Merge pull request cli#4189 from cuonglm/issue-4188
Disable auth for cobra shell request completion hidden commands
2 parents a94cadc + 6cf6bb4 commit 355d281

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/cmdutil/auth_check.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ func CheckAuth(cfg config.Config) bool {
3434
}
3535

3636
func IsAuthCheckEnabled(cmd *cobra.Command) bool {
37-
if cmd.Name() == "help" {
37+
switch cmd.Name() {
38+
case "help", cobra.ShellCompRequestCmd, cobra.ShellCompNoDescRequestCmd:
3839
return false
3940
}
41+
4042
for c := cmd; c.Parent() != nil; c = c.Parent() {
4143
if c.Annotations != nil && c.Annotations["skipAuthCheck"] == "true" {
4244
return false

0 commit comments

Comments
 (0)