containers / virtcontainers

A Go package for building hardware virtualized container runtimes
Apache License 2.0
139 stars 43 forks source link

container: Fix container semantics #592

Closed sboeuf closed 6 years ago

sboeuf commented 6 years ago

This pull request ensure the container pointers held by the pod structure are not duplicated. This is needed to avoid a container pointer modification not to be taken into account because the wrong pointer is used.

Fixes #588

sboeuf commented 6 years ago

cc @devimc @sameo

jodh-intel commented 6 years ago

Hi @sboeuf - please can you add some unit tests for this change.

devimc commented 6 years ago

lgtm

sboeuf commented 6 years ago

@jodh-intel I have added unit tests in order to cover fetchContainer() function since this is the one that matters here. It makes sure we retrieve the container pointer coming from the list of containers held by the pod structure.

jodh-intel commented 6 years ago

Thanks @sboeuf.

lgtm

Approved with PullApprove Approved with PullApprove

egernst commented 6 years ago

Nice.

LGTM

sboeuf commented 6 years ago

@sameo comments addressed, I have replaced the function fetchContainer() with findContainer(), which is more appropriate about the naming.

sameo commented 6 years ago

LGTM

Approved with PullApprove Approved with PullApprove