mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-18 05:35:10 +00:00
fix response url
This commit is contained in:
@@ -331,6 +331,18 @@ func (e *GoogleApp) Run(ctx context.Context, req *pb.RunRequest, rsp *pb.RunResp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make copy
|
||||||
|
srv := new(pb.Service)
|
||||||
|
*srv = *service
|
||||||
|
|
||||||
|
// set the custom domain
|
||||||
|
if len(e.domain) > 0 {
|
||||||
|
srv.Url = fmt.Sprintf("https://%s.%s", srv.Id, e.domain)
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the service in the response
|
||||||
|
rsp.Service = srv
|
||||||
|
|
||||||
go func(service *pb.Service) {
|
go func(service *pb.Service) {
|
||||||
// generate a unique service account for the app
|
// generate a unique service account for the app
|
||||||
// https://jsoverson.medium.com/how-to-deploy-node-js-functions-to-google-cloud-8bba05e9c10a
|
// https://jsoverson.medium.com/how-to-deploy-node-js-functions-to-google-cloud-8bba05e9c10a
|
||||||
@@ -399,9 +411,6 @@ func (e *GoogleApp) Run(ctx context.Context, req *pb.RunRequest, rsp *pb.RunResp
|
|||||||
}
|
}
|
||||||
}(service)
|
}(service)
|
||||||
|
|
||||||
// set the service in the response
|
|
||||||
rsp.Service = service
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,6 +564,10 @@ func (e *GoogleApp) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.D
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if srv.Status == "Deploying" {
|
||||||
|
return errors.BadRequest("app.run", "app is being deployed")
|
||||||
|
}
|
||||||
|
|
||||||
// execute the delete async
|
// execute the delete async
|
||||||
go func(srv *pb.Service) {
|
go func(srv *pb.Service) {
|
||||||
cmd := exec.Command("gcloud", "--quiet", "--project", e.project, "run", "services", "delete", "--region", srv.Region, srv.Id)
|
cmd := exec.Command("gcloud", "--quiet", "--project", e.project, "run", "services", "delete", "--region", srv.Region, srv.Id)
|
||||||
|
|||||||
Reference in New Issue
Block a user