@@ -685,29 +685,23 @@ def test_adding_a_secret_mount():
685685 path: /usr/share/filebeat/config/certs
686686"""
687687 r = helm_template (config )
688- assert (
689- {
690- "mountPath" : "/usr/share/filebeat/config/certs" ,
691- "name" : "elastic-certificates" ,
692- }
693- in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
694- "volumeMounts"
695- ]
696- )
688+ assert {
689+ "mountPath" : "/usr/share/filebeat/config/certs" ,
690+ "name" : "elastic-certificates" ,
691+ } in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
692+ "volumeMounts"
693+ ]
697694 assert {
698695 "name" : "elastic-certificates" ,
699696 "secret" : {"secretName" : "elastic-certificates-name" },
700697 } in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["volumes" ]
701698
702- assert (
703- {
704- "mountPath" : "/usr/share/filebeat/config/certs" ,
705- "name" : "elastic-certificates" ,
706- }
707- not in r ["deployment" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
708- "volumeMounts"
709- ]
710- )
699+ assert {
700+ "mountPath" : "/usr/share/filebeat/config/certs" ,
701+ "name" : "elastic-certificates" ,
702+ } not in r ["deployment" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
703+ "volumeMounts"
704+ ]
711705 assert {
712706 "name" : "elastic-certificates" ,
713707 "secret" : {"secretName" : "elastic-certificates-name" },
@@ -722,29 +716,23 @@ def test_adding_a_secret_mount():
722716 path: /usr/share/filebeat/config/certs
723717"""
724718 r = helm_template (config )
725- assert (
726- {
727- "mountPath" : "/usr/share/filebeat/config/certs" ,
728- "name" : "elastic-certificates" ,
729- }
730- in r ["deployment" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
731- "volumeMounts"
732- ]
733- )
719+ assert {
720+ "mountPath" : "/usr/share/filebeat/config/certs" ,
721+ "name" : "elastic-certificates" ,
722+ } in r ["deployment" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
723+ "volumeMounts"
724+ ]
734725 assert {
735726 "name" : "elastic-certificates" ,
736727 "secret" : {"secretName" : "elastic-certificates-name" },
737728 } in r ["deployment" ][name ]["spec" ]["template" ]["spec" ]["volumes" ]
738729
739- assert (
740- {
741- "mountPath" : "/usr/share/filebeat/config/certs" ,
742- "name" : "elastic-certificates" ,
743- }
744- not in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
745- "volumeMounts"
746- ]
747- )
730+ assert {
731+ "mountPath" : "/usr/share/filebeat/config/certs" ,
732+ "name" : "elastic-certificates" ,
733+ } not in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
734+ "volumeMounts"
735+ ]
748736 assert {
749737 "name" : "elastic-certificates" ,
750738 "secret" : {"secretName" : "elastic-certificates-name" },
@@ -761,15 +749,12 @@ def test_adding_a_deprecated_secret_mount():
761749 path: /usr/share/filebeat/config/certs
762750"""
763751 r = helm_template (config )
764- assert (
765- {
766- "mountPath" : "/usr/share/filebeat/config/certs" ,
767- "name" : "elastic-certificates" ,
768- }
769- in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
770- "volumeMounts"
771- ]
772- )
752+ assert {
753+ "mountPath" : "/usr/share/filebeat/config/certs" ,
754+ "name" : "elastic-certificates" ,
755+ } in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
756+ "volumeMounts"
757+ ]
773758 assert {
774759 "name" : "elastic-certificates" ,
775760 "secret" : {"secretName" : "elastic-certificates-name" },
@@ -810,12 +795,13 @@ def test_adding_a_extra_volume_with_volume_mount():
810795 assert {"name" : "extras" , "emptyDir" : {}} not in r ["deployment" ][name ]["spec" ][
811796 "template"
812797 ]["spec" ]["volumes" ]
813- assert (
814- {"name" : "extras" , "mountPath" : "/usr/share/extras" , "readOnly" : True ,}
815- not in r ["deployment" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
816- "volumeMounts"
817- ]
818- )
798+ assert {
799+ "name" : "extras" ,
800+ "mountPath" : "/usr/share/extras" ,
801+ "readOnly" : True ,
802+ } not in r ["deployment" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
803+ "volumeMounts"
804+ ]
819805
820806 config = """
821807deployment:
@@ -838,12 +824,13 @@ def test_adding_a_extra_volume_with_volume_mount():
838824 assert {"name" : "extras" , "emptyDir" : {}} not in r ["daemonset" ][name ]["spec" ][
839825 "template"
840826 ]["spec" ]["volumes" ]
841- assert (
842- {"name" : "extras" , "mountPath" : "/usr/share/extras" , "readOnly" : True ,}
843- not in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
844- "volumeMounts"
845- ]
846- )
827+ assert {
828+ "name" : "extras" ,
829+ "mountPath" : "/usr/share/extras" ,
830+ "readOnly" : True ,
831+ } not in r ["daemonset" ][name ]["spec" ]["template" ]["spec" ]["containers" ][0 ][
832+ "volumeMounts"
833+ ]
847834
848835
849836def test_adding_a_deprecated_extra_volume_with_volume_mount ():
0 commit comments