feat: add the ability to specify a kustomize-root-path

This will default to `config/kustomize`, though may change to `.dokku/kustomize` in the future.
This commit is contained in:
Jose Diaz-Gonzalez
2025-07-08 20:52:26 -04:00
parent e034421ea9
commit 5ae6c1c845
3 changed files with 34 additions and 0 deletions

View File

@@ -1190,6 +1190,23 @@ func getGlobalLetsencryptEmailStag() string {
return common.PropertyGetDefault("scheduler-k3s", "--global", "letsencrypt-email-stag", "")
}
func getKustomizeRootPath(appName string) string {
return common.PropertyGetDefault("scheduler-k3s", appName, "kustomize-root-path", "")
}
func getGlobalKustomizeRootPath() string {
return common.PropertyGetDefault("scheduler-k3s", "--global", "kustomize-root-path", "config/kustomize")
}
func getComputedKustomizeRootPath(appName string) string {
kustomizeRootPath := getKustomizeRootPath(appName)
if kustomizeRootPath == "" {
kustomizeRootPath = getGlobalKustomizeRootPath()
}
return kustomizeRootPath
}
func getNamespace(appName string) string {
return common.PropertyGetDefault("scheduler-k3s", appName, "namespace", "")
}

View File

@@ -28,6 +28,9 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
"--scheduler-k3s-global-ingress-class": reportGlobalIngressClass,
"--scheduler-k3s-global-letsencrypt-email-prod": reportGlobalLetsencryptEmailProd,
"--scheduler-k3s-global-letsencrypt-email-stag": reportGlobalLetsencryptEmailStag,
"--scheduler-k3s-computed-kustomize-root-path": reportComputedKustomizeRootPath,
"--scheduler-k3s-kustomize-root-path": reportKustomizeRootPath,
"--scheduler-k3s-global-kustomize-root-path": reportGlobalKustomizeRootPath,
"--scheduler-k3s-computed-namespace": reportComputedNamespace,
"--scheduler-k3s-namespace": reportNamespace,
"--scheduler-k3s-global-namespace": reportGlobalNamespace,
@@ -148,6 +151,18 @@ func reportGlobalLetsencryptEmailStag(appName string) string {
return getGlobalLetsencryptEmailStag()
}
func reportComputedKustomizeRootPath(appName string) string {
return getComputedKustomizeRootPath(appName)
}
func reportKustomizeRootPath(appName string) string {
return getKustomizeRootPath(appName)
}
func reportGlobalKustomizeRootPath(appName string) string {
return getGlobalKustomizeRootPath()
}
func reportComputedNamespace(appName string) string {
return getComputedNamespace(appName)
}

View File

@@ -20,6 +20,7 @@ var (
DefaultProperties = map[string]string{
"deploy-timeout": "",
"letsencrypt-server": "",
"kustomize-root-path": "",
"image-pull-secrets": "",
"namespace": "",
"rollback-on-failure": "",
@@ -33,6 +34,7 @@ var (
"ingress-class": true,
"kube-context": true,
"kubeconfig-path": true,
"kustomize-root-path": true,
"letsencrypt-server": true,
"letsencrypt-email-prod": true,
"letsencrypt-email-stag": true,