Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: knative/build
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 80d210c2d5cd6697c8bf878f6603cab79c12fae0
Choose a base ref
..
head repository: knative/build
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d7d83316d29486bc447971667ce60e2cfdf6e07c
Choose a head ref
Showing with 160 additions and 124 deletions.
  1. +14 −7 pkg/reconciler/build/resources/pod.go
  2. +146 −117 pkg/reconciler/build/resources/pod_test.go
21 changes: 14 additions & 7 deletions pkg/reconciler/build/resources/pod.go
Original file line number Diff line number Diff line change
@@ -252,6 +252,7 @@ func MakePod(build *v1alpha1.Build, kubeclient kubernetes.Interface) (*corev1.Po

initContainers := []corev1.Container{*cred}
podContainers := []corev1.Container{}

if source := build.Spec.Source; source != nil {
sources = []v1alpha1.SourceSpec{*source}
}
@@ -280,13 +281,17 @@ func MakePod(build *v1alpha1.Build, kubeclient kubernetes.Interface) (*corev1.Po
return nil, err
}
// Prepend the custom container to the steps, to be augmented later with env, volume mounts, etc.

// initContainers = append(initContainers, *cust)
// TODO(aaron-prindle) not if I correctly handled this piece....
build.Spec.Steps = append([]corev1.Container{*cust}, build.Spec.Steps...)
}
// webhook validation checks that only one source has subPath defined
workspaceSubPath = source.SubPath
}

// setup entrypoint rewriting container
// init container that copies entrypoint binary into shared volume
// to be used by all other containers w/ entrypoint rewriting
initContainers = append(initContainers,
corev1.Container{
Name: InitContainerName,
@@ -333,12 +338,7 @@ func MakePod(build *v1alpha1.Build, kubeclient kubernetes.Interface) (*corev1.Po
// declared user volumes.
volumes := append(build.Spec.Volumes, implicitVolumes...)
volumes = append(volumes, secrets...)
volumes = append(volumes, corev1.Volume{
Name: MountName,
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
})
volumes = append(volumes, toolsVolume)
if err := v1alpha1.ValidateVolumes(volumes); err != nil {
return nil, err
}
@@ -403,6 +403,13 @@ var toolsMount = corev1.VolumeMount{
MountPath: MountPoint,
}

var toolsVolume = corev1.Volume{
Name: MountName,
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
}

type entrypointArgs struct {
Args []string `json:"args"`
ProcessLog string `json:"process_log"`
Loading