@@ -790,18 +790,49 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() {
790
790
checkCoordinatorsTLSFlag (fdbCluster .GetCluster (), initialTLSSetting )
791
791
})
792
792
793
- // Currently disabled until a new release of the operator is out
794
- It ("should update the TLS setting and keep the cluster available" , func () {
795
- // Only change the TLS setting for the cluster and not for the sidecar otherwise we have to recreate
796
- // all Pods which takes a long time since we recreate the Pods one by one.
797
- Expect (
798
- fdbCluster .SetTLS (
799
- ! initialTLSSetting ,
800
- fdbCluster .GetCluster ().Spec .SidecarContainer .EnableTLS ,
801
- ),
802
- ).NotTo (HaveOccurred ())
803
- Expect (fdbCluster .HasTLSEnabled ()).To (Equal (! initialTLSSetting ))
804
- checkCoordinatorsTLSFlag (fdbCluster .GetCluster (), ! initialTLSSetting )
793
+ When ("the pod spec stays the same" , func () {
794
+ It ("should update the TLS setting and keep the cluster available" , func () {
795
+ // Only change the TLS setting for the cluster and not for the sidecar otherwise we have to recreate
796
+ // all Pods which takes a long time since we recreate the Pods one by one.
797
+ Expect (
798
+ fdbCluster .SetTLS (
799
+ ! initialTLSSetting ,
800
+ fdbCluster .GetCluster ().Spec .SidecarContainer .EnableTLS ,
801
+ ),
802
+ ).NotTo (HaveOccurred ())
803
+ Expect (fdbCluster .HasTLSEnabled ()).To (Equal (! initialTLSSetting ))
804
+ checkCoordinatorsTLSFlag (fdbCluster .GetCluster (), ! initialTLSSetting )
805
+ })
806
+ })
807
+
808
+ PWhen ("the pod spec is changed" , func () {
809
+ It ("should update the TLS setting and keep the cluster available" , func () {
810
+ spec := fdbCluster .GetCluster ().Spec .DeepCopy ()
811
+ spec .MainContainer .EnableTLS = ! initialTLSSetting
812
+
813
+ // Add a new env variable to ensure this will cause some additional replacements.
814
+ processSettings := spec .Processes [fdbv1beta2 .ProcessClassGeneral ]
815
+ for i , container := range processSettings .PodTemplate .Spec .Containers {
816
+ if container .Name != fdbv1beta2 .MainContainerName {
817
+ continue
818
+ }
819
+
820
+ container .Env = append (container .Env , corev1.EnvVar {
821
+ Name : "TESTING_TLS_CHANGE" ,
822
+ Value : "EMPTY" ,
823
+ })
824
+
825
+ processSettings .PodTemplate .Spec .Containers [i ] = container
826
+ break
827
+ }
828
+
829
+ spec .Processes [fdbv1beta2 .ProcessClassGeneral ] = processSettings
830
+
831
+ fdbCluster .UpdateClusterSpecWithSpec (spec )
832
+ Expect (fdbCluster .WaitForReconciliation ()).To (Succeed ())
833
+ Expect (fdbCluster .HasTLSEnabled ()).To (Equal (! initialTLSSetting ))
834
+ checkCoordinatorsTLSFlag (fdbCluster .GetCluster (), ! initialTLSSetting )
835
+ })
805
836
})
806
837
})
807
838
0 commit comments