You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When stealing traffic from a container, any requests to obtain the hostname will return the hostname of the container being stole.
Example (python 3.11):
from socket import gethostname
print (gethostname())
this will return the hostname of the container in the kubernetes cluster. It would be good to override this feature for times when you still want a call in your app to return the hostname of the workstation running the debug session, rather than the stolen container.
Example scenario:
Your application attempts to determine if it is running in a Kubernetes container or locally in your IDE to set some additional config depending on the outcome. If we always get the stolen containers hostname, we would have to introduce another way to determine if running locally in an IDE.
Other Options:
Dont use hostname as a variable to determine if running locally. Use something like checking for TTY, ie
import sys
if sys.stdout.isatty():
print("Not running in an IDE")
else:
print("Running in an IDE")
Not really ideal.
The text was updated successfully, but these errors were encountered:
When stealing traffic from a container, any requests to obtain the hostname will return the hostname of the container being stole.
Example (python 3.11):
this will return the hostname of the container in the kubernetes cluster. It would be good to override this feature for times when you still want a call in your app to return the hostname of the workstation running the debug session, rather than the stolen container.
Example scenario:
Your application attempts to determine if it is running in a Kubernetes container or locally in your IDE to set some additional config depending on the outcome. If we always get the stolen containers hostname, we would have to introduce another way to determine if running locally in an IDE.
Other Options:
Dont use hostname as a variable to determine if running locally. Use something like checking for TTY, ie
Not really ideal.
The text was updated successfully, but these errors were encountered: