-
Notifications
You must be signed in to change notification settings - Fork 12
Notify user if deployment will not be cancelled when terminating. #875
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package cli | |
|
||
import ( | ||
"context" | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/DefangLabs/defang/src/pkg/cli/client" | ||
|
@@ -96,6 +97,13 @@ func ComposeUp(ctx context.Context, loader client.Loader, c client.FabricClient, | |
} | ||
deployRequest.DelegationSetId = delegation.DelegationSetId | ||
} | ||
go func() { | ||
<-ctx.Done() | ||
|
||
if errors.Is(ctx.Err(), context.Canceled) || errors.Is(ctx.Err(), context.DeadlineExceeded) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not enough to exclude the natural cancellation of the context from success :(
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So does that mean this PR is not ready to be merged? I wouldn't want the happy path to show "Deployment will not be cancelled". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right this PR is not ready to merge. It's still in draft. |
||
term.Warn("Deployment will not be cancelled.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This message could be less curt. |
||
} | ||
}() | ||
resp, err = p.Deploy(ctx, deployRequest) | ||
if err != nil { | ||
return nil, project, err | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?