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:
Tonis Tiigi
2016-09-28 15:21:33 -07:00
parent 200598ef34
commit 3616bb2973
7 changed files with 19 additions and 17 deletions

View File

@ -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
}

View File

@ -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...)

View File

@ -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.