Skip to content

Commit 4ad9268

Browse files
author
jmccormick2001
committed
add error message back to CLI when pgo create user has no matching clusters found
1 parent a565dc2 commit 4ad9268

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apiserver/userservice/userimpl.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,12 @@ func CreateUser(request *msgs.CreateUserRequest) msgs.CreateUserResponse {
492492
return resp
493493
}
494494

495+
if len(clusterList.Items) == 0 {
496+
resp.Status.Code = msgs.Error
497+
resp.Status.Msg = "no clusters found with that selector"
498+
return resp
499+
}
500+
495501
log.Debug("createUser clusters found len is %d\n", len(clusterList.Items))
496502

497503
for _, c := range clusterList.Items {
@@ -729,4 +735,3 @@ func reconfigurePgpool(clusterName string) error {
729735
}
730736
return err
731737
}
732-

0 commit comments

Comments
 (0)