Skip to content

Commit 3303ee1

Browse files
committed
Allow init to return provision complete response
1 parent 685c583 commit 3303ee1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

provisioner/terraform/provision.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ func (s *server) Provision(stream proto.DRPCProvisioner_ProvisionStream) error {
113113
s.logger.Debug(ctx, "running initialization")
114114
err = e.init(ctx, killCtx, logr)
115115
if err != nil {
116+
if ctx.Err() != nil {
117+
return stream.Send(&proto.Provision_Response{
118+
Type: &proto.Provision_Response_Complete{
119+
Complete: &proto.Provision_Complete{
120+
Error: err.Error(),
121+
},
122+
},
123+
})
124+
}
116125
return xerrors.Errorf("initialize terraform: %w", err)
117126
}
118127
s.logger.Debug(ctx, "ran initialization")

0 commit comments

Comments
 (0)