Add owner references
@@ -50,6 +50,7 @@ func (r *ReconcilePerconaXtraDBCluster) createSSLByCertManager(cr *api.PerconaXt
ObjectMeta: metav1.ObjectMeta{
Name: issuerName,
Namespace: cr.Namespace,
+ OwnerReferences: cr.OwnerReferences,
},
Spec: cm.IssuerSpec{
IssuerConfig: cm.IssuerConfig{
@@ -65,6 +66,7 @@ func (r *ReconcilePerconaXtraDBCluster) createSSLByCertManager(cr *api.PerconaXt
ObjectMeta: metav1.ObjectMeta{
Name: cr.Name + "-ssl",
Namespace: cr.Namespace,
+ OwnerReferences: cr.OwnerReferences,
},
Spec: cm.CertificateSpec{
SecretName: cr.Spec.PXC.SSLSecretName,
@@ -93,6 +95,7 @@ func (r *ReconcilePerconaXtraDBCluster) createSSLByCertManager(cr *api.PerconaXt
ObjectMeta: metav1.ObjectMeta{
Name: cr.Name + "-ssl-internal",
Namespace: cr.Namespace,
+ OwnerReferences: cr.OwnerReferences,
},
Spec: cm.CertificateSpec{
SecretName: cr.Spec.PXC.SSLInternalSecretName,
@@ -133,6 +136,7 @@ func (r *ReconcilePerconaXtraDBCluster) createSSLManualy(cr *api.PerconaXtraDBCl
ObjectMeta: metav1.ObjectMeta{
Name: cr.Spec.PXC.SSLSecretName,
Namespace: cr.Namespace,
+ OwnerReferences: cr.OwnerReferences,
},
Data: data,
Type: corev1.SecretTypeTLS,
@@ -156,6 +160,7 @@ func (r *ReconcilePerconaXtraDBCluster) createSSLManualy(cr *api.PerconaXtraDBCl
ObjectMeta: metav1.ObjectMeta{
Name: cr.Spec.PXC.SSLInternalSecretName,
Namespace: cr.Namespace,
+ OwnerReferences: cr.OwnerReferences,
},
Data: data,
Type: corev1.SecretTypeTLS,
