Skip to content

Commit

Permalink
fix: emit CloudRunServiceReady event even if default url is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bskaplan committed Sep 10, 2024
1 parent 1d83c09 commit 18e7ba5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 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,13 @@ 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
if url == "" {
// a URL may not be present if the default URL is disabled. Use - instead of empty in case anyone is parsing the
// event status
url = "-"
}
eventV2.CloudRunServiceReady(r.path, url, r.latestRevision)
}

type runJobResource struct {
Expand Down

0 comments on commit 18e7ba5

Please sign in to comment.