From 40f2f5dec0da5e5fc6854fa8aefdc47dec956051 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Wed, 29 Dec 2021 20:03:04 +0800 Subject: [PATCH] merge base to master (#794) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(ci): add auto invite (#762) * refactor(ci): add auto invite (#763) * refactor(ci): add auto invite * docs: readme align * refactor(dev): fix docs site (#773) * refactor(master): cloud,app feature close (#774) * refactor(master): cloud,app feature close * 缺陷: 最新版本sealos init 安装k8s 失败 (#778) Fixes #691 * refactor(master): release rc.8 (#782) * refactor(master): changelog (#784) * update changelog to master (#785) * refactor(master): changelog * refactor(dev): delete bug printf (#790) * refactor(dev): fix merge * refactor(dev): add feature check Co-authored-by: jiangyanfei <749985146@qq.com> Co-authored-by: louis <38313565+oldthreefeng@users.noreply.github.com> Co-authored-by: ldseraph --- .github/workflows/auto-invite.yml | 2 +- cmd/delete.go | 4 +++- cmd/install.go | 4 +++- cmd/root.go | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-invite.yml b/.github/workflows/auto-invite.yml index 2f7fc9e29..bb74351f0 100644 --- a/.github/workflows/auto-invite.yml +++ b/.github/workflows/auto-invite.yml @@ -21,4 +21,4 @@ jobs: qq group : 98488045 sealos dingtalk group : 35371178 home Website: https://www.sealyun.com - developer please add my dingtalk or wechat : cuisongliu \ No newline at end of file + developer please add my dingtalk or wechat : cuisongliu diff --git a/cmd/delete.go b/cmd/delete.go index df489e7a1..11dcdd53d 100644 --- a/cmd/delete.go +++ b/cmd/delete.go @@ -51,7 +51,9 @@ var deleteCmd = &cobra.Command{ _ = appmanager.DeleteApp(cfg, cfgFile) }, PreRun: func(cmd *cobra.Command, args []string) { - logger.Fatal("the delete app feature not support") + if !feature { + logger.Fatal("the delete app feature not support") + } if install.ExitDeleteCase(AppURL) { _ = cmd.Help() os.Exit(install.ErrorExitOSCase) diff --git a/cmd/install.go b/cmd/install.go index c95a2081b..0ec04b315 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -54,7 +54,9 @@ var installCmd = &cobra.Command{ _ = appmanager.InstallApp(cfg, cfgFile) }, PreRun: func(cmd *cobra.Command, args []string) { - logger.Fatal("the install app feature not support") + if !feature { + logger.Fatal("the install app feature not support") + } if install.ExitInstallCase(AppURL) { _ = cmd.Help() os.Exit(install.ErrorExitOSCase) diff --git a/cmd/root.go b/cmd/root.go index 9a4d0fe0e..dbe488455 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -29,6 +29,7 @@ import ( var ( cfgFile string Info bool + feature bool ) // rootCmd represents the base command when called without any subcommands @@ -52,6 +53,7 @@ func Execute() { func init() { cobra.OnInitialize(initConfig) rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.sealos/config.yaml)") + rootCmd.PersistentFlags().BoolVar(&feature, "feature", false, "need use new feature. ex app feature") rootCmd.PersistentFlags().BoolVar(&Info, "info", false, "logger ture for Info, false for Debug") }