Fix missing hostname and links in exec env
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Upstream-commit: e98145960988a2259074ae911b6478b7a940748b Component: engine
This commit is contained in:
@ -28,7 +28,7 @@ type ExitStatus struct {
|
||||
}
|
||||
|
||||
// CreateDaemonEnvironment creates a new environment variable slice for this container.
|
||||
func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string {
|
||||
func (container *Container) CreateDaemonEnvironment(_ bool, linkedEnv []string) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -52,13 +52,13 @@ type ExitStatus struct {
|
||||
// environment variables related to links.
|
||||
// Sets PATH, HOSTNAME and if container.Config.Tty is set: TERM.
|
||||
// The defaults set here do not override the values in container.Config.Env
|
||||
func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string {
|
||||
func (container *Container) CreateDaemonEnvironment(tty bool, linkedEnv []string) []string {
|
||||
// Setup environment
|
||||
env := []string{
|
||||
"PATH=" + system.DefaultPathEnv,
|
||||
"HOSTNAME=" + container.Config.Hostname,
|
||||
}
|
||||
if container.Config.Tty {
|
||||
if tty {
|
||||
env = append(env, "TERM=xterm")
|
||||
}
|
||||
env = append(env, linkedEnv...)
|
||||
|
||||
@ -30,7 +30,7 @@ type ExitStatus struct {
|
||||
}
|
||||
|
||||
// CreateDaemonEnvironment creates a new environment variable slice for this container.
|
||||
func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string {
|
||||
func (container *Container) CreateDaemonEnvironment(_ bool, linkedEnv []string) []string {
|
||||
// because the env on the container can override certain default values
|
||||
// we need to replace the 'env' keys where they match and append anything
|
||||
// else.
|
||||
|
||||
Reference in New Issue
Block a user