Skip to content

Commit

Permalink
Bugfix(precheck): only check TCP socket while check port in use.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wine93 committed Apr 18, 2023
1 parent d59ff96 commit e6ed0b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/task/step/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ type (
Filter string
Listening bool // display listening sockets
NoHeader bool // Suppress header line
TCP bool // display only TCP sockets
Success *bool
Out *string
module.ExecOptions
Expand Down Expand Up @@ -414,6 +415,9 @@ func (s *SocketStatistics) Execute(ctx *context.Context) error {
if s.NoHeader {
cmd.AddOption("--no-header")
}
if s.TCP {
cmd.AddOption("--tcp")
}

out, err := cmd.Execute(s.ExecOptions)
return PostHandle(s.Success, s.Out, out, err, errno.ERR_GET_CONNECTION_INFORMATION_FAILED)
Expand Down
1 change: 1 addition & 0 deletions internal/task/task/checker/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func NewCheckPortInUseTask(curveadm *cli.CurveAdm, dc *topology.DeployConfig) (*
Filter: fmt.Sprintf(FORMAT_FILTER_SPORT, address.Port),
Listening: true,
NoHeader: true,
TCP: true,
Success: &success,
Out: &out,
ExecOptions: curveadm.ExecOptions(),
Expand Down

0 comments on commit e6ed0b6

Please sign in to comment.