cri: append envs from image config to empty slice to avoid env lost #5024
cri: append envs from image config to empty slice to avoid env lost #5024estesp merged 1 commit intocontainerd:masterfrom
Conversation
|
Hi @yadzhang. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Build succeeded.
|
|
Could you please sign off your commits (try |
d93da42 to
82f27d1
Compare
|
Build succeeded.
|
Done, Thanks. |
|
CI failure seems to related to #4924. |
Signed-off-by: Yadong Zhang <yadzhang@gmail.com>
82f27d1 to
08318b1
Compare
|
Build succeeded.
|
Not sure it is flaky case. rerun the CI. |
|
Hmm... |
Fix #5023
When call CreateContainer for multiple pods with the same image config but different envs in container spec at nearly the same time, they get image config from imagestore but the Envs slice in the image config is pointing to the same object. The Envs is json.Unmarshal from the content db, so the cap and len of the Envs slice maybe not equal.
So the operation for appending container env into the image env may cause the first few envs of the first container is overlapped by the second container (maybe from another pods) with some probability if the two container has the same image and created at the very near same time.
To resolve this, we can deepcopy image config directly after get image to avoid env or other field conflict.