fix(clustertool): fix manifest path init issues for multicluster setups

This commit is contained in:
Kjeld Schouten
2024-10-27 19:38:09 +01:00
parent edb6a99dcd
commit dc22eaff8e
3 changed files with 8 additions and 6 deletions
+1
View File
@@ -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")
+7 -1
View File
@@ -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)
-5
View File
@@ -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.*",