From 23ee51c8c4e8a33d76f65c27818e3bf12f93e495 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 5 Nov 2024 14:48:22 +0000 Subject: [PATCH] Updated code to show how renderStatus is handled --- pkg/engine/engine.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index f0f74f9a..07bafc51 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -1004,11 +1004,12 @@ func (cad *cadEngine) UpdatePackageResources(ctx context.Context, repositoryObj Contents: prevResources.Spec.Resources, } - appliedResources, renderStatus, err := applyResourceMutations(ctx, draft, resources, mutations) + appliedResources, _, err := applyResourceMutations(ctx, draft, resources, mutations) if err != nil { return nil, nil, err } + var renderStatus *api.RenderStatus if len(appliedResources.Contents) > 0 { // render the package // Render failure will not fail the overall API operation. @@ -1023,7 +1024,10 @@ func (cad *cadEngine) UpdatePackageResources(ctx context.Context, repositoryObj runnerOptions: runnerOptions, runtime: cad.runtime, }}) + } else { + renderStatus = nil } + // No lifecycle change when updating package resources; updates are done. repoPkgRev, err := draft.Close(ctx) if err != nil {