Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions lib/srv/desktop/windows_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"errors"
"fmt"
"log/slog"
"maps"
"net"
"os"
"strconv"
Expand Down Expand Up @@ -1119,10 +1120,10 @@ func (s *WindowsService) staticHostHeartbeatInfo(host servicecfg.WindowsHost,
) func() (types.Resource, error) {
return func() (types.Resource, error) {
addr := host.Address.String()

labels := getHostLabels(addr)
for k, v := range host.Labels {
labels[k] = v
}
maps.Copy(labels, host.Labels)

name := host.Name
if name == "" {
var err error
Expand All @@ -1131,14 +1132,21 @@ func (s *WindowsService) staticHostHeartbeatInfo(host servicecfg.WindowsHost,
return nil, trace.Wrap(err)
}
}

labels[types.OriginLabel] = types.OriginConfigFile
labels[types.ADLabel] = strconv.FormatBool(host.AD)

var domain string
if host.AD {
domain = s.cfg.Domain
}

desktop, err := types.NewWindowsDesktopV3(
name,
labels,
types.WindowsDesktopSpecV3{
Addr: addr,
Domain: s.cfg.Domain,
Domain: domain,
HostID: s.cfg.Heartbeat.HostUUID,
NonAD: !host.AD,
})
Expand Down
Loading