Skip to content

Commit

Permalink
Updated code to show how renderStatus is handled
Browse files Browse the repository at this point in the history
  • Loading branch information
liamfallon committed Nov 5, 2024
1 parent f8383e5 commit 23ee51c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down

0 comments on commit 23ee51c

Please sign in to comment.