Skip to content

fix: modify workspacesdk to ask for tailnet API 2.0 #13684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions codersdk/workspacesdk/workspacesdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"cdr.dev/slog"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/tailnet"
"github.com/coder/coder/v2/tailnet/proto"
)

// AgentIP is a static IPv6 address with the Tailscale prefix that is used to route
Expand Down Expand Up @@ -239,7 +238,15 @@ func (c *Client) DialAgent(dialCtx context.Context, agentID uuid.UUID, options *
return nil, xerrors.Errorf("parse url: %w", err)
}
q := coordinateURL.Query()
q.Add("version", proto.CurrentVersion.String())
// TODO (ethanndickson) - the current version includes 2 additions we don't currently use:
//
// 2.1 GetAnnouncementBanners on the Agent API (version locked to Tailnet API)
// 2.2 PostTelemetry on the Tailnet API
//
// So, asking for API 2.2 just makes us incompatible back level servers, for no real benefit.
// As a temporary measure, we'll specifically ask for API version 2.0 until we implement sending
// telemetry.
q.Add("version", "2.0")
coordinateURL.RawQuery = q.Encode()

connector := runTailnetAPIConnector(ctx, options.Logger,
Expand Down
Loading