MCPcopy Create free account
hub / github.com/cloudflare/cloudflared / create

Function create

component-tests/setup.py:111–135  ·  view source on GitHub ↗

Creates the necessary resources for the components test to run. - Creates a named tunnel with a random name. - Creates a random CNAME DNS entry for that tunnel. Those created resources are added to the config (obtained from an environment variable). The resulting configuratio

()

Source from the content-addressed store, hash-verified

109
110
111def create():
112 """
113 Creates the necessary resources for the components test to run.
114 - Creates a named tunnel with a random name.
115 - Creates a random CNAME DNS entry for that tunnel.
116
117 Those created resources are added to the config (obtained from an environment variable).
118 The resulting configuration is persisted for the tests to use.
119 """
120 config = get_config_from_env()
121 origincert_path = persist_origin_cert(config)
122
123 random_uuid = str(uuid.uuid4())
124 config["tunnel"] = create_tunnel(config, origincert_path, random_uuid)
125 config["ingress"] = [
126 {
127 "hostname": create_named_dns(config, random_uuid),
128 "service": "hello_world"
129 },
130 {
131 "service": "http_status:404"
132 }
133 ]
134
135 persist_config(config)
136
137
138def cleanup():

Callers 1

setup.pyFile · 0.85

Calls 5

get_config_from_envFunction · 0.85
persist_origin_certFunction · 0.85
create_tunnelFunction · 0.85
create_named_dnsFunction · 0.85
persist_configFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…