Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Conversation

carmark
Copy link
Contributor

@carmark carmark commented Mar 1, 2017

[lei@h8s-single hypercli]$ pkt compose run test ping -c 2 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=55 time=3.401 ms
64 bytes from 8.8.8.8: seq=1 ttl=55 time=2.320 ms

--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 2.320/2.860/3.401 ms
[lei@h8s-single hypercli]$ echo $?
0
[lei@h8s-single hypercli]$ pkt compose run --rm test ping -c 2 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=55 time=3.212 ms
64 bytes from 8.8.8.8: seq=1 ttl=55 time=2.421 ms

--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 2.421/2.816/3.212 ms
INFO[0012] Project [hypercli]: Deleting project
INFO[0012] [0/1] [test]: Deleting
INFO[0022] [0/1] [test]: Deleted
INFO[0022] Project [hypercli]: Project deleted
[lei@h8s-single hypercli]$ echo $?
0
[lei@h8s-single hypercli]$ pkt compose run test haha
exec failed: No such file or directory
[lei@h8s-single hypercli]$ echo $?
127
[lei@h8s-single hypercli]$ pkt compose run --rm test haha
exec failed: No such file or directory
INFO[0010] Project [hypercli]: Deleting project
INFO[0010] [0/1] [test]: Deleting
INFO[0012] [0/1] [test]: Deleted
INFO[0012] Project [hypercli]: Project deleted
[lei@h8s-single hypercli]$ echo $?
127

@carmark carmark closed this Mar 1, 2017
@carmark carmark reopened this Mar 1, 2017
@carmark carmark requested a review from gnawux March 1, 2017 05:48
}

if err := <-errCh; err != nil {
logrus.Debugf("Error hijack: %s", err)
return -1, err
return -1, container.ID, err
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do containerWait here? Then we do not need to change the interface, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need know whether the user want to remove the container after it, they have different operations. If we do not change the interface, we have to provide the flag of *rm to this function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference? I think wait its exist and getExitCode should work for both of the cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot get explanation from the run code. Please just tell why not wait stop and get exit code.

@carmark
Copy link
Contributor Author

carmark commented Apr 6, 2017

@gnawux updated

@carmark carmark merged commit 2f3b6a6 into hyperhq:master Apr 13, 2017
@carmark carmark deleted the compose_exitcode branch June 19, 2017 01:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants