Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 1e471b1

Browse files
authored
Merge pull request #895 from estesp/add-hostname-env
Add HOSTNAME to env by default for pod containers
2 parents 4987757 + 4c3e195 commit 1e471b1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/server/container_create.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ func (c *criService) generateContainerSpec(id string, sandboxID string, sandboxP
341341
for _, e := range config.GetEnvs() {
342342
g.AddProcessEnv(e.GetKey(), e.GetValue())
343343
}
344+
// add the HOSTNAME variable to the environment to match Docker runtime default
345+
g.AddProcessEnv("HOSTNAME", sandboxConfig.GetHostname())
344346

345347
securityContext := config.GetLinux().GetSecurityContext()
346348
selinuxOpt := securityContext.GetSelinuxOptions()

0 commit comments

Comments
 (0)