Open howardjohn opened 1 year ago
Minimal reproducer:
func TestUID(t *testing.T) {
yamlTemplate := `
type: {{ print .ObjectMeta "" }}
`
tmpl := template.Must(template.New("test").Parse(yamlTemplate))
type UID string
type ObjectMeta struct {
Name string
UID UID
}
type Outer struct {
ObjectMeta
}
var buf bytes.Buffer
err := tmpl.Execute(&buf, Outer{})
if err != nil {
t.Errorf("tmpl.Execute() error = %v", err)
}
}
Full error:
We are passing a struct as
args
that is ~4 levels of embedding to k8s metav1.ObjectMeta which has a UID set. https://github.com/istio/istio/blob/e3bd7d40ae6fe376c69ee93662a17c717d6d534a/pilot/pkg/config/kube/gateway/deploymentcontroller.go#L368Our template references this UID: https://github.com/istio/istio/blob/e3bd7d40ae6fe376c69ee93662a17c717d6d534a/manifests/charts/istio-control/istio-discovery/files/kube-gateway.yaml#L20. Even if I remove this reference, however, we get the same error.
Oddly, if I try to make a simpler reproducer I cannot.
I will try to get some more info/a simpler reproduction but thought I would open the issue with what I know for now.