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)
| 409 | // already know the hostname suffix your deployment uses, you can pass it in the CoderConnectQueryOptions to avoid an |
| 410 | // API call to AgentConnectionInfoGeneric. |
| 411 | func (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 | |
| 424 | func testOrDefaultResolver(ctx context.Context) Resolver { |
| 425 | // check the context for a non-default resolver. This is only used in testing. |