Skip to content

Commit

Permalink
Handle missing tail permissions on down (#945)
Browse files Browse the repository at this point in the history
* handle missing tail permissions on down

* update buf protoc-gen-go

* detach without tail permissions on down

* remove redundant Delete permission
  • Loading branch information
jordanstephens authored Jan 9, 2025
1 parent 582b7c0 commit bddc7a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/cmd/cli/command/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,17 @@ func makeComposeDownCmd() *cobra.Command {
Verbose: verbose,
LogType: logs.LogTypeAll,
}
err = cli.Tail(cmd.Context(), provider, projectName, tailOptions)
tailCtx := cmd.Context()
err = cli.Tail(tailCtx, provider, projectName, tailOptions)
if err != nil {
if connect.CodeOf(err) == connect.CodePermissionDenied {
// If tail fails because of missing permission, we show a warning and detach. This is
// different than `up`, which will wait for the deployment to finish, but we don't have an
// ECS event subscription for `down` so we can't wait for the deployment to finish.
// Instead, we'll just show a warning and detach.
term.Warn("Unable to tail logs. Detaching.")
return nil
}
return err
}
term.Info("Done.")
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/scope/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ func (s Scope) String() string {
}

func All() []Scope {
return []Scope{Admin, Delete, Read, Tail, Delete}
return []Scope{Admin, Delete, Read, Tail}
}
2 changes: 1 addition & 1 deletion src/protos/io/defang/v1/fabric.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bddc7a4

Please sign in to comment.