Skip to content

Commit f8b0ece

Browse files
committed
fix: add missing tags
1 parent 924ddf1 commit f8b0ece

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

internal/mapping/mapping.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ func ToNode(capVer tailcfg.CapabilityVersion, m *domain.Machine, tailnet *domain
225225

226226
if m.HasTags() {
227227
n.User = tailcfg.UserID(taggedDevicesUser.ID)
228+
n.Tags = m.Tags
228229
user = tailcfg.UserProfile{
229230
ID: tailcfg.UserID(taggedDevicesUser.ID),
230231
LoginName: "tagged-devices",

tests/integration_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,16 @@ func TestNodeWithSameHostname(t *testing.T) {
8080
}, machines)
8181
})
8282
}
83+
84+
func TestNodeShouldSeeAssignedTags(t *testing.T) {
85+
sc.Run(t, func(s *sc.Scenario) {
86+
tailnet := s.CreateTailnet()
87+
key := s.CreateAuthKey(tailnet.Id, true, "tag:server")
88+
89+
nodeA := s.NewTailscaleNode()
90+
91+
require.NoError(t, nodeA.Up(key, tsn.WithAdvertiseTags("tag:test")))
92+
require.NoError(t, nodeA.WaitFor(tsn.HasTag("tag:server")))
93+
require.NoError(t, nodeA.WaitFor(tsn.HasTag("tag:test")))
94+
})
95+
}

0 commit comments

Comments
 (0)