Skip to content

Commit c94b518

Browse files
authored
fix: modify workspacesdk to ask for tailnet API 2.0 (#13684)
#13617 bumped the Agent/Tailnet API minor version because it adds telemetry features. However, we don't actually use the protocol features yet, so it's a bit obnoxious for our CLI client to ask for the newest API version. This is particularly true of the CLI client, since that's distributed separately, so if an end user installs the latest CLI client and their organization hasn't fully upgraded, then it will fail to connect. Since we have a release coming up and the telemetry stuff won't make it, I think we should roll back to version 2.0 until we actually implement the telemetry stuff. That way the newest release (2.13) will work with Coder servers all the way back to 2.9.
1 parent 5b59f28 commit c94b518

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

codersdk/workspacesdk/workspacesdk.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"cdr.dev/slog"
2222
"github.com/coder/coder/v2/codersdk"
2323
"github.com/coder/coder/v2/tailnet"
24-
"github.com/coder/coder/v2/tailnet/proto"
2524
)
2625

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

247254
connector := runTailnetAPIConnector(ctx, options.Logger,

0 commit comments

Comments
 (0)