feat(clustertool): actually fully block genconfig unless first init is finished

This commit is contained in:
Kjeld Schouten
2024-11-06 10:37:16 +01:00
parent d707b498ab
commit 269a895ab1
4 changed files with 44 additions and 5 deletions
+2
View File
@@ -28,9 +28,11 @@ func RunBootstrap(args []string) {
if len(args) > 1 {
extraArgs = args[1:]
}
if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err)
}
bootstrapNode := talassist.TalConfig.Nodes[0].IPAddress
bootstrapcmds := GenPlain("bootstrap", bootstrapNode, extraArgs)
+8
View File
@@ -11,10 +11,18 @@ import (
"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"
"github.com/truecharts/public/clustertool/pkg/talassist"
)
func GenConfig(args []string) error {
if initfiles.CheckRunAgainFileExists() {
log.Fatal().Msg("You need to re-run Init. Exiting...")
os.Exit(1)
}
if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err)
}
talassist.LoadTalConfig()
talassist.GenSchema()
initfiles.GenTalEnvConfigMap()