add better error message for pgo create pgpool when cluster is not found
@@ -63,7 +63,12 @@ func CreatePgpool(request *msgs.CreatePgpoolRequest) msgs.CreatePgpoolResponse {
found, err := kubeapi.Getpgcluster(apiserver.RESTClient,
&argCluster, request.Args[i], apiserver.Namespace)
- if !found || err != nil {
+ if !found {
+ resp.Status.Msg = request.Args[i] + " was not found"
+ resp.Status.Code = msgs.Error
+ return resp
+ }
+ if err != nil {
resp.Status.Code = msgs.Error
resp.Status.Msg = err.Error()
return resp
