Adding c:\tmp as needed to pass Kubernetes tests (#4240)

This commit is contained in:
Patrick Lang 2018-11-13 08:55:16 -08:00 коммит произвёл Jack Francis
Родитель 525c6db5d1
Коммит 564ee4e130
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -38,4 +38,17 @@ function New-TemporaryDirectory {
$parent = [System.IO.Path]::GetTempPath()
[string] $name = [System.Guid]::NewGuid()
New-Item -ItemType Directory -Path (Join-Path $parent $name)
}
function Initialize-DataDirectories {
# Some of the Kubernetes tests that were designed for Linux try to mount /tmp into a pod
# On Windows, Go translates to c:\tmp. If that path doesn't exist, then some node tests fail
$requiredPaths = 'c:\tmp'
$requiredPaths | ForEach-Object {
if (-Not (Test-Path $_)) {
New-Item -ItemType Directory -Path $_
}
}
}

Просмотреть файл

@ -145,6 +145,9 @@ try
Write-Log "Resize os drive if possible"
Resize-OSDrive
Write-Log "Create required data directories as needed"
Initialize-DataDirectories
Write-Log "Install docker"
Install-Docker -DockerVersion $global:DockerVersion