Merge pull request #7497 from thaJeztah/replace_IsAnInteractiveSession

cmd/containerd: replace deprecated windows.IsAnInteractiveSession()
This commit is contained in:
Phil Estes 2022-10-11 13:17:48 -07:00 committed by GitHub
commit 32aa33a9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -307,16 +307,17 @@ func launchService(s *server.Server, done chan struct{}) error {
done: done, done: done,
} }
interactive, err := svc.IsAnInteractiveSession() // nolint:staticcheck // Check if we're running as a Windows service or interactively.
isService, err := svc.IsWindowsService()
if err != nil { if err != nil {
return err return err
} }
go func() { go func() {
if interactive { if isService {
err = debug.Run(serviceNameFlag, h)
} else {
err = svc.Run(serviceNameFlag, h) err = svc.Run(serviceNameFlag, h)
} else {
err = debug.Run(serviceNameFlag, h)
} }
h.fromsvc <- err h.fromsvc <- err
}() }()