File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
CoreHelpers.Azure.Worker/Hosting Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,4 @@ Thumbs.db
4040* .dotCover
4141appsettings.demo.json
4242.vs
43+ .idea /.idea.CoreHelpers.Azure.Worker /.idea
Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ public bool IsRunningInContainerEnvironment()
3838 var cGroupContent = File . ReadAllText ( "/proc/1/cgroup" ) ;
3939
4040 // set the cache value
41- cachedCheckIsRunningInContainerEnvironment = cGroupContent . Contains ( "/docker/" ) || cGroupContent . Contains ( "/kubepods/" ) ;
41+ cachedCheckIsRunningInContainerEnvironment = cGroupContent . Contains ( "/docker/" ) || cGroupContent . Contains ( "/kubepods/" ) || cGroupContent . Contains ( "kubepods.slice" ) ;
42+ if ( ! cachedCheckIsRunningInContainerEnvironment . Value )
43+ cachedCheckIsRunningInContainerEnvironment = File . Exists ( "/var/run/secrets/kubernetes.io/serviceaccount/token" ) ;
4244
4345 // return the value
4446 return cachedCheckIsRunningInContainerEnvironment . Value ;
You can’t perform that action at this time.
0 commit comments