Skip to content

Commit 40c02a6

Browse files
authored
fix(ksonnet-util): make configMapItems optional (#309)
1 parent 2ca7d42 commit 40c02a6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ksonnet-util/kausal.libsonnet

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ k {
3535

3636
// Expose volumes type.
3737
volume:: $.core.v1.pod.mixin.spec.volumesType {
38-
// Remove items parameter from fromConfigMap
39-
fromConfigMap(name, configMapName)::
40-
super.withName(name) +
41-
super.mixin.configMap.withName(configMapName),
38+
// Make items parameter optional from fromConfigMap
39+
fromConfigMap(name, configMapName, configMapItems=[])::
40+
{
41+
configMap+:
42+
if configMapItems == [] then { items:: null }
43+
else {},
44+
}
45+
+ super.fromConfigMap(name, configMapName, configMapItems),
4246

4347
// Shortcut constructor for secret volumes.
4448
fromSecret(name, secret)::

0 commit comments

Comments
 (0)