---
source: sk-cli/src/validation/rules/tests/validate_all_test.rs
expression: "str::from_utf8(&snapshot).unwrap()"
---
Validation errors found:
----------------------------------------------------------------------
status_field_populated (W0000) ..................................... 1
service_account_missing (E0001) .................................... 2
envvar_secret_missing (E0002) ...................................... 2
envvar_configmap_missing (E0003) ................................... 2
volume_secret_missing (E0004) ...................................... 1
volume_configmap_missing (E0005) ................................... 1
----------------------------------------------------------------------
# Auto-generated SKEL file to fix this trace;
# Run `skctl transform validation_trace.json <SKELFILE>` to apply it

remove(status);

# these paths are only correct for Deployments, adjust as needed for other resources
remove(spec.template.spec.serviceAccount);
remove(spec.template.spec.serviceAccountName);

# these paths are only correct for Deployments, adjust as needed for other resources
remove($x := spec.template.spec.containers[*].env[*] | exists($x.valueFrom.secretKeyRef), $x);
remove($x := spec.template.spec.containers[*].envFrom[*] | exists($x.secretRef), $x);

# these paths are only correct for Deployments, adjust as needed for other resources
remove($x := spec.template.spec.containers[*].env[*] | exists($x.valueFrom.configMapKeyRef), $x);
remove($x := spec.template.spec.containers[*].envFrom[*] | exists($x.configMapRef), $x);

# these paths are only correct for Deployments, adjust as needed for other resources
remove($x := spec.template.spec.volumes[*] | exists($x.secret)
    && $y := spec.template.spec.containers[*].volumeMounts[*] | $y.name == $x.name,
    $y);
remove($x := spec.template.spec.volumes[*] | exists($x.secret), $x);

# these paths are only correct for Deployments, adjust as needed for other resources
remove($x := spec.template.spec.volumes[*] | exists($x.configMap)
    && $y := spec.template.spec.containers[*].volumeMounts[*] | $y.name == $x.name,
    $y);
remove($x := spec.template.spec.volumes[*] | exists($x.configMap), $x);
