feat: stub out kustomize renderer

The process-specific kustomize root path is not currently set, but will be soon.
This commit is contained in:
Jose Diaz-Gonzalez
2025-07-23 00:04:35 -04:00
parent 272327af89
commit d0ffd7d9f9
3 changed files with 31 additions and 2 deletions

View File

@@ -1494,6 +1494,10 @@ func getStartCommand(input StartCommandInput) (StartCommandOutput, error) {
}, nil }, nil
} }
func getProcessSpecificKustomizeRootPath(appName string) string {
return ""
}
func hasKustomizeRootPath(appName string) bool { func hasKustomizeRootPath(appName string) bool {
kustomizeRootPath := getComputedKustomizeRootPath(appName) kustomizeRootPath := getComputedKustomizeRootPath(appName)
if common.DirectoryExists(fmt.Sprintf("%s.%s.missing", kustomizeRootPath, os.Getenv("DOKKU_PID"))) { if common.DirectoryExists(fmt.Sprintf("%s.%s.missing", kustomizeRootPath, os.Getenv("DOKKU_PID"))) {

View File

@@ -56,6 +56,9 @@ type ChartInput struct {
// ChartPath is the path to the chart to install or upgrade // ChartPath is the path to the chart to install or upgrade
ChartPath string ChartPath string
// KustomizeRootPath is the path to the kustomize root path to use
KustomizeRootPath string
// Namespace is the namespace to install or upgrade the chart in // Namespace is the namespace to install or upgrade the chart in
Namespace string Namespace string
@@ -260,6 +263,10 @@ func (h *HelmAgent) InstallChart(ctx context.Context, input ChartInput) error {
input.Values = map[string]interface{}{} input.Values = map[string]interface{}{}
} }
kustomizeRenderer := KustomizeRenderer{
KustomizeRootPath: input.KustomizeRootPath,
}
client := action.NewInstall(h.Configuration) client := action.NewInstall(h.Configuration)
client.Atomic = false client.Atomic = false
client.ChartPathOptions = action.ChartPathOptions{} client.ChartPathOptions = action.ChartPathOptions{}
@@ -267,7 +274,11 @@ func (h *HelmAgent) InstallChart(ctx context.Context, input ChartInput) error {
client.DryRun = false client.DryRun = false
if os.Getenv("DOKKU_TRACE") == "1" { if os.Getenv("DOKKU_TRACE") == "1" {
client.DryRun = true client.DryRun = true
client.PostRenderer = &DebugRenderer{} client.PostRenderer = &DebugRenderer{
Renderer: &kustomizeRenderer,
}
} else {
client.PostRenderer = &kustomizeRenderer
} }
client.Namespace = namespace client.Namespace = namespace
client.ReleaseName = input.ReleaseName client.ReleaseName = input.ReleaseName
@@ -376,6 +387,10 @@ func (h *HelmAgent) UpgradeChart(ctx context.Context, input ChartInput) error {
input.Values = map[string]interface{}{} input.Values = map[string]interface{}{}
} }
kustomizeRenderer := KustomizeRenderer{
KustomizeRootPath: input.KustomizeRootPath,
}
client := action.NewUpgrade(h.Configuration) client := action.NewUpgrade(h.Configuration)
client.Atomic = input.RollbackOnFailure client.Atomic = input.RollbackOnFailure
client.ChartPathOptions = action.ChartPathOptions{} client.ChartPathOptions = action.ChartPathOptions{}
@@ -383,7 +398,11 @@ func (h *HelmAgent) UpgradeChart(ctx context.Context, input ChartInput) error {
client.MaxHistory = 10 client.MaxHistory = 10
if os.Getenv("DOKKU_TRACE") == "1" { if os.Getenv("DOKKU_TRACE") == "1" {
client.DryRun = true client.DryRun = true
client.PostRenderer = &DebugRenderer{} client.PostRenderer = &DebugRenderer{
Renderer: &kustomizeRenderer,
}
} else {
client.PostRenderer = &kustomizeRenderer
} }
client.Namespace = namespace client.Namespace = namespace
client.Timeout = input.Timeout client.Timeout = input.Timeout

View File

@@ -784,9 +784,15 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
} }
} }
kustomizeRootPath := ""
if hasKustomizeRootPath(appName) {
kustomizeRootPath = getProcessSpecificKustomizeRootPath(appName)
}
common.LogInfo2(fmt.Sprintf("Installing %s", appName)) common.LogInfo2(fmt.Sprintf("Installing %s", appName))
err = helmAgent.InstallOrUpgradeChart(ctx, ChartInput{ err = helmAgent.InstallOrUpgradeChart(ctx, ChartInput{
ChartPath: chartPath, ChartPath: chartPath,
KustomizeRootPath: kustomizeRootPath,
Namespace: namespace, Namespace: namespace,
ReleaseName: appName, ReleaseName: appName,
RollbackOnFailure: allowRollbacks, RollbackOnFailure: allowRollbacks,