Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v8] Ensure that the WindowsDesktopReady event is emitted #14859

Merged
merged 10 commits into from
Aug 4, 2022
14 changes: 14 additions & 0 deletions integration/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1768,3 +1768,17 @@ func enableKubernetesService(t *testing.T, config *service.Config) {
config.Kube.KubeconfigPath = kubeConfigPath
config.Kube.ListenAddr = utils.MustParseAddr(net.JoinHostPort(Host, ports.Pop()))
}

func enableDesktopService(config *service.Config) {
// This config won't actually work, because there is no LDAP server,
// but it's enough to force desktop service to run.
config.WindowsDesktop.Enabled = true
config.WindowsDesktop.ListenAddr = *utils.MustParseAddr("127.0.0.1:0")
config.WindowsDesktop.Discovery.BaseDN = ""
config.WindowsDesktop.LDAP = service.LDAPConfig{
Domain: "example.com",
Addr: "127.0.0.1:636",
Username: "test",
InsecureSkipVerify: true,
}
}
4 changes: 2 additions & 2 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3648,9 +3648,9 @@ func testRotateSuccess(t *testing.T, suite *integrationTestSuite) {
config, err := teleport.GenerateConfig(t, nil, tconf)
require.NoError(t, err)

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

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

Expand Down
1 change: 1 addition & 0 deletions lib/service/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func (process *TeleportProcess) initWindowsDesktopServiceRegistered(log *logrus.
"Windows desktop service %s:%s is starting on %v.",
teleport.Version, teleport.Gitref, listener.Addr())
}
process.BroadcastEvent(Event{Name: WindowsDesktopReady, Payload: nil})
err := srv.Serve(listener)
if err != nil {
if err == http.ErrServerClosed {
Expand Down