@@ -405,6 +405,48 @@ func TestBuildSkipCheckout(t *testing.T) {
405
405
}
406
406
}
407
407
408
+ func TestBuildCheckoutEmptyConfigEnv (t * testing.T ) {
409
+ t .Parallel ()
410
+
411
+ pluginsYAML := `- github.com/buildkite-plugins/kubernetes-buildkite-plugin:
412
+ checkout: {}
413
+ `
414
+
415
+ pluginsJSON , err := yaml .YAMLToJSONStrict ([]byte (pluginsYAML ))
416
+ require .NoError (t , err )
417
+
418
+ job := & api.CommandJob {
419
+ Uuid : "abc" ,
420
+ Command : "echo hello world" ,
421
+ Env : []string {fmt .Sprintf ("BUILDKITE_PLUGINS=%s" , pluginsJSON )},
422
+ AgentQueryRules : []string {"queue=kubernetes" },
423
+ }
424
+
425
+ worker := scheduler .New (
426
+ zaptest .NewLogger (t ),
427
+ nil ,
428
+ scheduler.Config {
429
+ Namespace : "buildkite" ,
430
+ Image : "buildkite/agent:latest" ,
431
+ AgentTokenSecretName : "bkcq_1234567890" ,
432
+ },
433
+ )
434
+ inputs , err := worker .ParseJob (job )
435
+ require .NoError (t , err )
436
+ kjob , err := worker .Build (& corev1.PodSpec {}, false , inputs )
437
+ require .NoError (t , err )
438
+
439
+ for _ , container := range kjob .Spec .Template .Spec .Containers {
440
+ if container .Name == "checkout" {
441
+ for _ , envVar := range container .Env {
442
+ if envVar .Name == "BUILDKITE_GIT_SUBMODULE_CLONE_CONFIG" {
443
+ t .Error ("with `checkout: {}`, want no BUILDKITE_GIT_SUBMODULE_CLONE_CONFIG env on checkout container" )
444
+ }
445
+ }
446
+ }
447
+ }
448
+ }
449
+
408
450
func TestFailureJobs (t * testing.T ) {
409
451
t .Parallel ()
410
452
pluginsJSON , err := json .Marshal ([]map [string ]any {
0 commit comments