fix: correct kustomize root path check
This commit is contained in:
@@ -1190,6 +1190,11 @@ func getGlobalLetsencryptEmailStag() string {
|
|||||||
return common.PropertyGetDefault("scheduler-k3s", "--global", "letsencrypt-email-stag", "")
|
return common.PropertyGetDefault("scheduler-k3s", "--global", "letsencrypt-email-stag", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getKustomizeDirectory(appName string) string {
|
||||||
|
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "scheduler-k3s", appName)
|
||||||
|
return filepath.Join(directory, "kustomization")
|
||||||
|
}
|
||||||
|
|
||||||
func getKustomizeRootPath(appName string) string {
|
func getKustomizeRootPath(appName string) string {
|
||||||
return common.PropertyGetDefault("scheduler-k3s", appName, "kustomize-root-path", "")
|
return common.PropertyGetDefault("scheduler-k3s", appName, "kustomize-root-path", "")
|
||||||
}
|
}
|
||||||
@@ -1498,17 +1503,18 @@ func getProcessSpecificKustomizeRootPath(appName string) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func hasKustomizeRootPath(appName string) bool {
|
func hasKustomizeDirectory(appName string) bool {
|
||||||
kustomizeRootPath := getComputedKustomizeRootPath(appName)
|
directory := getKustomizeDirectory(appName)
|
||||||
if common.DirectoryExists(fmt.Sprintf("%s.%s.missing", kustomizeRootPath, os.Getenv("DOKKU_PID"))) {
|
|
||||||
|
if common.DirectoryExists(fmt.Sprintf("%s.%s.missing", directory, os.Getenv("DOKKU_PID"))) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if common.DirectoryExists(fmt.Sprintf("%s.%s", kustomizeRootPath, os.Getenv("DOKKU_PID"))) {
|
if common.DirectoryExists(fmt.Sprintf("%s.%s", directory, os.Getenv("DOKKU_PID"))) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return common.DirectoryExists(kustomizeRootPath)
|
return common.DirectoryExists(directory)
|
||||||
}
|
}
|
||||||
|
|
||||||
func installHelmCharts(ctx context.Context, clientset KubernetesClient, shouldInstall func(HelmChart) bool) error {
|
func installHelmCharts(ctx context.Context, clientset KubernetesClient, shouldInstall func(HelmChart) bool) error {
|
||||||
|
|||||||
@@ -63,8 +63,7 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "scheduler-k3s", appName)
|
existingKustomizeDirectory := getKustomizeDirectory(appName)
|
||||||
existingKustomizeDirectory := filepath.Join(directory, "kustomization")
|
|
||||||
files, err := filepath.Glob(fmt.Sprintf("%s.*", existingKustomizeDirectory))
|
files, err := filepath.Glob(fmt.Sprintf("%s.*", existingKustomizeDirectory))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -75,7 +74,7 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processSpecificKustomizeRootPath := fmt.Sprintf("%s.%s", kustomizeRootPath, os.Getenv("DOKKU_PID"))
|
processSpecificKustomizeRootPath := fmt.Sprintf("%s.%s", existingKustomizeDirectory, os.Getenv("DOKKU_PID"))
|
||||||
results, _ := common.CallPlugnTrigger(common.PlugnTriggerInput{
|
results, _ := common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||||
Trigger: "git-get-property",
|
Trigger: "git-get-property",
|
||||||
Args: []string{appName, "source-image"},
|
Args: []string{appName, "source-image"},
|
||||||
@@ -785,7 +784,7 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
kustomizeRootPath := ""
|
kustomizeRootPath := ""
|
||||||
if hasKustomizeRootPath(appName) {
|
if hasKustomizeDirectory(appName) {
|
||||||
kustomizeRootPath = getProcessSpecificKustomizeRootPath(appName)
|
kustomizeRootPath = getProcessSpecificKustomizeRootPath(appName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user