Skip to content

Commit

Permalink
Do not override the container if it's missing from policy config
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 653392239
  • Loading branch information
l46kok authored and copybara-github committed Jul 17, 2024
1 parent d82820c commit 995243c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions policy/src/main/java/dev/cel/policy/CelPolicyConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ public Cel extend(Cel cel, CelOptions celOptions) throws CelPolicyValidationExce
.map(f -> f.toCelFunctionDecl(celTypeProvider))
.collect(toImmutableList()));

if (!container().isEmpty()) {
celBuilder.setContainer(container());
}

addAllExtensions(celBuilder, celOptions);

return celBuilder.build();
Expand Down

0 comments on commit 995243c

Please sign in to comment.