File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ func (c *caCert) Name() string {
3333}
3434
3535func (c * caCert ) Namespace () string {
36- if c .cr .CompareVersion ("1.22.0" ) >= 0 && c .cr .Spec .TLS .IssuerConf .Kind == cm .ClusterIssuerKind {
36+ if c .cr .CompareVersion ("1.22.0" ) >= 0 && c .cr .Spec .TLS != nil && c . cr . Spec . TLS .IssuerConf .Kind == cm .ClusterIssuerKind {
3737 return certManagerNamespace ()
3838 }
3939
@@ -53,7 +53,7 @@ func (c *caCert) Object() *cm.Certificate {
5353 }
5454
5555 issuerKind := cm .IssuerKind
56- if cr .CompareVersion ("1.22.0" ) >= 0 {
56+ if cr .CompareVersion ("1.22.0" ) >= 0 && cr . Spec . TLS != nil {
5757 issuerKind = cr .Spec .TLS .IssuerConf .Kind
5858 }
5959 return & cm.Certificate {
Original file line number Diff line number Diff line change @@ -136,8 +136,6 @@ func TestCreateCertificate(t *testing.T) {
136136}
137137
138138func TestWaitForCerts (t * testing.T ) {
139- ctx := context .Background ()
140-
141139 cr := & api.PerconaServerMongoDB {
142140 ObjectMeta : metav1.ObjectMeta {
143141 Name : "test-cluster" ,
@@ -256,7 +254,7 @@ func TestWaitForCerts(t *testing.T) {
256254 dryRun : false ,
257255 }
258256
259- err := controller .WaitForCerts (ctx , cr , CertificateCA (cr ))
257+ err := controller .WaitForCerts (t . Context () , cr , CertificateCA (cr ))
260258 assert .NoError (t , err )
261259 })
262260 }
You can’t perform that action at this time.
0 commit comments