Fixed standalone config, small refactor (#589)

This commit is contained in:
RoyUP9
2022-01-06 12:04:58 +02:00
committed by GitHub
parent 833d08bb40
commit b88bdb90f6
7 changed files with 33 additions and 19 deletions

View File

@@ -1,7 +1,9 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/up9inc/mizu/cli/config"
"github.com/up9inc/mizu/cli/telemetry"
)
@@ -13,6 +15,13 @@ var installCmd = &cobra.Command{
runMizuInstall()
return nil
},
PreRunE: func(cmd *cobra.Command, args []string) error {
if config.Config.IsNsRestrictedMode() {
return fmt.Errorf("install is not supported in restricted namespace mode")
}
return nil
},
}
func init() {