Merge pull request #912 from Random-Liu/add-hostname-env-integration-test

Add hostname env integration test.
This commit is contained in:
Lantao Liu
2018-09-17 10:42:46 -07:00
committed by GitHub
2 changed files with 122 additions and 0 deletions

View File

@@ -126,6 +126,13 @@ func WithPodLogDirectory(dir string) PodSandboxOpts {
}
}
// Add pod hostname.
func WithPodHostname(hostname string) PodSandboxOpts {
return func(p *runtime.PodSandboxConfig) {
p.Hostname = hostname
}
}
// PodSandboxConfig generates a pod sandbox config for test.
func PodSandboxConfig(name, ns string, opts ...PodSandboxOpts) *runtime.PodSandboxConfig {
config := &runtime.PodSandboxConfig{