Skip to content

Commit

Permalink
fix: emit CloudRunServiceReady event even if default url is disabled (G…
Browse files Browse the repository at this point in the history
…oogleContainerTools#9523)

* fix: emit CloudRunServiceReady event even if default url is disabled

* fix: correct lint error

* fix: have empty url instead of dash in cloud run service ready event if no URL is available
  • Loading branch information
bskaplan authored Sep 20, 2024
1 parent da42594 commit ae40f78
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/skaffold/deploy/cloudrun/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ func (s *Monitor) printStatusCheckSummary(out io.Writer, c *counter, r *runResou
return
}
eventV2.ResourceStatusCheckEventCompleted(r.resource.String(), curStatus.ae)
r.sub.reportSuccess()
if curStatus.ae.ErrCode != proto.StatusCode_STATUSCHECK_SUCCESS {
output.Default.Fprintln(out, fmt.Sprintf("Cloud Run %s %s failed with error: %s", r.resource.Type(), r.resource.Name(), curStatus.ae.Message))
} else {
r.sub.reportSuccess()
output.Default.Fprintln(out, fmt.Sprintf("Cloud Run %s %s finished: %s. %s", r.resource.Type(), r.resource.Name(), curStatus.ae.Message, c.remaining()))
}
}
Expand Down Expand Up @@ -344,9 +344,8 @@ func (r *runServiceResource) getTerminalStatus(crClient *run.APIService) (*run.G
return ready, nil
}
func (r *runServiceResource) reportSuccess() {
if r.url != "" {
eventV2.CloudRunServiceReady(r.path, r.url, r.latestRevision)
}
url := r.url
eventV2.CloudRunServiceReady(r.path, url, r.latestRevision)
}

type runJobResource struct {
Expand Down

0 comments on commit ae40f78

Please sign in to comment.