Last active
March 28, 2022 17:42
-
-
Save mandarjog/24b37f1685c4b23ccdb8533e223c55b2 to your computer and use it in GitHub Desktop.
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
filters: | |
OR: | |
- { attr.ip: 1.2.3.4/32 } | |
- { attr.ip: 1.2.3.5/32 } | |
- AND: | |
- { attr.region: us-west1 } | |
- { dept: eng } | |
Using a oneof that supports basic and full ast version -
We may not have to change the protobuf defintion if we use the oneof?
message Selector {
oneof ver {
// Basic version is what we will support in phase 1
Basic basic = 1;
// Based on requirements, we can support full AST (The alternative method suggested by Mandar)
FullAst fullast = 2
}
}
message Basic {
repeated MatchExpr expr = 1
}
message MatchExpr {
map <str, str> match = 1
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only using
and, or, match
we get the following outputThe following application domain is defined by the union of a subnet group consisting of two CIDRs, and one VM and VPC expression each.
**Using matchall shortcut **
Alternative
Rendering yaml using the alternative