@@ -518,81 +518,85 @@ func TestInject(t *testing.T) {
518518 inputFile string
519519 wantFile string
520520 }{
521- {
522- inputFile : "TestWebhookInject.yaml" ,
523- wantFile : "TestWebhookInject.patch" ,
524- },
525- {
526- inputFile : "TestWebhookInject_no_initContainers.yaml" ,
527- wantFile : "TestWebhookInject_no_initContainers.patch" ,
528- },
529- {
530- inputFile : "TestWebhookInject_no_containers.yaml" ,
531- wantFile : "TestWebhookInject_no_containers.patch" ,
532- },
533- {
534- inputFile : "TestWebhookInject_no_volumes.yaml" ,
535- wantFile : "TestWebhookInject_no_volumes.patch" ,
536- },
537- {
538- inputFile : "TestWebhookInject_no_imagePullSecrets.yaml" ,
539- wantFile : "TestWebhookInject_no_imagePullSecrets.patch" ,
540- },
541- {
542- inputFile : "TestWebhookInject_no_volumes_imagePullSecrets.yaml" ,
543- wantFile : "TestWebhookInject_no_volumes_imagePullSecrets.patch" ,
544- },
545- {
546- inputFile : "TestWebhookInject_no_containers_volumes_imagePullSecrets.yaml" ,
547- wantFile : "TestWebhookInject_no_containers_volumes_imagePullSecrets.patch" ,
548- },
549- {
550- inputFile : "TestWebhookInject_no_containers_volumes.yaml" ,
551- wantFile : "TestWebhookInject_no_containers_volumes.patch" ,
552- },
553- {
554- inputFile : "TestWebhookInject_no_containers_imagePullSecrets.yaml" ,
555- wantFile : "TestWebhookInject_no_containers_imagePullSecrets.patch" ,
556- },
557- {
558- inputFile : "TestWebhookInject_no_initContainers_containers.yaml" ,
559- wantFile : "TestWebhookInject_no_initContainers_containers.patch" ,
560- },
561- {
562- inputFile : "TestWebhookInject_no_initContainers_volumes.yaml" ,
563- wantFile : "TestWebhookInject_no_initContainers_volumes.patch" ,
564- },
565- {
566- inputFile : "TestWebhookInject_no_initContainers_imagePullSecrets.yaml" ,
567- wantFile : "TestWebhookInject_no_initContainers_imagePullSecrets.patch" ,
568- },
569- {
570- inputFile : "TestWebhookInject_no_containers_volumes_imagePullSecrets.yaml" ,
571- wantFile : "TestWebhookInject_no_containers_volumes_imagePullSecrets.patch" ,
572- },
573- {
574- inputFile : "TestWebhookInject_no_initContainers_volumes_imagePullSecrets.yaml" ,
575- wantFile : "TestWebhookInject_no_initContainers_volumes_imagePullSecrets.patch" ,
576- },
577- {
578- inputFile : "TestWebhookInject_no_initContainers_containers_volumes.yaml" ,
579- wantFile : "TestWebhookInject_no_initContainers_containers_volumes.patch" ,
580- },
581- {
582- inputFile : "TestWebhookInject_no_initContainers_containers_imagePullSecrets.yaml" ,
583- wantFile : "TestWebhookInject_no_initContainers_containers_imagePullSecrets.patch" ,
584- },
585- {
586- inputFile : "TestWebhookInject_no_initContainers_containers_volumes_imagePullSecrets.yaml" ,
587- wantFile : "TestWebhookInject_no_initcontainers_containers_volumes_imagePullSecrets.patch" ,
588- },
589- {
590- inputFile : "TestWebhookInject_replace.yaml" ,
591- wantFile : "TestWebhookInject_replace.patch" ,
592- },
593- {
594- inputFile : "TestWebhookInject_replace_backwards_compat.yaml" ,
595- wantFile : "TestWebhookInject_replace_backwards_compat.patch" ,
521+ // {
522+ // inputFile: "TestWebhookInject.yaml",
523+ // wantFile: "TestWebhookInject.patch",
524+ // },
525+ // {
526+ // inputFile: "TestWebhookInject_no_initContainers.yaml",
527+ // wantFile: "TestWebhookInject_no_initContainers.patch",
528+ // },
529+ // {
530+ // inputFile: "TestWebhookInject_no_containers.yaml",
531+ // wantFile: "TestWebhookInject_no_containers.patch",
532+ // },
533+ // {
534+ // inputFile: "TestWebhookInject_no_volumes.yaml",
535+ // wantFile: "TestWebhookInject_no_volumes.patch",
536+ // },
537+ // {
538+ // inputFile: "TestWebhookInject_no_imagePullSecrets.yaml",
539+ // wantFile: "TestWebhookInject_no_imagePullSecrets.patch",
540+ // },
541+ // {
542+ // inputFile: "TestWebhookInject_no_volumes_imagePullSecrets.yaml",
543+ // wantFile: "TestWebhookInject_no_volumes_imagePullSecrets.patch",
544+ // },
545+ // {
546+ // inputFile: "TestWebhookInject_no_containers_volumes_imagePullSecrets.yaml",
547+ // wantFile: "TestWebhookInject_no_containers_volumes_imagePullSecrets.patch",
548+ // },
549+ // {
550+ // inputFile: "TestWebhookInject_no_containers_volumes.yaml",
551+ // wantFile: "TestWebhookInject_no_containers_volumes.patch",
552+ // },
553+ // {
554+ // inputFile: "TestWebhookInject_no_containers_imagePullSecrets.yaml",
555+ // wantFile: "TestWebhookInject_no_containers_imagePullSecrets.patch",
556+ // },
557+ // {
558+ // inputFile: "TestWebhookInject_no_initContainers_containers.yaml",
559+ // wantFile: "TestWebhookInject_no_initContainers_containers.patch",
560+ // },
561+ // {
562+ // inputFile: "TestWebhookInject_no_initContainers_volumes.yaml",
563+ // wantFile: "TestWebhookInject_no_initContainers_volumes.patch",
564+ // },
565+ // {
566+ // inputFile: "TestWebhookInject_no_initContainers_imagePullSecrets.yaml",
567+ // wantFile: "TestWebhookInject_no_initContainers_imagePullSecrets.patch",
568+ // },
569+ // {
570+ // inputFile: "TestWebhookInject_no_containers_volumes_imagePullSecrets.yaml",
571+ // wantFile: "TestWebhookInject_no_containers_volumes_imagePullSecrets.patch",
572+ // },
573+ // {
574+ // inputFile: "TestWebhookInject_no_initContainers_volumes_imagePullSecrets.yaml",
575+ // wantFile: "TestWebhookInject_no_initContainers_volumes_imagePullSecrets.patch",
576+ // },
577+ // {
578+ // inputFile: "TestWebhookInject_no_initContainers_containers_volumes.yaml",
579+ // wantFile: "TestWebhookInject_no_initContainers_containers_volumes.patch",
580+ // },
581+ // {
582+ // inputFile: "TestWebhookInject_no_initContainers_containers_imagePullSecrets.yaml",
583+ // wantFile: "TestWebhookInject_no_initContainers_containers_imagePullSecrets.patch",
584+ // },
585+ // {
586+ // inputFile: "TestWebhookInject_no_initContainers_containers_volumes_imagePullSecrets.yaml",
587+ // wantFile: "TestWebhookInject_no_initcontainers_containers_volumes_imagePullSecrets.patch",
588+ // },
589+ // {
590+ // inputFile: "TestWebhookInject_replace.yaml",
591+ // wantFile: "TestWebhookInject_replace.patch",
592+ // },
593+ // {
594+ // inputFile: "TestWebhookInject_replace_backwards_compat.yaml",
595+ // wantFile: "TestWebhookInject_replace_backwards_compat.patch",
596+ // },
597+ {
598+ inputFile : "TestWebhookInject_http_probe_rewrite.yaml" ,
599+ wantFile : "TestWebhookInject_http_probe_rewrite.patch" ,
596600 },
597601 }
598602
@@ -614,10 +618,13 @@ func TestInject(t *testing.T) {
614618 },
615619 })
616620 var prettyPatch bytes.Buffer
621+ fmt .Println ("jianfeih debug got " , string (got .Patch ))
617622 if err := json .Indent (& prettyPatch , got .Patch , "" , " " ); err != nil {
618623 t .Fatalf (err .Error ())
619624 }
625+ fmt .Println ("jianfeih debug got " , string (prettyPatch .String ()))
620626 util .CompareContent (prettyPatch .Bytes (), want , t )
627+
621628 })
622629 }
623630}
0 commit comments