Skip to content

Commit

Permalink
Made formatting and comment changes in response to code review
Browse files Browse the repository at this point in the history
Signed-off-by: Tom George <tg82490@gmail.com>
  • Loading branch information
tomgeorge authored and tekton-robot committed Feb 4, 2020
1 parent be536b6 commit 69c8876
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
2 changes: 0 additions & 2 deletions examples/taskruns/sidecar-ready-script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ spec:
steps:
- name: check-ready
image: ubuntu
# The step will only succeed if the sidecar has written this file, which
# it does 5s after it starts, before it reports Ready.
script: cat /shared/message
volumeMounts:
- name: shared
Expand Down
30 changes: 14 additions & 16 deletions pkg/pod/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,34 +406,32 @@ func TestMakePod(t *testing.T) {
Image: "primary-image",
Command: []string{"cmd"}, // avoid entrypoint lookup.
}}},
Sidecars: []v1alpha1.Sidecar{
{
Container: corev1.Container{
Name: "sc-name",
Image: "sidecar-image",
},
Script: "#!/bin/sh\necho hello from sidecar",
Sidecars: []v1alpha1.Sidecar{{
Container: corev1.Container{
Name: "sc-name",
Image: "sidecar-image",
},
Script: "#!/bin/sh\necho hello from sidecar",
},
},
},
wantAnnotations: map[string]string{},
want: &corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyNever,
InitContainers: []corev1.Container{
{
Name: "place-scripts",
Image: "busybox",
Command: []string{"sh"},
TTY: true,
VolumeMounts: []corev1.VolumeMount{scriptsVolumeMount},
Args: []string{"-c", `tmpfile="/tekton/scripts/sidecar-script-0-9l9zj"
InitContainers: []corev1.Container{{
Name: "place-scripts",
Image: "busybox",
Command: []string{"sh"},
TTY: true,
VolumeMounts: []corev1.VolumeMount{scriptsVolumeMount},
Args: []string{"-c", `tmpfile="/tekton/scripts/sidecar-script-0-9l9zj"
touch ${tmpfile} && chmod +x ${tmpfile}
cat > ${tmpfile} << 'sidecar-script-heredoc-randomly-generated-mz4c7'
#!/bin/sh
echo hello from sidecar
sidecar-script-heredoc-randomly-generated-mz4c7
`},
},
},
placeToolsInit,
},
Containers: []corev1.Container{{
Expand Down

0 comments on commit 69c8876

Please sign in to comment.