Skip to content

lookup nil map access #95

@lllamnyp

Description

@lllamnyp

While debugging an issue reported in Kubernetes' Slack a minimal reproduction of the bug was achieved by

cat <<EOF > templates/test.yaml
{{- lookup "machineconfig" "" "v1alpha1" | toYaml }}
EOF
rm templates/{controlplane,worker}.yaml
talm template n 192.168.121.21 -e 192.168.121.21 -t templates/test.yaml > /dev/stdout

which results in

failed to render templates: template: cluster/templates/test.yaml:1:4: executing "cluster/templates/test.yaml" at <lookup "machineconfig" "" "v1alpha1">: error calling lookup: assignment to entry in nil map

This narrows down the issue to a bug in the implementation of lookup in Talm.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions