Skip to content

Commit

Permalink
save the spec to the status event when a resource is deleted
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
skeeey committed Dec 9, 2024
1 parent 9cd5faf commit 6f4069c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/maestro/server/grpc_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func (bkr *GRPCBroker) Publish(ctx context.Context, pubReq *pbv1.PublishRequest)
}

// handle the resource status update according status update type
fmt.Printf(">>>>broker id, %s\n", resource.ID)
if err := handleStatusUpdate(ctx, resource, bkr.resourceService, bkr.statusEventService); err != nil {
return nil, fmt.Errorf("failed to handle resource status update %s: %s", resource.ID, err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/maestro/server/pulse_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func handleStatusUpdate(ctx context.Context, resource *api.Resource, resourceSer

// if the resource has been deleted from agent, create status event and delete it from maestro
if meta.IsStatusConditionTrue(statusPayload.Conditions, common.ManifestsDeleted) {
fmt.Printf(">>>>found payload, %v", found.Payload)
fmt.Printf(">>>>found payload, %s, %v\n", found.ID, found.Payload)

_, sErr := statusEventService.Create(ctx, &api.StatusEvent{
ResourceID: resource.ID,
Expand Down

0 comments on commit 6f4069c

Please sign in to comment.