You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was searching for a way to merge lists that exist on the same key-path and came up with this ineffective attempt (still havent found one). Happened to run a trim on it.
// ./test.cueimportapps_v1"k8s.io/api/apps/v1"deployment: [string]: apps_v1.#Deployment// works if line removeddeployment: [string]: spec: template: spec: containers: [...{
env: [...] |*[
{name: "version", value: "value"},
{name: "-", value: "-"}, // works if line removed
...,
]
}]
deployment: ancile: spec: template: spec: containers: [{
env: [
{name: "version", value: "value"},
]
}]
cue trim test.cue
What did you expect to see?
No error.
What did you see instead?
$ cue trim test.cue
{
deployment: {
ancile: {
metadata?: {}
spec: {
replicas?: null | int32
selector?: null | {}
template: {
metadata?: {}
spec: {
volumes?: []
initContainers?: []
containers: [
{
... // 5 identical elements
ports?: []
envFrom?: []
env: [
{
- name: "version"+ name: string
value: "value"
valueFrom?: null | {}
}
]
resources?: {}
volumeMounts?: []
... // 12 identical elements
}
]
ephemeralContainers?: []
restartPolicy?: string
... // 30 identical elements
}
}
strategy?: {}
minReadySeconds?: int32
... // 3 identical elements
}
kind?: string
status?: {}
... // 1 identical elements
}
}
}
Aborting trim, output differs after trimming. This is a bug! Use -i to force trim.
Forcing the trim results in this. Note the missing env var name.
// ./test.cueimportapps_v1"k8s.io/api/apps/v1"deployment: [string]: apps_v1.#Deployment// works if line removeddeployment: [string]: spec: template: spec: containers: [...{
env: [...] |*[
{name: "version", value: "value"},
{name: "-", value: "-"}, // works if line removed
...,
]
}]
deployment: ancile: spec: template: spec: containers: [{
env: [
{value: "value"},
]
}]
Trim works if one or the other of the marked lines are removed.
The text was updated successfully, but these errors were encountered:
myitcv
changed the title
trim output differs with defaulted extendable list and k8s constraints
cmd/cue: trim output differs with defaulted extendable list and k8s constraints
Nov 19, 2021
Dropping the now meaningless v0.4.x milestone. We have relabelled this from trim to roadmap/trim to indicate that a fix for this issue (and indeed all trim issues) requires a more substantial piece of work.
What version of CUE are you using (
cue version
)?What did you do?
I was searching for a way to merge lists that exist on the same key-path and came up with this ineffective attempt (still havent found one). Happened to run a trim on it.
What did you expect to see?
No error.
What did you see instead?
Forcing the trim results in this. Note the missing env var name.
Trim works if one or the other of the marked lines are removed.
The text was updated successfully, but these errors were encountered: