diff --git a/clustertool/cmd/root.go b/clustertool/cmd/root.go index cc2fd1f3877..f7e820734cb 100644 --- a/clustertool/cmd/root.go +++ b/clustertool/cmd/root.go @@ -36,6 +36,7 @@ func Execute() error { helper.ClusterEnvFile = filepath.Join(helper.ClusterPath, "/clusterenv.yaml") helper.TalConfigFile = filepath.Join(helper.ClusterPath, "/talos", "talconfig.yaml") helper.TalosPath = filepath.Join(helper.ClusterPath, "/talos") + helper.KubernetesPath = filepath.Join(helper.ClusterPath, "/kubernetes") helper.TalosGenerated = filepath.Join(helper.TalosPath, "/generated") helper.TalosConfigFile = filepath.Join(helper.TalosGenerated, "talosconfig") helper.TalSecretFile = filepath.Join(helper.TalosGenerated, "talsecret.yaml") diff --git a/clustertool/pkg/gencmd/bootstrap.go b/clustertool/pkg/gencmd/bootstrap.go index 651c01fe966..f9cc3d2ade4 100644 --- a/clustertool/pkg/gencmd/bootstrap.go +++ b/clustertool/pkg/gencmd/bootstrap.go @@ -21,6 +21,12 @@ import ( var HelmRepos map[string]*fluxhandler.HelmRepo +var manifestPaths = []string{ + filepath.Join(helper.KubernetesPath, "flux-system", "flux", "sopssecret.secret.yaml"), + filepath.Join(helper.KubernetesPath, "flux-system", "flux", "deploykey.secret.yaml"), + filepath.Join(helper.KubernetesPath, "flux-system", "flux", "clustersettings.secret.yaml"), +} + func GenBootstrap(node string, extraFlags []string) string { cfg, err := talhelperCfg.LoadAndValidateFromFile(helper.TalConfigFile, []string{helper.ClusterEnvFile}, false) if err != nil { @@ -158,7 +164,7 @@ func RunBootstrap(args []string) { } } - for _, filePath := range helper.ManifestPaths { + for _, filePath := range manifestPaths { log.Info().Msgf("Bootstrap: Loading Manifest: %v", filePath) if err := kubectlcmds.KubectlApply(ctx, filePath); err != nil { log.Info().Msgf("Error applying manifest for %s: %v\n", filepath.Base(filePath), err) diff --git a/clustertool/pkg/helper/vars.go b/clustertool/pkg/helper/vars.go index 52c567164aa..18772a686da 100644 --- a/clustertool/pkg/helper/vars.go +++ b/clustertool/pkg/helper/vars.go @@ -27,11 +27,6 @@ var ( AllIPs = []string{} ControlPlaneIPs = []string{} WorkerIPs = []string{} - ManifestPaths = []string{ - filepath.Join(KubernetesPath, "flux-system", "flux", "sopssecret.secret.yaml"), - filepath.Join(KubernetesPath, "flux-system", "flux", "deploykey.secret.yaml"), - filepath.Join(KubernetesPath, "flux-system", "flux", "clustersettings.secret.yaml"), - } KubeFilterStr = []string{ ".*would violate PodSecurity.*",