mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
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", "")
|
||||
}
|
||||
|
||||
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 {
|
||||
return common.PropertyGetDefault("scheduler-k3s", appName, "kustomize-root-path", "")
|
||||
}
|
||||
@@ -1498,17 +1503,18 @@ func getProcessSpecificKustomizeRootPath(appName string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func hasKustomizeRootPath(appName string) bool {
|
||||
kustomizeRootPath := getComputedKustomizeRootPath(appName)
|
||||
if common.DirectoryExists(fmt.Sprintf("%s.%s.missing", kustomizeRootPath, os.Getenv("DOKKU_PID"))) {
|
||||
func hasKustomizeDirectory(appName string) bool {
|
||||
directory := getKustomizeDirectory(appName)
|
||||
|
||||
if common.DirectoryExists(fmt.Sprintf("%s.%s.missing", directory, os.Getenv("DOKKU_PID"))) {
|
||||
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 common.DirectoryExists(kustomizeRootPath)
|
||||
return common.DirectoryExists(directory)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "scheduler-k3s", appName)
|
||||
existingKustomizeDirectory := filepath.Join(directory, "kustomization")
|
||||
existingKustomizeDirectory := getKustomizeDirectory(appName)
|
||||
files, err := filepath.Glob(fmt.Sprintf("%s.*", existingKustomizeDirectory))
|
||||
if err != nil {
|
||||
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{
|
||||
Trigger: "git-get-property",
|
||||
Args: []string{appName, "source-image"},
|
||||
@@ -785,7 +784,7 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
|
||||
}
|
||||
|
||||
kustomizeRootPath := ""
|
||||
if hasKustomizeRootPath(appName) {
|
||||
if hasKustomizeDirectory(appName) {
|
||||
kustomizeRootPath = getProcessSpecificKustomizeRootPath(appName)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user