chore(clustertool): prep for more longer description texts
This commit is contained in:
@@ -1,13 +1,20 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var advBootstrapLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var bootstrap = &cobra.Command{
|
var bootstrap = &cobra.Command{
|
||||||
Use: "bootstrap",
|
Use: "bootstrap",
|
||||||
Short: "bootstrap first Talos Node",
|
Short: "bootstrap first Talos Node",
|
||||||
|
Long: advBootstrapLongHelp,
|
||||||
Run: bootstrapfunc,
|
Run: bootstrapfunc,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
||||||
@@ -8,9 +10,14 @@ import (
|
|||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var advHealthLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var health = &cobra.Command{
|
var health = &cobra.Command{
|
||||||
Use: "health",
|
Use: "health",
|
||||||
Short: "Check Talos Cluster Health",
|
Short: "Check Talos Cluster Health",
|
||||||
|
Long: advHealthLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := sops.DecryptFiles(); err != nil {
|
if err := sops.DecryptFiles(); err != nil {
|
||||||
log.Info().Msgf("Error decrypting files: %v\n", err)
|
log.Info().Msgf("Error decrypting files: %v\n", err)
|
||||||
|
|||||||
@@ -2,15 +2,21 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var advPrecommitLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var precommit = &cobra.Command{
|
var precommit = &cobra.Command{
|
||||||
Use: "precommit",
|
Use: "precommit",
|
||||||
Short: "Runs the PreCommit encryption check",
|
Short: "Runs the PreCommit encryption check",
|
||||||
|
Long: advPrecommitLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := sops.CheckFilesAndReportEncryption(true, true); err != nil {
|
if err := sops.CheckFilesAndReportEncryption(true, true); err != nil {
|
||||||
log.Info().Msgf("Error checking files: %v\n", err)
|
log.Info().Msgf("Error checking files: %v\n", err)
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var advResetLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var reset = &cobra.Command{
|
var reset = &cobra.Command{
|
||||||
Use: "reset",
|
Use: "reset",
|
||||||
Short: "Reset Talos Nodes and Kubernetes",
|
Short: "Reset Talos Nodes and Kubernetes",
|
||||||
|
Long: advResetLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
var extraArgs []string
|
var extraArgs []string
|
||||||
node := ""
|
node := ""
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
||||||
"github.com/truecharts/public/clustertool/pkg/initfiles"
|
"github.com/truecharts/public/clustertool/pkg/initfiles"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var advTestCmdlongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var testcmd = &cobra.Command{
|
var testcmd = &cobra.Command{
|
||||||
Use: "test",
|
Use: "test",
|
||||||
Short: "test run",
|
Short: "test run",
|
||||||
|
Long: advTestCmdlongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
initfiles.LoadTalEnv(false)
|
initfiles.LoadTalEnv(false)
|
||||||
// err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports")
|
// err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports")
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
||||||
@@ -9,9 +11,14 @@ import (
|
|||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var applyLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var apply = &cobra.Command{
|
var apply = &cobra.Command{
|
||||||
Use: "apply",
|
Use: "apply",
|
||||||
Short: "apply TalosConfig",
|
Short: "apply TalosConfig",
|
||||||
|
Long: applyLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
var extraArgs []string
|
var extraArgs []string
|
||||||
node := ""
|
node := ""
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/charts/version"
|
"github.com/truecharts/public/clustertool/pkg/charts/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var chartsBumpLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var bumper = &cobra.Command{
|
var bumper = &cobra.Command{
|
||||||
Use: "bump",
|
Use: "bump",
|
||||||
Short: "generate a bumped image version",
|
Short: "generate a bumped image version",
|
||||||
|
Long: chartsBumpLongHelp,
|
||||||
Example: "charttool bump <version> <kind>",
|
Example: "charttool bump <version> <kind>",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/charts/deps"
|
"github.com/truecharts/public/clustertool/pkg/charts/deps"
|
||||||
"github.com/truecharts/public/clustertool/pkg/helper"
|
"github.com/truecharts/public/clustertool/pkg/helper"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var chartsDepsLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var depsCmd = &cobra.Command{
|
var depsCmd = &cobra.Command{
|
||||||
Use: "deps",
|
Use: "deps",
|
||||||
Short: "Download, Update and Verify Helm dependencies",
|
Short: "Download, Update and Verify Helm dependencies",
|
||||||
|
Long: chartsDepsLongHelp,
|
||||||
Example: "charttool deps <chart> <chart> <chart>",
|
Example: "charttool deps <chart> <chart> <chart>",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := deps.LoadGPGKey(); err != nil {
|
if err := deps.LoadGPGKey(); err != nil {
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/charts/changelog"
|
"github.com/truecharts/public/clustertool/pkg/charts/changelog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var chartsGenChangelogLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var genChangelogCmd = &cobra.Command{
|
var genChangelogCmd = &cobra.Command{
|
||||||
Use: "genchangelog",
|
Use: "genchangelog",
|
||||||
Short: "Generate changelog for charts",
|
Short: "Generate changelog for charts",
|
||||||
|
Long: chartsGenChangelogLongHelp,
|
||||||
Example: "charttool genchangelog <repo path> <template path> <charts dir>",
|
Example: "charttool genchangelog <repo path> <template path> <charts dir>",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if len(args) < 3 {
|
if len(args) < 3 {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@@ -8,9 +10,14 @@ import (
|
|||||||
"github.com/truecharts/public/clustertool/pkg/helper"
|
"github.com/truecharts/public/clustertool/pkg/helper"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var chartsGenChartsListLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var genChartListCmd = &cobra.Command{
|
var genChartListCmd = &cobra.Command{
|
||||||
Use: "genchartlist",
|
Use: "genchartlist",
|
||||||
Short: "Generate chart list json file",
|
Short: "Generate chart list json file",
|
||||||
|
Long: chartsGenChartsListLongHelp,
|
||||||
Example: "charttool genchartlist <path to charts folder>",
|
Example: "charttool genchartlist <path to charts folder>",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
opts := &website.ChartListOptions{
|
opts := &website.ChartListOptions{
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
"slices"
|
"slices"
|
||||||
@@ -10,9 +12,14 @@ import (
|
|||||||
"github.com/truecharts/public/clustertool/pkg/helper"
|
"github.com/truecharts/public/clustertool/pkg/helper"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var chartsGenMetaLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var genMetaCmd = &cobra.Command{
|
var genMetaCmd = &cobra.Command{
|
||||||
Use: "genmeta",
|
Use: "genmeta",
|
||||||
Short: "Generate and update Chart.yaml metadata",
|
Short: "Generate and update Chart.yaml metadata",
|
||||||
|
Long: chartsGenMetaLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
bump := ""
|
bump := ""
|
||||||
if len(args) > 0 && slices.Contains([]string{"patch", "minor", "major"}, args[0]) {
|
if len(args) > 0 && slices.Contains([]string{"patch", "minor", "major"}, args[0]) {
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/charts/image"
|
"github.com/truecharts/public/clustertool/pkg/charts/image"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var chartsTagCleanLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var tagCleaner = &cobra.Command{
|
var tagCleaner = &cobra.Command{
|
||||||
Use: "tagcleaner",
|
Use: "tagcleaner",
|
||||||
Short: "Creates a clean version tag from a container digest",
|
Short: "Creates a clean version tag from a container digest",
|
||||||
|
Long: chartsTagCleanLongHelp,
|
||||||
Example: "charttool tagcleaner <tag>",
|
Example: "charttool tagcleaner <tag>",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|||||||
@@ -2,15 +2,21 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var checkcyptLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var checkcrypt = &cobra.Command{
|
var checkcrypt = &cobra.Command{
|
||||||
Use: "checkcrypt",
|
Use: "checkcrypt",
|
||||||
Short: "Checks if all files are encrypted correctly in accordance with .sops.yaml",
|
Short: "Checks if all files are encrypted correctly in accordance with .sops.yaml",
|
||||||
|
Long: checkcyptLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := sops.CheckFilesAndReportEncryption(false, false); err != nil {
|
if err := sops.CheckFilesAndReportEncryption(false, false); err != nil {
|
||||||
log.Info().Msgf("Error checking files: %v\n", err)
|
log.Info().Msgf("Error checking files: %v\n", err)
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var decryptLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var decrypt = &cobra.Command{
|
var decrypt = &cobra.Command{
|
||||||
Use: "decrypt",
|
Use: "decrypt",
|
||||||
Short: "Decrypt all high-risk data using sops",
|
Short: "Decrypt all high-risk data using sops",
|
||||||
|
Long: decryptLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := sops.DecryptFiles(); err != nil {
|
if err := sops.DecryptFiles(); err != nil {
|
||||||
log.Info().Msgf("Error decrypting files: %v\n", err)
|
log.Info().Msgf("Error decrypting files: %v\n", err)
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var encryptLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var encrypt = &cobra.Command{
|
var encrypt = &cobra.Command{
|
||||||
Use: "encrypt",
|
Use: "encrypt",
|
||||||
Short: "Encrypt all high-risk data using sops",
|
Short: "Encrypt all high-risk data using sops",
|
||||||
|
Long: encryptLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := sops.EncryptAllFiles(); err != nil {
|
if err := sops.EncryptAllFiles(); err != nil {
|
||||||
log.Info().Msgf("Error encrypting files: %v\n", err)
|
log.Info().Msgf("Error encrypting files: %v\n", err)
|
||||||
|
|||||||
@@ -1,14 +1,42 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
talhelperCfg "github.com/budimanjojo/talhelper/v3/pkg/config"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"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{
|
var fluxBootstrapLongHelp = strings.TrimSpace(`
|
||||||
Use: "fluxBootstrap",
|
|
||||||
Short: "bootstrapFluxCD",
|
`)
|
||||||
|
|
||||||
|
var fluxbootstrap = &cobra.Command{
|
||||||
|
Use: "fluxbootstrap",
|
||||||
|
Short: "Manually bootstrap fluxcd on existing cluster",
|
||||||
|
Long: fluxBootstrapLongHelp,
|
||||||
|
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() {
|
func init() {
|
||||||
RootCmd.AddCommand(fluxBootstrap)
|
RootCmd.AddCommand(fluxbootstrap)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,21 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
|
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
|
||||||
"github.com/truecharts/public/clustertool/pkg/initfiles"
|
"github.com/truecharts/public/clustertool/pkg/initfiles"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var hrInstalLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var hrinstall = &cobra.Command{
|
var hrinstall = &cobra.Command{
|
||||||
Use: "install",
|
Use: "install",
|
||||||
Short: "install a helm-release file without flux, helm-release file needs to be called helm-release.yaml",
|
Short: "install a helm-release file without flux, helm-release file needs to be called helm-release.yaml",
|
||||||
|
Long: hrInstalLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
initfiles.LoadTalEnv(false)
|
initfiles.LoadTalEnv(false)
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,21 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
|
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
|
||||||
"github.com/truecharts/public/clustertool/pkg/initfiles"
|
"github.com/truecharts/public/clustertool/pkg/initfiles"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var hrUpgradeLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var hrupgrade = &cobra.Command{
|
var hrupgrade = &cobra.Command{
|
||||||
Use: "upgrade",
|
Use: "upgrade",
|
||||||
Short: "run helm-upgrade using a helm-release file without flux",
|
Short: "run helm-upgrade using a helm-release file without flux",
|
||||||
|
Long: hrUpgradeLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
initfiles.LoadTalEnv(false)
|
initfiles.LoadTalEnv(false)
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/info"
|
"github.com/truecharts/public/clustertool/pkg/info"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var infoLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var infoCmd = &cobra.Command{
|
var infoCmd = &cobra.Command{
|
||||||
Use: "info",
|
Use: "info",
|
||||||
Short: "Prints information about the clustertool binary",
|
Short: "Prints information about the clustertool binary",
|
||||||
|
Long: infoLongHelp,
|
||||||
Example: "clustertool info",
|
Example: "clustertool info",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
info.NewInfo().Print()
|
info.NewInfo().Print()
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/scale"
|
"github.com/truecharts/public/clustertool/pkg/scale"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var scaleExportLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var scaleexport = &cobra.Command{
|
var scaleexport = &cobra.Command{
|
||||||
Use: "export",
|
Use: "export",
|
||||||
Short: "Export SCALE Apps to file",
|
Short: "Export SCALE Apps to file",
|
||||||
|
Long: scaleExportLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
scale.ExportApps()
|
scale.ExportApps()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/scale"
|
"github.com/truecharts/public/clustertool/pkg/scale"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var scaleMigrateLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var scalemigrate = &cobra.Command{
|
var scalemigrate = &cobra.Command{
|
||||||
Use: "migrate",
|
Use: "migrate",
|
||||||
Short: "Migrate exported SCALE Apps to the Talos Cluster",
|
Short: "Migrate exported SCALE Apps to the Talos Cluster",
|
||||||
|
Long: scaleMigrateLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
err := scale.ProcessJSONFiles("./truenas_exports")
|
err := scale.ProcessJSONFiles("./truenas_exports")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
"github.com/truecharts/public/clustertool/pkg/gencmd"
|
||||||
@@ -8,9 +10,14 @@ import (
|
|||||||
"github.com/truecharts/public/clustertool/pkg/sops"
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var upgradeLongHelp = strings.TrimSpace(`
|
||||||
|
|
||||||
|
`)
|
||||||
|
|
||||||
var upgrade = &cobra.Command{
|
var upgrade = &cobra.Command{
|
||||||
Use: "upgrade",
|
Use: "upgrade",
|
||||||
Short: "Upgrade Talos Nodes and Kubernetes",
|
Short: "Upgrade Talos Nodes and Kubernetes",
|
||||||
|
Long: upgradeLongHelp,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
var extraArgs []string
|
var extraArgs []string
|
||||||
node := ""
|
node := ""
|
||||||
|
|||||||
Reference in New Issue
Block a user