Skip to content

Commit

Permalink
Add setTLSDefaults function
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Raisul Islam Evan <[email protected]>
  • Loading branch information
Evanraisul committed Nov 7, 2024
1 parent a8e4cea commit 7c47e44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apis/kubedb/v1/memcached_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,12 @@ func (m *Memcached) ReplicasAreReady(lister pslister.PetSetLister) (bool, string
expectedItems := 1
return checkReplicas(lister.PetSets(m.Namespace), labels.SelectorFromSet(m.OffshootLabels()), expectedItems)
}

func (m *Memcached) SetTLSDefaults() {
if m.Spec.TLS == nil || m.Spec.TLS.IssuerRef == nil {
return
}
m.Spec.TLS.Certificates = kmapi.SetMissingSecretNameForCertificate(m.Spec.TLS.Certificates, string(MemcachedServerCert), m.CertificateName(MemcachedServerCert))
m.Spec.TLS.Certificates = kmapi.SetMissingSecretNameForCertificate(m.Spec.TLS.Certificates, string(MemcachedClientCert), m.CertificateName(MemcachedClientCert))
m.Spec.TLS.Certificates = kmapi.SetMissingSecretNameForCertificate(m.Spec.TLS.Certificates, string(MemcachedMetricsExporterCert), m.CertificateName(MemcachedMetricsExporterCert))
}

0 comments on commit 7c47e44

Please sign in to comment.