fix flag name in cache add

pull/12977/head
Medya Gh 2021-11-17 15:31:55 -08:00
parent 43d7640f4b
commit 64ce5460cf
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 // cacheImageConfigKey is the config field name used to store which images we have previously cached
const cacheImageConfigKey = "cache" const cacheImageConfigKey = "cache"
var ( const allFlag = "all"
all string
)
// cacheCmd represents the cache command // cacheCmd represents the cache command
var cacheCmd = &cobra.Command{ var cacheCmd = &cobra.Command{
@ -63,11 +61,11 @@ var addCacheCmd = &cobra.Command{
} }
func addCacheCmdFlags() { 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 { func cacheAddProfiles() []*config.Profile {
if viper.GetBool(all) { if viper.GetBool(allFlag) {
validProfiles, _, err := config.ListProfiles() // need to load image to all profiles validProfiles, _, err := config.ListProfiles() // need to load image to all profiles
if err != nil { if err != nil {
klog.Warningf("error listing profiles: %v", err) klog.Warningf("error listing profiles: %v", err)