Skip to content

Commit

Permalink
replace CUE list addition with list.Concat (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan authored Sep 2, 2024
1 parent 05210f1 commit 55783a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cue.lib/kubernetes/apps.cue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import (
"command": [command]
}
if args != null {
"args": [ for k, v in args if v == null {k}] + list.FlattenN([ for k, v in args if v != null {[k, v]}], -1)
"args": list.Concat([[ for k, v in args if v == null {k}], list.FlattenN([ for k, v in args if v != null {[k, v]}], -1)])
}
"volumeMounts": *[ for mp, c in _volumeMounts_ {mountPath: mp, c}] | [...{}]
_volumeMounts_: {
Expand Down
2 changes: 1 addition & 1 deletion cue.lib/kubernetes/core.cue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"command": [command]
}
if args != null {
"args": [ for k, v in args if v == null {k}] + list.FlattenN([ for k, v in args if v != null {[k, v]}], -1)
"args": list.Concat([[ for k, v in args if v == null {k}], list.FlattenN([ for k, v in args if v != null {[k, v]}], -1)])
}}]
}]
}
Expand Down
2 changes: 1 addition & 1 deletion cue.lib/kubernetes/rbac.cue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import (
}
}]

_rules: _rulesApiGroups + _rulesNonResourceURLs
_rules: list.Concat([_rulesApiGroups, _rulesNonResourceURLs])

"rules": list.FlattenN(_rules, 1)
}]
Expand Down

0 comments on commit 55783a0

Please sign in to comment.