MCPcopy Index your code
hub / github.com/coder/coder / IsCoderConnectRunning

Method IsCoderConnectRunning

codersdk/workspacesdk/workspacesdk.go:411–422  ·  view source on GitHub ↗

IsCoderConnectRunning checks if Coder Connect (OS level tunnel to workspaces) is running on the system. If you already know the hostname suffix your deployment uses, you can pass it in the CoderConnectQueryOptions to avoid an API call to AgentConnectionInfoGeneric.

(ctx context.Context, o CoderConnectQueryOptions)

Source from the content-addressed store, hash-verified

409// already know the hostname suffix your deployment uses, you can pass it in the CoderConnectQueryOptions to avoid an
410// API call to AgentConnectionInfoGeneric.
411func (c *Client) IsCoderConnectRunning(ctx context.Context, o CoderConnectQueryOptions) (bool, error) {
412 suffix := o.HostnameSuffix
413 if suffix == "" {
414 info, err := c.AgentConnectionInfoGeneric(ctx)
415 if err != nil {
416 return false, xerrors.Errorf("get agent connection info: %w", err)
417 }
418 suffix = info.HostnameSuffix
419 }
420 domainName := fmt.Sprintf(tailnet.IsCoderConnectEnabledFmtString, suffix)
421 return ExistsViaCoderConnect(ctx, domainName)
422}
423
424func testOrDefaultResolver(ctx context.Context) Resolver {
425 // check the context for a non-default resolver. This is only used in testing.

Callers 1

Calls 3

ExistsViaCoderConnectFunction · 0.85
ErrorfMethod · 0.45

Tested by 1