Move driverAllowPreload to driver.AllowPreload.

pull/11528/head
Andriy Dzikh 2021-06-01 13:35:40 -07:00
parent 62f172b0b0
commit 524b2f9987
2 changed files with 5 additions and 5 deletions

View File

@ -98,10 +98,6 @@ func remoteTarballURL(k8sVersion, containerRuntime string) string {
return fmt.Sprintf("https://storage.googleapis.com/%s/%s", PreloadBucket, TarballName(k8sVersion, containerRuntime))
}
func driverAllowsPreload(driverName string) bool {
return !driver.BareMetal(driverName) && !driver.IsSSH(driverName)
}
// PreloadExists returns true if there is a preloaded tarball that can be used
func PreloadExists(k8sVersion, containerRuntime, driverName string, forcePreload ...bool) bool {
// TODO (#8166): Get rid of the need for this and viper at all
@ -114,7 +110,7 @@ func PreloadExists(k8sVersion, containerRuntime, driverName string, forcePreload
klog.Infof("Checking if preload exists for k8s version %s and runtime %s", k8sVersion, containerRuntime)
// If `driverName` is BareMetal, there is no preload. Note: some uses of
// `PreloadExists` assume that the driver is irrelevant unless BareMetal.
if !driverAllowsPreload(driverName) || !viper.GetBool("preload") && !force {
if !driver.AllowsPreload(driverName) || !viper.GetBool("preload") && !force {
return false
}

View File

@ -172,6 +172,10 @@ func IsSSH(name string) bool {
return name == SSH
}
func AllowsPreload(driverName string) bool {
return !BareMetal(driverName) && !IsSSH(driverName)
}
// NeedsPortForward returns true if driver is unable provide direct IP connectivity
func NeedsPortForward(name string) bool {
if !IsKIC(name) {