-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix normalizing fields with empty objects/slices (#2576)
### Proposed changes This PR further improves the resource normalization logic. Prior to this merge, field values that consists of an empty `map[string]interface{}` or empty slice would be discarded. This means that normalizing `{parentField: {childField: {} }}` would result in the childField being unset as the empty object (`{}`) value for `childField` is discarded. In Kubernetes resources, especially when defining NetworkPolicies and ingress/egress rules, `{}` != unset field. A new test case is added to validate that normalizing NetworkPolicy resources does not result in unwanted behaviour. To do this, the GKE cluster we spin up for testing also enables the Calico network enforcement. ### Related issues (optional) Fixes: #2538
- Loading branch information
Showing
13 changed files
with
462 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: network-policy-tests | ||
description: Tests NetworkPolicy egress/ingress rules | ||
runtime: nodejs |
Oops, something went wrong.