Remove unuseful method
@@ -542,93 +542,6 @@ func (r *ReconcilePerconaXtraDBCluster) createSSLManualy(cr *api.PerconaXtraDBCl
return nil
}
-func (r *ReconcilePerconaXtraDBCluster) reconsileSSL2(cr *api.PerconaXtraDBCluster, namespace string) error {
- if cr.Spec.PXC.AllowUnsafeConfig {
- return nil
- }
- secretObj := corev1.Secret{}
- err := r.client.Get(context.TODO(),
- types.NamespacedName{
- Namespace: namespace,
- Name: cr.Spec.PXC.SSLSecretName,
- },
- &secretObj,
- )
- if err == nil {
- return nil
- } else if !errors.IsNotFound(err) {
- return fmt.Errorf("get secret: %v", err)
- }
-
- issuerKind := "Issuer"
- issuerName := cr.Name + "-pxc-ca"
-
- err = r.client.Create(context.TODO(), &cm.Issuer{
- ObjectMeta: metav1.ObjectMeta{
- Name: issuerName,
- Namespace: namespace,
- },
- Spec: cm.IssuerSpec{
- IssuerConfig: cm.IssuerConfig{
- SelfSigned: &cm.SelfSignedIssuer{},
- },
- },
- })
- if err != nil && !errors.IsAlreadyExists(err) {
- return fmt.Errorf("create issuer: %v", err)
- }
-
- err = r.client.Create(context.TODO(), &cm.Certificate{
- ObjectMeta: metav1.ObjectMeta{
- Name: cr.Name + "-ssl",
- Namespace: namespace,
- },
- Spec: cm.CertificateSpec{
- SecretName: cr.Spec.PXC.SSLSecretName,
- CommonName: cr.Name + "-proxysql",
- DNSNames: []string{
- "*." + cr.Name + "-proxysql",
- },
- IsCA: true,
- IssuerRef: cm.ObjectReference{
- Name: issuerName,
- Kind: issuerKind,
- },
- },
- })
- if err != nil && !errors.IsAlreadyExists(err) {
- return fmt.Errorf("create certificate: %v", err)
- }
-
- if cr.Spec.PXC.SSLSecretName == cr.Spec.PXC.SSLInternalSecretName {
- return nil
- }
-
- err = r.client.Create(context.TODO(), &cm.Certificate{
- ObjectMeta: metav1.ObjectMeta{
- Name: cr.Name + "-ssl-internal",
- Namespace: namespace,
- },
- Spec: cm.CertificateSpec{
- SecretName: cr.Spec.PXC.SSLInternalSecretName,
- CommonName: cr.Name + "-pxc",
- DNSNames: []string{
- "*." + cr.Name + "-pxc",
- },
- IsCA: true,
- IssuerRef: cm.ObjectReference{
- Name: issuerName,
- Kind: issuerKind,
- },
- },
- })
- if err != nil && !errors.IsAlreadyExists(err) {
- return fmt.Errorf("create internal certificate: %v", err)
- }
-
- return nil
-}
-
func (r *ReconcilePerconaXtraDBCluster) reconcilePDB(spec *api.PodDisruptionBudgetSpec, sfs api.StatefulApp, namespace string, owner runtime.Object) error {
if spec == nil {
return nil
