|
|
@ -204,8 +204,7 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
|
|
|
|
|
|
|
|
|
|
|
|
func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control) error {
|
|
|
|
func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control) error {
|
|
|
|
dataDir := filepath.Join(controlConfig.DataDir, "static")
|
|
|
|
dataDir := filepath.Join(controlConfig.DataDir, "static")
|
|
|
|
stageTraefik := doStageTraefik(sc)
|
|
|
|
if err := static.Stage(dataDir); err != nil {
|
|
|
|
if err := static.Stage(dataDir, stageTraefik); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dataDir = filepath.Join(controlConfig.DataDir, "manifests")
|
|
|
|
dataDir = filepath.Join(controlConfig.DataDir, "manifests")
|
|
|
@ -216,7 +215,7 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
skip := controlConfig.Skips
|
|
|
|
skip := controlConfig.Skips
|
|
|
|
if !stageTraefik {
|
|
|
|
if !checkStageTraefik(sc) {
|
|
|
|
skip["traefik"] = true
|
|
|
|
skip["traefik"] = true
|
|
|
|
skip["traefik-crd"] = true
|
|
|
|
skip["traefik-crd"] = true
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -227,13 +226,13 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
|
|
|
|
return deploy.WatchFiles(ctx, sc.Apply, sc.K3s.K3s().V1().Addon(), controlConfig.Disables, dataDir)
|
|
|
|
return deploy.WatchFiles(ctx, sc.Apply, sc.K3s.K3s().V1().Addon(), controlConfig.Disables, dataDir)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// doStageTraefik checks on running traefik HelmChart version and traefik
|
|
|
|
// checkStageTraefik checks on running traefik HelmChart version and traefik
|
|
|
|
// HelmChartConfig.
|
|
|
|
// HelmChartConfig.
|
|
|
|
// Traefik should skip stage when it is v1 and have existing customize traefik
|
|
|
|
// Traefik should skip stage when it is v1 and have existing customize traefik
|
|
|
|
// HelmChartConfig due to the incompatible configuration from v1 to v2.
|
|
|
|
// HelmChartConfig due to the incompatible configuration from v1 to v2.
|
|
|
|
// It will progress stage on upgrade or restart when no customized traefik
|
|
|
|
// It will progress stage on upgrade or restart when no customized traefik
|
|
|
|
// HelmChartConfig exists on the cluster.
|
|
|
|
// HelmChartConfig exists on the cluster.
|
|
|
|
func doStageTraefik(sc *Context) bool {
|
|
|
|
func checkStageTraefik(sc *Context) bool {
|
|
|
|
if isHelmChartTraefikV1(sc) && isHelmChartConfigExist(sc, "traefik") {
|
|
|
|
if isHelmChartTraefikV1(sc) && isHelmChartConfigExist(sc, "traefik") {
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|