Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementation for hinting on possible error on map create with noPrealloc flag set #1102

Conversation

kwakubiney
Copy link
Member

@kwakubiney kwakubiney commented Jul 25, 2023

Fixes #1072

@kwakubiney kwakubiney changed the title draft: current implementation draft: implementation idea for fixing misleading error on map create Jul 25, 2023
@kwakubiney kwakubiney force-pushed the fix/misleading-error-map-create-with-no-prealloc-flag branch from cc575d2 to 6109ffe Compare July 25, 2023 21:37
@kwakubiney
Copy link
Member Author

The mapCreate() method has a lot going on in it & this makes it more bloated IMO. We could wrap the entire switch statement in its own function at this point.

map.go Outdated Show resolved Hide resolved
@kwakubiney kwakubiney force-pushed the fix/misleading-error-map-create-with-no-prealloc-flag branch 2 times, most recently from 41b9db9 to cdd289f Compare August 8, 2023 17:53
@kwakubiney kwakubiney marked this pull request as ready for review August 8, 2023 17:59
@kwakubiney kwakubiney changed the title draft: implementation idea for fixing misleading error on map create implementation for hinting on possible error on map create with noPrealloc flag set Aug 8, 2023
@kwakubiney kwakubiney force-pushed the fix/misleading-error-map-create-with-no-prealloc-flag branch 2 times, most recently from c99f598 to 02296bb Compare August 8, 2023 23:26
Copy link
Collaborator

@lmb lmb left a comment

Choose a reason for hiding this comment

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

Nice! Could you split your change into two commits?

  1. Move the existing code to a function
  2. Add the new check you want to add

This will make it easier to do code archeology later on.

map.go Show resolved Hide resolved
map.go Outdated Show resolved Hide resolved
@kwakubiney kwakubiney force-pushed the fix/misleading-error-map-create-with-no-prealloc-flag branch 6 times, most recently from 8f22d58 to 95d4a65 Compare August 11, 2023 12:25
Signed-off-by: kwakubiney <kebiney@hotmail.com>
Signed-off-by: kwakubiney <kebiney@hotmail.com>
@kwakubiney kwakubiney force-pushed the fix/misleading-error-map-create-with-no-prealloc-flag branch from 95d4a65 to 90645e3 Compare August 14, 2023 18:40
Copy link
Contributor

@florianl florianl left a comment

Choose a reason for hiding this comment

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

Thanks for the update! Suggested change looks good to me 👍
But I'll leave the final approval to the maintainers.

@lmb lmb merged commit 475814d into cilium:main Sep 11, 2023
1 check passed
@kwakubiney kwakubiney deleted the fix/misleading-error-map-create-with-no-prealloc-flag branch September 11, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn about non-supported flags in map specs
3 participants