Merged
Conversation
Signed-off-by: Jack Francis <jackfrancis@gmail.com>
3 tasks
tallaxes
reviewed
May 4, 2025
tallaxes
reviewed
May 4, 2025
| // Includes returns true if the SKU's name is in the list of SKUs. | ||
| func (s *SKU) Includes(skuList []SKU) bool { | ||
| for _, sku := range skuList { | ||
| if s.GetName() == sku.GetName() { |
There was a problem hiding this comment.
EqualFold might be safer here, depending on where the list is coming from?
Member
Author
There was a problem hiding this comment.
The list would be populated thusly:
And then moved over to the karpenter provider repo for manual curation. I think Name is sufficient if we're going to want to have an easily manageable data structure to maintain.
Signed-off-by: Jack Francis <jackfrancis@gmail.com>
matthchr
reviewed
May 6, 2025
Signed-off-by: Jack Francis <jackfrancis@gmail.com>
tallaxes
approved these changes
May 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an
Includes()filter to the built-inSKUtype (thin wrapper around Azure's SDK track 1compute.ResourceSkutype).This is an expensive filter as it may have to enumerate through an entire list (unbound in size) of SKUs. Only intended for use in cache-enabled data stores.
We also expose a
IncludesFilterFilterFn so that karpenter-provider-azure can call it conveniently from the cache List flow.