mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
feat: use tailnet v2 API for coordination (#11638)
This one is huge, and I'm sorry. The problem is that once I change `tailnet.Conn` to start doing v2 behavior, I kind of have to change it everywhere, including in CoderSDK (CLI), the agent, wsproxy, and ServerTailnet. There is still a bit more cleanup to do, and I need to add code so that when we lose connection to the Coordinator, we mark all peers as LOST, but that will be in a separate PR since this is big enough!
This commit is contained in:
@ -30,6 +30,10 @@ func (v *APIVersion) WithBackwardCompat(majs ...int) *APIVersion {
|
||||
return v
|
||||
}
|
||||
|
||||
func (v *APIVersion) String() string {
|
||||
return fmt.Sprintf("%d.%d", v.supportedMajor, v.supportedMinor)
|
||||
}
|
||||
|
||||
// Validate validates the given version against the given constraints:
|
||||
// A given major.minor version is valid iff:
|
||||
// 1. The requested major version is contained within v.supportedMajors
|
||||
@ -42,10 +46,6 @@ func (v *APIVersion) WithBackwardCompat(majs ...int) *APIVersion {
|
||||
// - 1.x is supported,
|
||||
// - 2.0, 2.1, and 2.2 are supported,
|
||||
// - 2.3+ is not supported.
|
||||
func (v *APIVersion) String() string {
|
||||
return fmt.Sprintf("%d.%d", v.supportedMajor, v.supportedMinor)
|
||||
}
|
||||
|
||||
func (v *APIVersion) Validate(version string) error {
|
||||
major, minor, err := Parse(version)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user