@@ -444,10 +444,11 @@ func (r *PDBReconciler) callAPI(ctx context.Context, req ctrl.Request, pdb *dbap
444444 }
445445
446446 caCert := secret .Data [pdb .Spec .PDBTlsCat .Secret .Key ]
447-
447+ /*
448448 r.Recorder.Eventf(pdb, corev1.EventTypeWarning, "ORDSINFO", string(rsaKeyPEM))
449449 r.Recorder.Eventf(pdb, corev1.EventTypeWarning, "ORDSINFO", string(rsaCertPEM))
450450 r.Recorder.Eventf(pdb, corev1.EventTypeWarning, "ORDSINFO", string(caCert))
451+ */
451452
452453 certificate , err := tls .X509KeyPair ([]byte (rsaCertPEM ), []byte (rsaKeyPEM ))
453454 if err != nil {
@@ -501,7 +502,6 @@ func (r *PDBReconciler) callAPI(ctx context.Context, req ctrl.Request, pdb *dbap
501502 if action == "GET" {
502503 httpreq , err = http .NewRequest (action , url , nil )
503504 } else {
504- fmt .Println ("payload:" , payload )
505505 jsonValue , _ := json .Marshal (payload )
506506 httpreq , err = http .NewRequest (action , url , bytes .NewBuffer (jsonValue ))
507507 }
@@ -641,7 +641,7 @@ func (r *PDBReconciler) createPDB(ctx context.Context, req ctrl.Request, pdb *db
641641
642642 r .Recorder .Eventf (pdb , corev1 .EventTypeNormal , "Created" , "PDB '%s' created successfully" , pdb .Spec .PDBName )
643643
644- pdb .Status .ConnString = cdb .Spec .SCANName + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
644+ pdb .Status .ConnString = cdb .Spec .DBServer + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
645645 log .Info ("Created PDB Resource" , "PDB Name" , pdb .Spec .PDBName )
646646 r .getPDBState (ctx , req , pdb )
647647 return nil
@@ -695,7 +695,7 @@ func (r *PDBReconciler) clonePDB(ctx context.Context, req ctrl.Request, pdb *dba
695695
696696 r .Recorder .Eventf (pdb , corev1 .EventTypeNormal , "Created" , "PDB '%s' cloned successfully" , pdb .Spec .PDBName )
697697
698- pdb .Status .ConnString = cdb .Spec .SCANName + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
698+ pdb .Status .ConnString = cdb .Spec .DBServer + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
699699 log .Info ("Cloned PDB successfully" , "Source PDB Name" , pdb .Spec .SrcPDBName , "Clone PDB Name" , pdb .Spec .PDBName )
700700 r .getPDBState (ctx , req , pdb )
701701 return nil
@@ -763,7 +763,7 @@ func (r *PDBReconciler) plugPDB(ctx context.Context, req ctrl.Request, pdb *dbap
763763
764764 r .Recorder .Eventf (pdb , corev1 .EventTypeNormal , "Created" , "PDB '%s' plugged successfully" , pdb .Spec .PDBName )
765765
766- pdb .Status .ConnString = cdb .Spec .SCANName + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
766+ pdb .Status .ConnString = cdb .Spec .DBServer + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
767767 log .Info ("Successfully plugged PDB" , "PDB Name" , pdb .Spec .PDBName )
768768 r .getPDBState (ctx , req , pdb )
769769 return nil
@@ -883,7 +883,7 @@ func (r *PDBReconciler) modifyPDB(ctx context.Context, req ctrl.Request, pdb *db
883883 }
884884
885885 r .Recorder .Eventf (pdb , corev1 .EventTypeNormal , "Modified" , "PDB '%s' modified successfully" , pdb .Spec .PDBName )
886- pdb .Status .ConnString = cdb .Spec .SCANName + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
886+ pdb .Status .ConnString = cdb .Spec .DBServer + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
887887
888888 log .Info ("Successfully modified PDB state" , "PDB Name" , pdb .Spec .PDBName )
889889 r .getPDBState (ctx , req , pdb )
@@ -970,7 +970,7 @@ func (r *PDBReconciler) mapPDB(ctx context.Context, req ctrl.Request, pdb *dbapi
970970
971971 pdb .Status .OpenMode = objmap ["open_mode" ].(string )
972972 pdb .Status .TotalSize = fmt .Sprintf ("%.2f" , totSizeInGB ) + "G"
973- pdb .Status .ConnString = cdb .Spec .SCANName + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
973+ pdb .Status .ConnString = cdb .Spec .DBServer + ":" + strconv .Itoa (cdb .Spec .DBPort ) + "/" + pdb .Spec .PDBName
974974
975975 log .Info ("Successfully mapped PDB to Kubernetes resource" , "PDB Name" , pdb .Spec .PDBName )
976976 return nil
0 commit comments