Skip to content

Commit

Permalink
fix(core): prevent null outputContent
Browse files Browse the repository at this point in the history
in the BakeStatus that JobExecutorLocal.updateStatus returns.

Before this change, if the output of e.g. helm template is an empty string, the BakeStatus object that JobExecutorLocal.updateStatus returns is null, and HelmTemplateUtils.removeTestsDirectoryTemplates throws a NullPointerException.

HelmBakeManifestService.bake calls BakeManifestService.doBake which calls JobExecutorLocal.updateStatus, and then HelmBakeManifestService.bake calls HelmTemplateUtils.removeTestsDirectoryTemplates with the resulting String.

With this change, removeTestsDirectoryTemplates gets an empty string, and so the bake manifest endpoint (e.g. POST /api/v2/manifest/bake/helm) returns an empty Artifact.

Without a corresponding change to clouddriver to handle a null KubernetesManifest, there's still a clouddriver crash in a deploy manifest that consumes the output of this bake, but it's progress.
  • Loading branch information
dbyron-sf committed Jan 23, 2025
1 parent 61380d1 commit 32f5b9e
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ class JobExecutorLocal implements JobExecutor {
bakeStatus.state = BakeStatus.State.RUNNING
}

if (outputContent) {
bakeStatus.outputContent = outputContent
}
bakeStatus.outputContent = outputContent

if (logsContent) {
bakeStatus.logsContent = logsContent
Expand Down

0 comments on commit 32f5b9e

Please sign in to comment.