cmd/containerd: replace deprecated windows.IsAnInteractiveSession()#7497
Conversation
The `IsAnInteractiveSession` was deprecated, and `IsWindowsService` is marked as the recommended replacement. For details, see golang/sys@280f808 > CL 244958 includes isWindowsService function that determines if a > process is running as a service. The code of the function is based on > public .Net implementation. > > IsAnInteractiveSession function implements similar functionality, but > is based on an old Stackoverflow post., which is not as authoritative > as code written by Microsoft for their official product. > > This change copies CL 244958 isWindowsService function into svc package > and makes it public. The intention is that future users will prefer > IsWindowsService to IsAnInteractiveSession. Signed-off-by: Sebastiaan van Stijn <[email protected]>
|
@kevpar @dcantah perhaps you're able to review this one; before we merge this, it would be good to have some eyes from people at Microsoft on the changes made in golang/sys@280f808 / https://go-review.googlesource.com/c/sys/+/259397 From the commit, it looks like there's the change is a bit "fuzzy-wuzzy" ("we assume StackOverflow is less authoritative, and even though the .NET code looked bad, we assume that one is more correct"); Perhaps one of you know the right person inside Microsoft to verify if the new approach is indeed correct (or if changes are needed in golang.org/x/sys. |
|
In case useful; the original implementation in .NET was added in dotnet/extensions@43435a8 (part of dotnet/extensions#1083) Which, in itself is also a bit fuzzy-wuzzy (emphasis mine);
Sample they refer to may be the one from https://github.com/dotnet/AspNetCore.Docs/tree/0ea501cde5c82060aef61bceb30ea831f832a176/aspnetcore/fundamentals/host/generic-host/samples/2.x/GenericHostSample |
|
Could someone give CI a kick? Looks unrelated 😅 |
done |
|
Oh wow. LGTM based on the .NET code and the inclusion of it via golang sys |
|
Couldn't get to this in time, but LGTM! |
The
//nolintcomment was added in edc671d (#4626) to suppress the deprecation warning.The
IsAnInteractiveSessionwas deprecated, andIsWindowsServiceis marked as the recommended replacement.For details, see golang/sys@280f808