INNER CODE UNIT · Python

render_for

timothystewart6/k3s-ansible · .github/scripts/test-cilium-envoy-toggle.py:97

    def render_for(value):
        template = env.from_string(ENVOY_EXPRESSION)
        return template.render(cilium_envoy=value)

    if render_for(True) != "true":
        fail("envoy conditional did not render 'true' when enabled")
    if render_for(False) != "false":
        fail("envoy conditional did not render 'false' when disabled")


def main():
    root = repo_root()
    cilium_tasks = os.path.join(
        root, "roles", "k3s_server_post", "tasks", "cilium.yml"
    )
    command = extract_install_command(cilium_tasks)
    assert_envoy_in_command(command)
    assert_render()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…