Merge pull request #12977 from medyagh/allflag_cache

fix flag name in cache add
pull/12982/head
Medya Ghazizadeh 2021-11-18 08:19:29 -08:00 committed by GitHub
commit 2ab68fb50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -33,9 +33,7 @@ import (
// cacheImageConfigKey is the config field name used to store which images we have previously cached
const cacheImageConfigKey = "cache"
var (
all string
)
const allFlag = "all"
// cacheCmd represents the cache command
var cacheCmd = &cobra.Command{
@ -63,11 +61,11 @@ var addCacheCmd = &cobra.Command{
}
func addCacheCmdFlags() {
addCacheCmd.Flags().Bool(all, false, "Add image to cache for all running minikube clusters")
addCacheCmd.Flags().Bool(allFlag, false, "Add image to cache for all running minikube clusters")
}
func cacheAddProfiles() []*config.Profile {
if viper.GetBool(all) {
if viper.GetBool(allFlag) {
validProfiles, _, err := config.ListProfiles() // need to load image to all profiles
if err != nil {
klog.Warningf("error listing profiles: %v", err)