Skip to content

Commit cc0b971

Browse files
committed
devices: add distro information
Updates tailscale/corp#34741 Signed-off-by: Noel O'Brien <[email protected]>
1 parent e1645c2 commit cc0b971

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

devices.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ type ClientConnectivity struct {
6767
ClientSupports ClientSupports `json:"clientSupports"`
6868
}
6969

70+
type Distro struct {
71+
Name string `json:"name"`
72+
Version string `json:"version"`
73+
CodeName string `json:"codeName"`
74+
}
75+
7076
type Device struct {
7177
Addresses []string `json:"addresses"`
7278
Name string `json:"name"`
@@ -97,6 +103,7 @@ type Device struct {
97103
AdvertisedRoutes []string `json:"AdvertisedRoutes"`
98104
EnabledRoutes []string `json:"enabledRoutes"`
99105
ClientConnectivity *ClientConnectivity `json:"clientConnectivity"`
106+
Distro *Distro `json:"distro"`
100107
}
101108

102109
type DevicePostureAttributes struct {

devices_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestClient_Devices_Get(t *testing.T) {
6666
TailnetLockError: "test error",
6767
TailnetLockKey: "tlpub:test",
6868
UpdateAvailable: true,
69-
SSHEnabled: false,
69+
SSHEnabled: false,
7070
AdvertisedRoutes: []string{"127.0.0.1", "127.0.0.2"},
7171
EnabledRoutes: []string{"127.0.0.1"},
7272
ClientConnectivity: &ClientConnectivity{
@@ -91,6 +91,11 @@ func TestClient_Devices_Get(t *testing.T) {
9191
UPNP: false,
9292
},
9393
},
94+
Distro: &Distro{
95+
Name: "ubuntu",
96+
Version: "25.04",
97+
CodeName: "plucky",
98+
},
9499
}
95100

96101
client, server := NewTestHarness(t)
@@ -173,7 +178,7 @@ func TestClient_Devices_List(t *testing.T) {
173178
NodeKey: "nodekey:test",
174179
OS: "windows",
175180
UpdateAvailable: true,
176-
SSHEnabled: false,
181+
SSHEnabled: false,
177182
AdvertisedRoutes: []string{"127.0.0.1", "127.0.0.2"},
178183
EnabledRoutes: []string{"127.0.0.1"},
179184
ClientConnectivity: &ClientConnectivity{
@@ -198,6 +203,11 @@ func TestClient_Devices_List(t *testing.T) {
198203
UPNP: false,
199204
},
200205
},
206+
Distro: &Distro{
207+
Name: "ubuntu",
208+
Version: "25.04",
209+
CodeName: "plucky",
210+
},
201211
},
202212
},
203213
}

0 commit comments

Comments
 (0)