diff --git a/pkg/apis/build/v1alpha2/build_pod.go b/pkg/apis/build/v1alpha2/build_pod.go index 556020e12..baffccf19 100644 --- a/pkg/apis/build/v1alpha2/build_pod.go +++ b/pkg/apis/build/v1alpha2/build_pod.go @@ -28,11 +28,10 @@ const ( secretVolumeNameTemplate = "secret-volume-%v" pullSecretVolumeNameTemplate = "pull-secret-volume-%v" - completionTerminationMessagePathWindows = "/dev/termination-log" - completionTerminationMessagePathLinux = "/tmp/termination-log" - cosignDefaultSecretPath = "/var/build-secrets/cosign/%s" - defaultSecretPath = "/var/build-secrets/%s" - ReportTOMLPath = "/var/report/report.toml" + completionTerminationMessagePath = "/tmp/termination-log" + cosignDefaultSecretPath = "/var/build-secrets/cosign/%s" + defaultSecretPath = "/var/build-secrets/%s" + ReportTOMLPath = "/var/report/report.toml" BuildLabel = "kpack.io/build" k8sOSLabel = "kubernetes.io/os" @@ -97,9 +96,9 @@ func (bpi *BuildPodImages) completion(os string) string { func terminationMsgPath(os string) string { switch os { case "windows": - return completionTerminationMessagePathWindows + return "" default: - return completionTerminationMessagePathLinux + return completionTerminationMessagePath } } @@ -366,7 +365,7 @@ func (b *Build) BuildPod(images BuildPodImages, buildContext BuildContext) (*cor Env: []corev1.EnvVar{ homeEnv, {Name: CacheTagEnvVar, Value: b.Spec.RegistryCacheTag()}, - {Name: TerminationMessagePathEnvVar, Value: terminationMsgPath(buildContext.os())}, + {Name: TerminationMessagePathEnvVar, Value: completionTerminationMessagePath}, }, Args: args( b.notaryArgs(), @@ -839,7 +838,7 @@ func (b *Build) rebasePod(buildContext BuildContext, images BuildPodImages) (*co Command: []string{"/cnb/process/completion"}, Env: []corev1.EnvVar{ {Name: CacheTagEnvVar, Value: b.Spec.RegistryCacheTag()}, - {Name: TerminationMessagePathEnvVar, Value: terminationMsgPath(buildContext.os())}, + {Name: TerminationMessagePathEnvVar, Value: completionTerminationMessagePath}, }, Args: args( b.notaryArgs(), diff --git a/pkg/apis/build/v1alpha2/build_pod_test.go b/pkg/apis/build/v1alpha2/build_pod_test.go index 93d45be38..2e2dea31a 100644 --- a/pkg/apis/build/v1alpha2/build_pod_test.go +++ b/pkg/apis/build/v1alpha2/build_pod_test.go @@ -2636,7 +2636,7 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) { assert.Equal(t, completionContainer.Env, []corev1.EnvVar{ {Name: "USERPROFILE", Value: "/builder/home"}, {Name: "CACHE_TAG", Value: ""}, - {Name: "TERMINATION_MESSAGE_PATH", Value: "/dev/termination-log"}, + {Name: "TERMINATION_MESSAGE_PATH", Value: "/tmp/termination-log"}, }) })