@@ -768,6 +768,82 @@ var _ = Describe("Operator smoke test", func() {
768768 ExecuteSimpleTableE2ETestWithSDK (databaseSample .Name , testobjects .YdbNamespace , databasePath )
769769 })
770770
771+ It ("Check init job has additional volumes" , func () {
772+ By ("create storage tls secret..." )
773+ storageCert := testobjects .StorageCertificate ()
774+ Expect (k8sClient .Create (ctx , storageCert )).Should (Succeed ())
775+
776+ By ("create storage..." )
777+ storage := testobjects .DefaultStorage (filepath .Join (".." , "data" , "storage-mirror-3-dc-config.yaml" ))
778+
779+ secretName := testobjects .StorageCertificateSecretName
780+ secretPath := fmt .Sprintf ("%s/%s" , resources .wellKnownDirForAdditionalSecrets , secretName )
781+
782+ storage .Spec .Secrets = []* corev1.LocalObjectReference {
783+ {
784+ Name : secretName ,
785+ },
786+ }
787+
788+ storage .Spec .InitContainers = []corev1.Container {
789+ {
790+ Name : "init-container" ,
791+ Image : storage .Spec .Image .Name ,
792+ Command : []string {"bash" , "-xc" },
793+ Args : []string {fmt .Sprintf ("ls -la %s" , secretPath )},
794+ VolumeMounts : []corev1.VolumeMount {
795+ {
796+ Name : secretName ,
797+ MountPath : secretPath ,
798+ ReadOnly : true ,
799+ },
800+ },
801+ },
802+ }
803+
804+ Expect (k8sClient .Create (ctx , storage )).Should (Succeed ())
805+ defer DeleteStorageSafely (ctx , k8sClient , storage )
806+
807+ By ("waiting until Storage is ready ..." )
808+ WaitUntilStorageReady (ctx , k8sClient , storage .Name , testobjects .YdbNamespace )
809+ })
810+
811+ It ("Check init job has additional volumes with GRPCS enabled" , func () {
812+ By ("create storage tls secret..." )
813+ storageCert := testobjects .StorageCertificate ()
814+ Expect (k8sClient .Create (ctx , storageCert )).Should (Succeed ())
815+
816+ By ("create storage..." )
817+ storage := testobjects .DefaultStorage (filepath .Join (".." , "data" , "storage-mirror-3-dc-config-tls.yaml" ))
818+
819+ secretName := testobjects .StorageCertificateSecretName
820+ secretPath := fmt .Sprintf ("%s/%s" , resources .wellKnownDirForAdditionalSecrets , secretName )
821+
822+ storage .Spec .Service .GRPC .TLSConfiguration = testobjects .TLSConfiguration (secretName )
823+
824+ storage .Spec .InitContainers = []corev1.Container {
825+ {
826+ Name : "init-container" ,
827+ Image : storage .Spec .Image .Name ,
828+ Command : []string {"bash" , "-xc" },
829+ Args : []string {fmt .Sprintf ("ls -la %s" , secretPath )},
830+ VolumeMounts : []corev1.VolumeMount {
831+ {
832+ Name : resources .grpcTLSVolumeName ,
833+ MountPath : secretPath ,
834+ ReadOnly : true ,
835+ },
836+ },
837+ },
838+ }
839+
840+ Expect (k8sClient .Create (ctx , storage )).Should (Succeed ())
841+ defer DeleteStorageSafely (ctx , k8sClient , storage )
842+
843+ By ("waiting until Storage is ready ..." )
844+ WaitUntilStorageReady (ctx , k8sClient , storage .Name , testobjects .YdbNamespace )
845+ })
846+
771847 AfterEach (func () {
772848 UninstallOperatorWithHelm (testobjects .YdbNamespace )
773849 Expect (k8sClient .Delete (ctx , & namespace )).Should (Succeed ())
0 commit comments