fix: add missing tags

This commit is contained in:
Johan Siebens
2025-05-23 07:54:45 +02:00
parent 924ddf1b36
commit f8b0eceae7
2 changed files with 14 additions and 0 deletions
+1
View File
@@ -225,6 +225,7 @@ func ToNode(capVer tailcfg.CapabilityVersion, m *domain.Machine, tailnet *domain
if m.HasTags() { if m.HasTags() {
n.User = tailcfg.UserID(taggedDevicesUser.ID) n.User = tailcfg.UserID(taggedDevicesUser.ID)
n.Tags = m.Tags
user = tailcfg.UserProfile{ user = tailcfg.UserProfile{
ID: tailcfg.UserID(taggedDevicesUser.ID), ID: tailcfg.UserID(taggedDevicesUser.ID),
LoginName: "tagged-devices", LoginName: "tagged-devices",
+13
View File
@@ -80,3 +80,16 @@ func TestNodeWithSameHostname(t *testing.T) {
}, machines) }, machines)
}) })
} }
func TestNodeShouldSeeAssignedTags(t *testing.T) {
sc.Run(t, func(s *sc.Scenario) {
tailnet := s.CreateTailnet()
key := s.CreateAuthKey(tailnet.Id, true, "tag:server")
nodeA := s.NewTailscaleNode()
require.NoError(t, nodeA.Up(key, tsn.WithAdvertiseTags("tag:test")))
require.NoError(t, nodeA.WaitFor(tsn.HasTag("tag:server")))
require.NoError(t, nodeA.WaitFor(tsn.HasTag("tag:test")))
})
}