Skip to content

Conversation

rusttech
Copy link
Contributor

@rusttech rusttech commented Oct 2, 2024

Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Are you a user of Cilium? Please add yourself to the Users doc
  • Thanks for contributing!

The intention here should be to initialize a slice with a capacity of len(podsList.Items) rather than initializing the length of this slice.

Fix bug in testsuite where a list of Pods was initialized with several empty elements rather than allocating the buffer with space for enough elements.

@rusttech rusttech requested a review from a team as a code owner October 2, 2024 05:50
@rusttech rusttech requested a review from nebril October 2, 2024 05:50
@maintainer-s-little-helper
Copy link

Commit 3746263 does not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Oct 2, 2024
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Oct 2, 2024
@nebril
Copy link
Member

nebril commented Oct 2, 2024

@rusttech thanks for the PR! Can you elaborate a bit in the commit description what exact issue is this change fixing, how did you test that performance is better before and after the change (I assume there is a performance issue caused by unnecessary allocations made by append) ?

Also please follow instructions from the comment above to sign off the commit.

@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Oct 3, 2024
@rusttech
Copy link
Contributor Author

rusttech commented Oct 3, 2024

@rusttech thanks for the PR! Can you elaborate a bit in the commit description what exact issue is this change fixing, how did you test that performance is better before and after the change (I assume there is a performance issue caused by unnecessary allocations made by append) ?

Also please follow instructions from the comment above to sign off the commit.

Thanks. I have add sign off info.

As for the change, the current code, because the length of the initialization slice is len (podsList. Items), will ultimately result in the first len (podsList. Items) elements of pods not being the target value, but podsList The null value corresponding to Items

The online demo: https://go.dev/play/p/q1BcVCmvidW

@joestringer joestringer added the release-note/ci This PR makes changes to the CI. label Oct 3, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Oct 3, 2024
@joestringer
Copy link
Member

/test

@joestringer
Copy link
Member

(I just realized that this PR might end up failing CI due to the breakage in main yesterday. We might need to click the "Update with rebase" button under the "This branch is out-of-date ..." section at the bottom of the page)

Signed-off-by: rusttech <gopher@before.tech>
@nebril
Copy link
Member

nebril commented Oct 4, 2024

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Oct 4, 2024
@julianwiedmann julianwiedmann added this pull request to the merge queue Oct 4, 2024
Merged via the queue into cilium:main with commit 228d972 Oct 4, 2024
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants