mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 09:34:54 +02:00
Upgrade docker (#2440)
* somehow now the only thing that doesnt work is devices.Device Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * this gets rid of all the compiler errors in the vendored code Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * fixed some things but a bunch of tests and maybe some compiler steps are still failing Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * all the things i figured out how to fix so far Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * guess i had to redo go mods after rebasing again Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * update docker constants to be SHOUTY CASE now Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * include DestPath in resolveEnv Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * fix one mistake in Docker lib upgrade and some typos/deprecations in the file Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * last changes (hopefully) to update to new docker libs Signed-off-by: Joe Kimmel <jkimmel@vmware.com> --------- Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
This commit is contained in:
-74
@@ -1,74 +0,0 @@
|
||||
package timeout
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
// defaultTimeout is the timeout for most operations that is not overridden.
|
||||
defaultTimeout = 4 * time.Minute
|
||||
|
||||
// defaultTimeoutTestdRetry is the retry loop timeout for testd to respond
|
||||
// for a disk to come online in LCOW.
|
||||
defaultTimeoutTestdRetry = 5 * time.Second
|
||||
)
|
||||
|
||||
// External variables for HCSShim consumers to use.
|
||||
var (
|
||||
// SystemCreate is the timeout for creating a compute system
|
||||
SystemCreate time.Duration = defaultTimeout
|
||||
|
||||
// SystemStart is the timeout for starting a compute system
|
||||
SystemStart time.Duration = defaultTimeout
|
||||
|
||||
// SystemPause is the timeout for pausing a compute system
|
||||
SystemPause time.Duration = defaultTimeout
|
||||
|
||||
// SystemResume is the timeout for resuming a compute system
|
||||
SystemResume time.Duration = defaultTimeout
|
||||
|
||||
// SystemSave is the timeout for saving a compute system
|
||||
SystemSave time.Duration = defaultTimeout
|
||||
|
||||
// SyscallWatcher is the timeout before warning of a potential stuck platform syscall.
|
||||
SyscallWatcher time.Duration = defaultTimeout
|
||||
|
||||
// Tar2VHD is the timeout for the tar2vhd operation to complete
|
||||
Tar2VHD time.Duration = defaultTimeout
|
||||
|
||||
// ExternalCommandToStart is the timeout for external commands to start
|
||||
ExternalCommandToStart = defaultTimeout
|
||||
|
||||
// ExternalCommandToComplete is the timeout for external commands to complete.
|
||||
// Generally this means copying data from their stdio pipes.
|
||||
ExternalCommandToComplete = defaultTimeout
|
||||
|
||||
// TestDRetryLoop is the timeout for testd retry loop when onlining a SCSI disk in LCOW
|
||||
TestDRetryLoop = defaultTimeoutTestdRetry
|
||||
)
|
||||
|
||||
func init() {
|
||||
SystemCreate = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMCREATE", SystemCreate)
|
||||
SystemStart = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMSTART", SystemStart)
|
||||
SystemPause = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMPAUSE", SystemPause)
|
||||
SystemResume = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMRESUME", SystemResume)
|
||||
SystemSave = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMSAVE", SystemSave)
|
||||
SyscallWatcher = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSCALLWATCHER", SyscallWatcher)
|
||||
Tar2VHD = durationFromEnvironment("HCSSHIM_TIMEOUT_TAR2VHD", Tar2VHD)
|
||||
ExternalCommandToStart = durationFromEnvironment("HCSSHIM_TIMEOUT_EXTERNALCOMMANDSTART", ExternalCommandToStart)
|
||||
ExternalCommandToComplete = durationFromEnvironment("HCSSHIM_TIMEOUT_EXTERNALCOMMANDCOMPLETE", ExternalCommandToComplete)
|
||||
TestDRetryLoop = durationFromEnvironment("HCSSHIM_TIMEOUT_TESTDRETRYLOOP", TestDRetryLoop)
|
||||
}
|
||||
|
||||
func durationFromEnvironment(env string, defaultValue time.Duration) time.Duration {
|
||||
envTimeout := os.Getenv(env)
|
||||
if len(envTimeout) > 0 {
|
||||
e, err := strconv.Atoi(envTimeout)
|
||||
if err == nil && e > 0 {
|
||||
return time.Second * time.Duration(e)
|
||||
}
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
Reference in New Issue
Block a user