Fix slice append error (spec.Linux.Resources.HugepageLimits)#7661
Fix slice append error (spec.Linux.Resources.HugepageLimits)#7661estesp merged 1 commit intocontainerd:mainfrom
spec.Linux.Resources.HugepageLimits)#7661Conversation
|
Hi @liubin. 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. |
|
Indeed I got some errors like this:
|
In golang when copy a slice, if the slice is initialized with a desired length, then appending to it will cause the size double. Signed-off-by: bin liu <[email protected]>
d924366 to
0c63c42
Compare
spec.Linux.Resources.HugepageLimits)
|
/ok-to-test |
Signed-off-by: Maksym Pavlenko <[email protected]>
|
|
||
| if spec.Linux.Resources.HugepageLimits != nil { | ||
| hugepageLimits := make([]*runtime.HugepageLimit, len(spec.Linux.Resources.HugepageLimits)) | ||
| hugepageLimits := make([]*runtime.HugepageLimit, 0) |
There was a problem hiding this comment.
Is this the correct fix? Should this have been;
hugepageLimits := make([]*runtime.HugepageLimit, 0, len(spec.Linux.Resources.HugepageLimits))(zero length, with an initial capacity of len(spec.Linux.Resources.HugepageLimits)) ?
|
Opened a cherry-pick for 1.6 (#7995), but looks like this code is not in 1.5 (unless it was moved from somewhere else) |
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
… main Updates ADO containerd fork-external/main with upstream containerd main @commit hash: f9f8455 containerd@f9f8455 Additional changes in the PR: - update linux container image version - remove copying LICENSE file in shared-build-stages.yml - additions to .gdnsuppress Related work items: containerd#5674, containerd#7393, containerd#7661, containerd#7685, containerd#7810, containerd#7850, containerd#7861, containerd#7879, containerd#7880, containerd#7881, containerd#7882, containerd#7883, containerd#7886, containerd#7887, containerd#7888, containerd#7891, containerd#7892, containerd#7893, containerd#7894, containerd#7903, containerd#7904, containerd#7905, containerd#7906, containerd#7907, containerd#7908, containerd#7911, containerd#7913, containerd#7914, containerd#7917, containerd#7925, containerd#7927, containerd#7928, containerd#7929, containerd#7932, containerd#7935, containerd#7943, containerd#7946, containerd#7948, containerd#7957, containerd#7958, containerd#7960, containerd#7963, containerd#7969, containerd#7970, containerd#7973
…/main Update fork-external/main with upstream containerd/containerd/main at commit hash 3d32da8 Related work items: containerd#5674, containerd#7129, containerd#7393, containerd#7661, containerd#7685, containerd#7810, containerd#7850, containerd#7861, containerd#7882, containerd#7883, containerd#7886, containerd#7891, containerd#7892, containerd#7893, containerd#7903, containerd#7904, containerd#7905, containerd#7906, containerd#7907, containerd#7908, containerd#7911, containerd#7913, containerd#7914, containerd#7917, containerd#7925, containerd#7927, containerd#7928, containerd#7929, containerd#7932, containerd#7935, containerd#7943, containerd#7946, containerd#7948, containerd#7957, containerd#7958, containerd#7959, containerd#7960, containerd#7963, containerd#7968, containerd#7969, containerd#7970, containerd#7973, containerd#7985, containerd#7987, containerd#7994, containerd#8005
In golang when copying a slice, if the slice is initialized with a desired length, then appending to it will cause the size to double.
Signed-off-by: bin liu [email protected]