-
Notifications
You must be signed in to change notification settings - Fork 29
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
Further options for filtering catalog services #532
Further options for filtering catalog services #532
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment on the pattern used in your list getters. What do you think ?
} | ||
|
||
public List<String> getExcludeKeywords() { | ||
if (excludeKeywords == null) return new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of this pattern of returning different references. In some cases it may leads to odd bugs if the caller then adds items to the returned list for example.
In one case the item would be added to the "real" list but if the list is null then the item would be added to a transient list and will not show up in a next get call.
Wouldn't it suffise to have default empty lists for each variable ? IIRC all objectmappers / json / yaml deserializers has been configured to set an empty list and not a null list so we should be safe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olevitt Yes I agree, good point, I'll make that change 👍
Quality Gate passedIssues Measures |
Thank you ! 👍 |
Functionality implemented
Supports filtering services based on Helm chart attributes:
Limitations
Currently can't include multiple values of the same annotation key (e.g. both
lifecycle: production
,lifecycle: experimental
) since the values are supplied in a map and the keys would be duplicated. This could be improved in the future.Commit summary