Add hostname env integration test.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2018-09-11 17:26:42 -07:00
parent 3e5eb0c7d5
commit c7c68993c7
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{