()
| 151 | } |
| 152 | |
| 153 | func locationCodeEnvOption() cel.EnvOption { |
| 154 | return cel.Function("locationCode", |
| 155 | cel.Overload("locationCode_string", []*cel.Type{cel.StringType}, cel.StringType, |
| 156 | cel.UnaryBinding(func(ip ref.Val) ref.Val { |
| 157 | switch ip.(types.String) { |
| 158 | case "10.0.0.1": |
| 159 | return types.String("us") |
| 160 | case "10.0.0.2": |
| 161 | return types.String("de") |
| 162 | default: |
| 163 | return types.String("ir") |
| 164 | } |
| 165 | }))) |
| 166 | } |
| 167 | |
| 168 | func k8sParserOpts() policy.ParserOption { |
| 169 | return func(p *policy.Parser) (*policy.Parser, error) { |
no test coverage detected