chore: add-render-event-in-runner
@@ -25,6 +25,7 @@ import (
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/build"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/constants"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/docker"
+ eventV2 "github.com/GoogleContainerTools/skaffold/pkg/skaffold/event/v2"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/instrumentation"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/kubernetes/manifest"
@@ -39,6 +40,7 @@ func (r *SkaffoldRunner) Render(ctx context.Context, out io.Writer, builds []gra
}
defer postRenderFn()
+ eventV2.TaskInProgress(constants.Render, "")
if r.runCtx.RenderOnly() {
// Fetch the digest and append it to the tag with the format of "tag@digest"
if r.runCtx.DigestSource() == constants.RemoteDigestSource {
@@ -46,6 +48,7 @@ func (r *SkaffoldRunner) Render(ctx context.Context, out io.Writer, builds []gra
// remote digest to platform dependant build not supported
digest, err := docker.RemoteDigest(a.Tag, r.runCtx, nil)
if err != nil {
+ eventV2.TaskFailed(constants.Render, err)
return manifest.ManifestListByConfig{}, fmt.Errorf("failed to resolve the digest of %s: does the image exist remotely?", a.Tag)
}
builds[i].Tag = build.TagWithDigest(a.Tag, digest)
@@ -59,10 +62,12 @@ func (r *SkaffoldRunner) Render(ctx context.Context, out io.Writer, builds []gra
ctx, endTrace := instrumentation.StartTrace(ctx, "Render")
manifestList, err := r.renderer.Render(ctx, renderOut, builds, offline)
if err != nil {
+ eventV2.TaskFailed(constants.Render, err)
endTrace(instrumentation.TraceEndError(err))
return manifest.ManifestListByConfig{}, err
}
endTrace()
+ eventV2.TaskSucceeded(constants.Render)
return manifestList, nil
}
