Skip to content

Commit 882f1e8

Browse files
l46kokcopybara-github
authored andcommitted
Do not override the container if it's missing from policy config
PiperOrigin-RevId: 653289605
1 parent d82820c commit 882f1e8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

policy/src/main/java/dev/cel/policy/CelPolicyConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ public Cel extend(Cel cel, CelOptions celOptions) throws CelPolicyValidationExce
127127
.map(f -> f.toCelFunctionDecl(celTypeProvider))
128128
.collect(toImmutableList()));
129129

130+
if (!container().isEmpty()) {
131+
celBuilder.setContainer(container());
132+
}
133+
130134
addAllExtensions(celBuilder, celOptions);
131135

132136
return celBuilder.build();

0 commit comments

Comments
 (0)