mirror of
https://github.com/truecharts/charts.git
synced 2026-07-07 10:46:26 -03:00
37 lines
845 B
Go
37 lines
845 B
Go
package cmd
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
"github.com/spf13/cobra"
|
|
"github.com/trueforge-org/truecharts/clustertool/pkg/fluxhandler"
|
|
"github.com/trueforge-org/truecharts/clustertool/pkg/initfiles"
|
|
"github.com/trueforge-org/truecharts/clustertool/pkg/sops"
|
|
)
|
|
|
|
var fluxBootstrapLongHelp = strings.TrimSpace(`
|
|
|
|
`)
|
|
|
|
var fluxbootstrap = &cobra.Command{
|
|
Use: "bootstrap",
|
|
Short: "Manually bootstrap fluxcd on existing cluster",
|
|
Example: "clustertool flux bootstrap",
|
|
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)
|
|
fluxhandler.FluxBootstrap(ctx)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
fluxCmd.AddCommand(fluxbootstrap)
|
|
}
|