From ae40f78a8f32db02ad2bb025f0e625a12117cf6a Mon Sep 17 00:00:00 2001 From: Benjamin Kaplan <58792807+bskaplan@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:04:35 -0700 Subject: [PATCH] fix: emit CloudRunServiceReady event even if default url is disabled (#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 --- pkg/skaffold/deploy/cloudrun/status.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/skaffold/deploy/cloudrun/status.go b/pkg/skaffold/deploy/cloudrun/status.go index b5d59ffea52..aef7abea5cc 100644 --- a/pkg/skaffold/deploy/cloudrun/status.go +++ b/pkg/skaffold/deploy/cloudrun/status.go @@ -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())) } } @@ -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 {