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

Method run

cmd/cloudflared/tunnel/subcommand_context.go:265–276  ·  view source on GitHub ↗
(tunnelID uuid.UUID)

Source from the content-addressed store, hash-verified

263}
264
265func (sc *subcommandContext) run(tunnelID uuid.UUID) error {
266 credentials, err := sc.findCredentials(tunnelID)
267 if err != nil {
268 if e, ok := err.(invalidJSONCredentialError); ok {
269 sc.log.Error().Msgf("The credentials file at %s contained invalid JSON. This is probably caused by passing the wrong filepath. Reminder: the credentials file is a .json file created via `cloudflared tunnel create`.", e.path)
270 sc.log.Error().Msgf("Invalid JSON when parsing credentials file: %s", e.err.Error())
271 }
272 return err
273 }
274
275 return sc.runWithCredentials(credentials)
276}
277
278func (sc *subcommandContext) runWithCredentials(credentials connection.Credentials) error {
279 sc.log.Info().Str(LogFieldTunnelID, credentials.TunnelID.String()).Msg("Starting tunnel")

Callers 11

runAdhocNamedTunnelFunction · 0.80
runNamedTunnelFunction · 0.80
run_subprocessFunction · 0.80
create_tunnelFunction · 0.80
delete_tunnelFunction · 0.80
start_cloudflaredFunction · 0.80
sysv_service_scenarioMethod · 0.80
launchctl_cmdMethod · 0.80
sysv_cmdMethod · 0.80

Calls 3

findCredentialsMethod · 0.95
runWithCredentialsMethod · 0.95
ErrorMethod · 0.45

Tested by 5

sysv_service_scenarioMethod · 0.64
launchctl_cmdMethod · 0.64
sysv_cmdMethod · 0.64