-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
(#128) Throw an error when bash is not installed in the target container #129
Changes from 2 commits
37e3ccb
8e056de
1a20327
b04cfb9
77fdafa
2b059e2
e7cea2d
4f128b8
d121153
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 |
---|---|---|
|
@@ -88,13 +88,15 @@ func (hp *HostPortStrategy) WaitUntilReady(ctx context.Context, target StrategyT | |
//internal check | ||
command := buildInternalCheckCommand(hp.Port.Int()) | ||
for { | ||
exitCode, err := target.Exec(ctx, []string{"/bin/bash", "-c", command}) | ||
exitCode, err := target.Exec(ctx, []string{"/bin/sh", "-c", command}) | ||
if err != nil { | ||
return errors.Wrapf(err, "host port waiting failed") | ||
} | ||
|
||
if exitCode == 0 { | ||
break | ||
} else if exitCode == 126 { | ||
return errors.New("/bin/sh command not executable") | ||
mdelapenya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
|
@@ -105,7 +107,7 @@ func buildInternalCheckCommand(internalPort int) string { | |
command := `( | ||
cat /proc/net/tcp{,6} | awk '{print $2}' | grep -i :%x || | ||
nc -vz -w 1 localhost %d || | ||
/bin/bash -c '</dev/tcp/localhost/%d' | ||
/bin/sh -c '</dev/tcp/localhost/%d' | ||
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 unnecessary, I believe. External command fix should be enough. 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. Hey, sorry for the late response. I'll revert this change and resend. TBH, not sure why the travis tests fail tough. 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. Mmmm, thinking about it, the internal command should be |
||
) | ||
` | ||
return "true && " + fmt.Sprintf(command, internalPort, internalPort, internalPort) | ||
|
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.
it was a bug, yes, sorry for that