fix(clustertool): fix manifest path init issues for multicluster setups
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.*",
|
||||
|
||||
Reference in New Issue
Block a user