diff --git a/clustertool/cmd/adv_bootstrap.go b/clustertool/cmd/adv_bootstrap.go index b12df3a070b3..fed6f97776e4 100644 --- a/clustertool/cmd/adv_bootstrap.go +++ b/clustertool/cmd/adv_bootstrap.go @@ -1,13 +1,20 @@ package cmd import ( + "strings" + "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/gencmd" ) +var advBootstrapLongHelp = strings.TrimSpace(` + +`) + var bootstrap = &cobra.Command{ Use: "bootstrap", Short: "bootstrap first Talos Node", + Long: advBootstrapLongHelp, Run: bootstrapfunc, } diff --git a/clustertool/cmd/adv_fluxbootstrap.go b/clustertool/cmd/adv_fluxbootstrap.go deleted file mode 100644 index b8545f54ee40..000000000000 --- a/clustertool/cmd/adv_fluxbootstrap.go +++ /dev/null @@ -1,36 +0,0 @@ -package cmd - -import ( - "context" - - talhelperCfg "github.com/budimanjojo/talhelper/v3/pkg/config" - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/fluxhandler" - "github.com/truecharts/public/clustertool/pkg/helper" - "github.com/truecharts/public/clustertool/pkg/initfiles" - "github.com/truecharts/public/clustertool/pkg/sops" -) - -var fluxbootstrap = &cobra.Command{ - Use: "fluxbootstrap", - Short: "Manually bootstrap fluxcd on existing cluster", - Run: func(cmd *cobra.Command, args []string) { - ctx := context.Background() - - if err := sops.DecryptFiles(); err != nil { - log.Info().Msgf("Error decrypting files: %v\n", err) - } - initfiles.LoadTalEnv(false) - _, err := talhelperCfg.LoadAndValidateFromFile(helper.TalConfigFile, []string{helper.ClusterEnvFile}, false) - if err != nil { - log.Fatal().Err(err).Msg("failed to parse talconfig or talenv file: %s") - } - - fluxhandler.FluxBootstrap(ctx) - }, -} - -func init() { - adv.AddCommand(fluxbootstrap) -} diff --git a/clustertool/cmd/adv_health.go b/clustertool/cmd/adv_health.go index 0a5adca5e37b..d5e33d9af884 100644 --- a/clustertool/cmd/adv_health.go +++ b/clustertool/cmd/adv_health.go @@ -1,6 +1,8 @@ package cmd import ( + "strings" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/gencmd" @@ -8,9 +10,14 @@ import ( "github.com/truecharts/public/clustertool/pkg/sops" ) +var advHealthLongHelp = strings.TrimSpace(` + +`) + var health = &cobra.Command{ Use: "health", Short: "Check Talos Cluster Health", + Long: advHealthLongHelp, Run: func(cmd *cobra.Command, args []string) { if err := sops.DecryptFiles(); err != nil { log.Info().Msgf("Error decrypting files: %v\n", err) diff --git a/clustertool/cmd/adv_precommit.go b/clustertool/cmd/adv_precommit.go index dd10efc69482..59dd3834a561 100644 --- a/clustertool/cmd/adv_precommit.go +++ b/clustertool/cmd/adv_precommit.go @@ -2,15 +2,21 @@ package cmd import ( "os" + "strings" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/sops" ) +var advPrecommitLongHelp = strings.TrimSpace(` + +`) + var precommit = &cobra.Command{ Use: "precommit", Short: "Runs the PreCommit encryption check", + Long: advPrecommitLongHelp, Run: func(cmd *cobra.Command, args []string) { if err := sops.CheckFilesAndReportEncryption(true, true); err != nil { log.Info().Msgf("Error checking files: %v\n", err) diff --git a/clustertool/cmd/adv_reset.go b/clustertool/cmd/adv_reset.go index adf7db576c77..8e3ab4b39f9d 100644 --- a/clustertool/cmd/adv_reset.go +++ b/clustertool/cmd/adv_reset.go @@ -1,15 +1,22 @@ package cmd import ( + "strings" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/sops" ) +var advResetLongHelp = strings.TrimSpace(` + +`) + var reset = &cobra.Command{ Use: "reset", Short: "Reset Talos Nodes and Kubernetes", + Long: advResetLongHelp, Run: func(cmd *cobra.Command, args []string) { var extraArgs []string node := "" diff --git a/clustertool/cmd/adv_testcmd.go b/clustertool/cmd/adv_testcmd.go index 492ab0e56893..f9ca2ead05b8 100644 --- a/clustertool/cmd/adv_testcmd.go +++ b/clustertool/cmd/adv_testcmd.go @@ -1,15 +1,22 @@ package cmd import ( + "strings" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/initfiles" ) +var advTestCmdlongHelp = strings.TrimSpace(` + +`) + var testcmd = &cobra.Command{ Use: "test", Short: "test run", + Long: advTestCmdlongHelp, Run: func(cmd *cobra.Command, args []string) { initfiles.LoadTalEnv(false) // err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports") diff --git a/clustertool/cmd/apply.go b/clustertool/cmd/apply.go index de40f1b0e743..936eecc57f88 100644 --- a/clustertool/cmd/apply.go +++ b/clustertool/cmd/apply.go @@ -1,6 +1,8 @@ package cmd import ( + "strings" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/gencmd" @@ -9,9 +11,14 @@ import ( "github.com/truecharts/public/clustertool/pkg/sops" ) +var applyLongHelp = strings.TrimSpace(` + +`) + var apply = &cobra.Command{ Use: "apply", Short: "apply TalosConfig", + Long: applyLongHelp, Run: func(cmd *cobra.Command, args []string) { var extraArgs []string node := "" diff --git a/clustertool/cmd/charts_bump.go b/clustertool/cmd/charts_bump.go index 257caea14d92..347f377a0db2 100644 --- a/clustertool/cmd/charts_bump.go +++ b/clustertool/cmd/charts_bump.go @@ -1,14 +1,21 @@ package cmd import ( + "strings" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/charts/version" ) +var chartsBumpLongHelp = strings.TrimSpace(` + +`) + var bumper = &cobra.Command{ Use: "bump", Short: "generate a bumped image version", + Long: chartsBumpLongHelp, Example: "charttool bump ", Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { diff --git a/clustertool/cmd/charts_deps.go b/clustertool/cmd/charts_deps.go index ea1be3525406..892d9648631c 100644 --- a/clustertool/cmd/charts_deps.go +++ b/clustertool/cmd/charts_deps.go @@ -1,15 +1,22 @@ package cmd import ( + "strings" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/charts/deps" "github.com/truecharts/public/clustertool/pkg/helper" ) +var chartsDepsLongHelp = strings.TrimSpace(` + +`) + var depsCmd = &cobra.Command{ Use: "deps", Short: "Download, Update and Verify Helm dependencies", + Long: chartsDepsLongHelp, Example: "charttool deps ", Run: func(cmd *cobra.Command, args []string) { if err := deps.LoadGPGKey(); err != nil { diff --git a/clustertool/cmd/charts_genchangelog.go b/clustertool/cmd/charts_genchangelog.go index 84a1b57e89f2..51188db80796 100644 --- a/clustertool/cmd/charts_genchangelog.go +++ b/clustertool/cmd/charts_genchangelog.go @@ -1,15 +1,22 @@ package cmd import ( + "strings" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/truecharts/public/clustertool/pkg/charts/changelog" ) +var chartsGenChangelogLongHelp = strings.TrimSpace(` + +`) + var genChangelogCmd = &cobra.Command{ Use: "genchangelog", Short: "Generate changelog for charts", + Long: chartsGenChangelogLongHelp, Example: "charttool genchangelog