Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent panics from missing pulumi events. #578

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions cloud/common/deploy/pulumix/clistream.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ func (p *pulumiEventHandler) handleResourceOutputsEvent(resOutputsEvent *apitype
var nitricResource *resourcespb.ResourceIdentifier
var subResource string

// FIXME: Discover root cause of missing resource nodes
if resourceNode == nil {
logger.Warnf("recieved urn %s for pulumi resource outputs, but wasn't found in resource tree", urn)
return nil, nil
}

if resourceNode.Data != nil && resourceNode.Data.nitricResource != nil {
// we have a nitric resource
nitricResource = resourceNode.Data.nitricResource
Expand Down Expand Up @@ -281,14 +287,16 @@ func StreamPulumiDownEngineEvents(stream deploymentspb.Deployment_DownServer, pu
continue
}

err = stream.Send(&deploymentspb.DeploymentDownEvent{
Content: &deploymentspb.DeploymentDownEvent_Update{
Update: nitricEvent,
},
})
if nitricEvent != nil {
err = stream.Send(&deploymentspb.DeploymentDownEvent{
Content: &deploymentspb.DeploymentDownEvent_Update{
Update: nitricEvent,
},
})

if err != nil {
return err
if err != nil {
return err
}
}
}

Expand Down
Loading