@@ -304,6 +304,13 @@ func TestReconcile(t *testing.T) {
304
304
),
305
305
)
306
306
307
+ taskRunWithAnnotations := tb .TaskRun ("test-taskrun-with-annotations" , "foo" ,
308
+ tb .TaskRunAnnotation ("TaskRunAnnotation" , "TaskRunValue" ),
309
+ tb .TaskRunSpec (
310
+ tb .TaskRunTaskRef (simpleTask .Name ),
311
+ ),
312
+ )
313
+
307
314
taskRunWithResourceRequests := tb .TaskRun ("test-taskrun-with-resource-requests" , "foo" ,
308
315
tb .TaskRunSpec (
309
316
tb .TaskRunTaskSpec (
@@ -347,7 +354,7 @@ func TestReconcile(t *testing.T) {
347
354
taskRunSuccess , taskRunWithSaSuccess ,
348
355
taskRunTemplating , taskRunInputOutput ,
349
356
taskRunWithTaskSpec , taskRunWithClusterTask , taskRunWithResourceSpecAndTaskSpec ,
350
- taskRunWithLabels , taskRunWithResourceRequests , taskRunTaskEnv , taskRunWithPod ,
357
+ taskRunWithLabels , taskRunWithAnnotations , taskRunWithResourceRequests , taskRunTaskEnv , taskRunWithPod ,
351
358
}
352
359
353
360
d := test.Data {
@@ -845,6 +852,42 @@ func TestReconcile(t *testing.T) {
845
852
),
846
853
),
847
854
),
855
+ }, {
856
+ name : "taskrun-with-annotations" ,
857
+ taskRun : taskRunWithAnnotations ,
858
+ wantPod : tb .Pod ("test-taskrun-with-annotations-pod-123456" , "foo" ,
859
+ tb .PodAnnotation ("sidecar.istio.io/inject" , "false" ),
860
+ tb .PodAnnotation ("TaskRunAnnotation" , "TaskRunValue" ),
861
+ tb .PodLabel (taskNameLabelKey , "test-task" ),
862
+ tb .PodLabel (taskRunNameLabelKey , "test-taskrun-with-annotations" ),
863
+ tb .PodOwnerReference ("TaskRun" , "test-taskrun-with-annotations" ,
864
+ tb .OwnerReferenceAPIVersion (currentApiVersion )),
865
+ tb .PodSpec (
866
+ tb .PodVolumes (toolsVolume , workspaceVolume , homeVolume ),
867
+ tb .PodRestartPolicy (corev1 .RestartPolicyNever ),
868
+ getCredentialsInitContainer ("9l9zj" ),
869
+ getPlaceToolsInitContainer (),
870
+ tb .PodContainer ("build-step-simple-step" , "foo" ,
871
+ tb .Command (entrypointLocation ),
872
+ tb .Args ("-wait_file" , "" , "-post_file" , "/builder/tools/0" , "-entrypoint" , "/mycmd" , "--" ),
873
+ tb .WorkingDir (workspaceDir ),
874
+ tb .EnvVar ("HOME" , "/builder/home" ),
875
+ tb .VolumeMount ("tools" , "/builder/tools" ),
876
+ tb .VolumeMount ("workspace" , workspaceDir ),
877
+ tb .VolumeMount ("home" , "/builder/home" ),
878
+ tb .Resources (tb .Requests (
879
+ tb .CPU ("0" ),
880
+ tb .Memory ("0" ),
881
+ tb .EphemeralStorage ("0" ),
882
+ )),
883
+ ),
884
+ tb .PodContainer ("nop" , "override-with-nop:latest" ,
885
+ tb .Command ("/builder/tools/entrypoint" ),
886
+ tb .Args ("-wait_file" , "/builder/tools/0" , "-post_file" , "/builder/tools/1" , "-entrypoint" , "/ko-app/nop" , "--" ),
887
+ tb .VolumeMount (entrypoint .MountName , entrypoint .MountPoint ),
888
+ ),
889
+ ),
890
+ ),
848
891
}, {
849
892
name : "task-env" ,
850
893
taskRun : taskRunTaskEnv ,
0 commit comments