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
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)