Originally reported at:
https://github.com/ovn-org/ovn-kubernetes/issues/4301
The lexer_parse_template_string() function is used to parse all templates in a LB VIP/backend or lflow. However, if templates can't be instantiated on a given chassis (e.g., missing Chassis_Template_Var value) it's left untouched, e.g., (^NODEIP_IPv4_2) and further parsing is still attempted:
if (lexer.token.type == LEX_T_TEMPLATE) { ds_put_cstr(&expanded, smap_get_def(template_vars, lexer.token.s, lexer.token.s)); <<< failure to expand leaves the token as is if (template_vars_ref) { sset_add(template_vars_ref, lexer.token.s); }
This generates warnings when trying to parse the lflow or the IP address.
Ideally, lexer_parse_template_string() should return a value to indicate whether templates have been successfully expanded. The LBs/lflows that contain templates that cannot be expanded not should be further parsed.