INNER CODE UNIT · Python
main
timothystewart6/k3s-ansible · .github/scripts/test-cilium-bgp-manifest.py:59
def main():
root = repo_root()
template_dir = os.path.join(
root, "roles", "k3s_server_post", "templates"
)
env = Environment(
loader=FileSystemLoader(template_dir), undefined=StrictUndefined
)
# Zero neighbors -> fall back to the single default peer.
output = render(env, {"_cilium_bgp_neighbors": []})
check_common(output)
if "peer-64512-1" not in output:
fail("default single peer name was not rendered")
if "peerAddress: 192.168.30.1" not in output:
fail("default peer address was not rendered")
if 'advertisementType: "PodCIDR"' not in output:
fail("PodCIDR advertisement missing when exportPodCIDR is true")