Per the multi-network CRD spec, if spec.config is valid but omits the name field, then the NPWG implementation adds a name field containing the NAD name (section 3.4.2).
preprocessCNIConfig attempts to mirror this behavior, but it only adds the name if there is an error unmarshalling the config:
if err := json.Unmarshal(config, &c); err != nil {
if n, ok := c["name"]; !ok || n == "" {
c["name"] = name
}
}
This means valid config that omits the name field is rejected by the webhook.
Per the multi-network CRD spec, if
spec.config
is valid but omits thename
field, then the NPWG implementation adds aname
field containing the NAD name (section 3.4.2).preprocessCNIConfig
attempts to mirror this behavior, but it only adds the name if there is an error unmarshalling the config:This means valid config that omits the
name
field is rejected by the webhook.