- Added new validation functions for items in slices and maps, allowing for flexible matching and validation based on specified criteria.
- Introduced `SliceItem` function to handle item validation logic, including support for matching and validating based on unique identifiers.
Co-authored-by: Aaron Prindle <aprindle@google.com>
- Introduced MatchFunc type for flexible comparison in EachSliceVal and EachMapVal.
- Support ratcheting for list(eachSliceVal)
- Support ratcheting for map(eachMapVal)
- Added new test cases for various comparable and non-comparable structures.
- Improved error handling and validation checks in the validation generation process.
Co-authored-by: Tim Hockin <thockin@google.com>
Co-authored-by: Aaron Prindle <aprindle@google.com>
- Consolidated type validation checks into a new function for improved readability and maintainability.
- Updated the method to utilize the new validation function, simplifying error handling for unsupported types.
- Removed redundant code related to pointer and map validations, enhancing clarity in the validation process.
- Adjusted test cases in to reflect changes in type handling and ensure consistency with the new validation logic.
Co-authored-by: Tim Hockin <thockin@google.com>
Co-authored-by: Aaron Prindle <aprindle@google.com>
Co-authored-by: Joe Betz <jpbetz@google.com>
- Added FieldValidator interface to allow validation on field definitions.
- Implemented registration and initialization for field validators in the registry.
- Updated validation extraction logic to process field validators after tag and type validators.
- Improved error handling and validation checks in the validation generation process.
Co-authored-by: Tim Hockin <thockin@google.com>
For kube-proxy, node addition and node update is semantically
considered as similar event, we have exactly same handler
logic for these two events resulting in duplicate code and
unit tests.
This merges the `NodeHandler` interface methods OnNodeAdd and
OnNodeUpdate into OnNodeChange along with the implementation
of the interface.
Signed-off-by: Daman Arora <aroradaman@gmail.com>
ProxyHealthServer now consumes NodeManager to get the latest
updated node object for determining node eligibility.
Signed-off-by: Daman Arora <aroradaman@gmail.com>
NodeManager, if configured with to watch for PodCIDR watch, watches
for changes in PodCIDRs and crashes kube-proxy if a change is
detected in PodCIDRs.
Signed-off-by: Daman Arora <aroradaman@gmail.com>
NodeManager initialises node informers, waits for cache sync and polls for
node object to retrieve NodeIPs, handle node events and crashes kube-proxy
when change in NodeIPs is detected.
Signed-off-by: Daman Arora <aroradaman@gmail.com>
This simplifies how the proxier receives update for change in node
labels. Instead of passing the complete Node object we just pass
the proxy relevant topology labels extracted from the complete list
of labels, and the downstream event handlers will only be notified
when there are changes in topology labels.
Signed-off-by: Daman Arora <aroradaman@gmail.com>