Skip to content

Commit 2448d1f

Browse files
committed
[v8] Ensure that the WindowsDesktopReady event is emitted
Ensure that the WindowsDesktopReady event is emitted When desktop access is enabled, the TeleportReady event will not be emitted until the WindowsDesktopReadyEvent is emitted, and it turns out we have *never* emitted a WindowsDesktopReadyEvent. This is likely due to desktop access being copied from kube access since the very beginning. The same issue was recently fixed for kube access in #9418.
1 parent dfdef53 commit 2448d1f

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

Diff for: integration/helpers.go

+14
Original file line numberDiff line numberDiff line change
@@ -1768,3 +1768,17 @@ func enableKubernetesService(t *testing.T, config *service.Config) {
17681768
config.Kube.KubeconfigPath = kubeConfigPath
17691769
config.Kube.ListenAddr = utils.MustParseAddr(net.JoinHostPort(Host, ports.Pop()))
17701770
}
1771+
1772+
func enableDesktopService(config *service.Config) {
1773+
// This config won't actually work, because there is no LDAP server,
1774+
// but it's enough to force desktop service to run.
1775+
config.WindowsDesktop.Enabled = true
1776+
config.WindowsDesktop.ListenAddr = *utils.MustParseAddr("127.0.0.1:0")
1777+
config.WindowsDesktop.Discovery.BaseDN = ""
1778+
config.WindowsDesktop.LDAP = service.LDAPConfig{
1779+
Domain: "example.com",
1780+
Addr: "127.0.0.1:636",
1781+
Username: "test",
1782+
InsecureSkipVerify: true,
1783+
}
1784+
}

Diff for: integration/integration_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3647,9 +3647,9 @@ func testRotateSuccess(t *testing.T, suite *integrationTestSuite) {
36473647
config, err := teleport.GenerateConfig(t, nil, tconf)
36483648
require.NoError(t, err)
36493649

3650-
// Enable Kubernetes service to test issue where the `KubernetesReady` event was not properly propagated
3651-
// and in the case where Kube service was enabled cert rotation flow was broken.
3650+
// Enable Kubernetes/Desktop services to test that the ready event is propagated.
36523651
enableKubernetesService(t, config)
3652+
enableDesktopService(config)
36533653

36543654
serviceC := make(chan *service.TeleportProcess, 20)
36553655

Diff for: lib/service/desktop.go

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ func (process *TeleportProcess) initWindowsDesktopServiceRegistered(log *logrus.
246246
"Windows desktop service %s:%s is starting on %v.",
247247
teleport.Version, teleport.Gitref, listener.Addr())
248248
}
249+
process.BroadcastEvent(Event{Name: WindowsDesktopReady, Payload: nil})
249250
err := srv.Serve(listener)
250251
if err != nil {
251252
if err == http.ErrServerClosed {

0 commit comments

Comments
 (0)