Skip to content

Commit d473b06

Browse files
authored
[v10] Ensure that the WindowsDesktopReady event is emitted (#14839)
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 19f27d0 commit d473b06

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
@@ -1754,6 +1754,20 @@ func enableKubernetesService(t *testing.T, config *service.Config) {
17541754
require.NoError(t, enableKube(config, "teleport-cluster"))
17551755
}
17561756

1757+
func enableDesktopService(config *service.Config) {
1758+
// This config won't actually work, because there is no LDAP server,
1759+
// but it's enough to force desktop service to run.
1760+
config.WindowsDesktop.Enabled = true
1761+
config.WindowsDesktop.ListenAddr = *utils.MustParseAddr("127.0.0.1:0")
1762+
config.WindowsDesktop.Discovery.BaseDN = ""
1763+
config.WindowsDesktop.LDAP = service.LDAPConfig{
1764+
Domain: "example.com",
1765+
Addr: "127.0.0.1:636",
1766+
Username: "test",
1767+
InsecureSkipVerify: true,
1768+
}
1769+
}
1770+
17571771
func enableKube(config *service.Config, clusterName string) error {
17581772
kubeConfigPath := config.Kube.KubeconfigPath
17591773
if kubeConfigPath == "" {

Diff for: integration/integration_test.go

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

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

39403940
serviceC := make(chan *service.TeleportProcess, 20)
39413941

Diff for: lib/service/desktop.go

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ func (process *TeleportProcess) initWindowsDesktopServiceRegistered(log *logrus.
253253
"Windows desktop service %s:%s is starting on %v.",
254254
teleport.Version, teleport.Gitref, listener.Addr())
255255
}
256+
process.BroadcastEvent(Event{Name: WindowsDesktopReady, Payload: nil})
256257
err := srv.Serve(listener)
257258
if err != nil {
258259
if err == http.ErrServerClosed {

0 commit comments

Comments
 (0)