11package cmd
22
33import (
4+ "context"
5+ "os"
6+ "path/filepath"
47 "strings"
58
9+ "github.com/rs/zerolog/log"
610 "github.com/spf13/cobra"
11+ "github.com/truecharts/public/clustertool/pkg/helper"
712 "github.com/truecharts/public/clustertool/pkg/initfiles"
13+ "github.com/truecharts/public/clustertool/pkg/kubectlcmds"
814 "github.com/truecharts/public/clustertool/pkg/talassist"
915)
1016
@@ -17,13 +23,25 @@ var testcmd = &cobra.Command{
1723 Short : "tests specific code for developer usages" ,
1824 Long : advTestCmdlongHelp ,
1925 Run : func (cmd * cobra.Command , args []string ) {
26+ ctx := context .Background ()
2027 initfiles .LoadTalEnv (false )
2128 talassist .LoadTalConfig ()
2229 // err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports")
2330 // if err != nil {
2431 // log.Info().Msg("Error:", err)
2532 // }
26- RunApply (false , "" , []string {})
33+ var manifestPaths = []string {
34+ filepath .Join (helper .KubernetesPath , "flux-system" , "flux" , "sopssecret.secret.yaml" ),
35+ filepath .Join (helper .KubernetesPath , "flux-system" , "flux" , "deploykey.secret.yaml" ),
36+ filepath .Join (helper .KubernetesPath , "flux-system" , "flux" , "clustersettings.secret.yaml" ),
37+ }
38+ for _ , filePath := range manifestPaths {
39+ log .Info ().Msgf ("Bootstrap: Loading Manifest: %v" , filePath )
40+ if err := kubectlcmds .KubectlApply (ctx , filePath ); err != nil {
41+ log .Info ().Msgf ("Error applying manifest for %s: %v\n " , filepath .Base (filePath ), err )
42+ os .Exit (1 )
43+ }
44+ }
2745 },
2846}
2947
0 commit comments