@@ -444,10 +444,11 @@ func (r *PDBReconciler) callAPI(ctx context.Context, req ctrl.Request, pdb *dbap
444
444
}
445
445
446
446
caCert := secret .Data [pdb .Spec .PDBTlsCat .Secret .Key ]
447
-
447
+ /*
448
448
r.Recorder.Eventf(pdb, corev1.EventTypeWarning, "ORDSINFO", string(rsaKeyPEM))
449
449
r.Recorder.Eventf(pdb, corev1.EventTypeWarning, "ORDSINFO", string(rsaCertPEM))
450
450
r.Recorder.Eventf(pdb, corev1.EventTypeWarning, "ORDSINFO", string(caCert))
451
+ */
451
452
452
453
certificate , err := tls .X509KeyPair ([]byte (rsaCertPEM ), []byte (rsaKeyPEM ))
453
454
if err != nil {
@@ -501,7 +502,6 @@ func (r *PDBReconciler) callAPI(ctx context.Context, req ctrl.Request, pdb *dbap
501
502
if action == "GET" {
502
503
httpreq , err = http .NewRequest (action , url , nil )
503
504
} else {
504
- fmt .Println ("payload:" , payload )
505
505
jsonValue , _ := json .Marshal (payload )
506
506
httpreq , err = http .NewRequest (action , url , bytes .NewBuffer (jsonValue ))
507
507
}
@@ -641,7 +641,7 @@ func (r *PDBReconciler) createPDB(ctx context.Context, req ctrl.Request, pdb *db
641
641
642
642
r .Recorder .Eventf (pdb , corev1 .EventTypeNormal , "Created" , "PDB '%s' created successfully" , pdb .Spec .PDBName )
643
643
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
645
645
log .Info ("Created PDB Resource" , "PDB Name" , pdb .Spec .PDBName )
646
646
r .getPDBState (ctx , req , pdb )
647
647
return nil
@@ -695,7 +695,7 @@ func (r *PDBReconciler) clonePDB(ctx context.Context, req ctrl.Request, pdb *dba
695
695
696
696
r .Recorder .Eventf (pdb , corev1 .EventTypeNormal , "Created" , "PDB '%s' cloned successfully" , pdb .Spec .PDBName )
697
697
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
699
699
log .Info ("Cloned PDB successfully" , "Source PDB Name" , pdb .Spec .SrcPDBName , "Clone PDB Name" , pdb .Spec .PDBName )
700
700
r .getPDBState (ctx , req , pdb )
701
701
return nil
@@ -763,7 +763,7 @@ func (r *PDBReconciler) plugPDB(ctx context.Context, req ctrl.Request, pdb *dbap
763
763
764
764
r .Recorder .Eventf (pdb , corev1 .EventTypeNormal , "Created" , "PDB '%s' plugged successfully" , pdb .Spec .PDBName )
765
765
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
767
767
log .Info ("Successfully plugged PDB" , "PDB Name" , pdb .Spec .PDBName )
768
768
r .getPDBState (ctx , req , pdb )
769
769
return nil
@@ -883,7 +883,7 @@ func (r *PDBReconciler) modifyPDB(ctx context.Context, req ctrl.Request, pdb *db
883
883
}
884
884
885
885
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
887
887
888
888
log .Info ("Successfully modified PDB state" , "PDB Name" , pdb .Spec .PDBName )
889
889
r .getPDBState (ctx , req , pdb )
@@ -970,7 +970,7 @@ func (r *PDBReconciler) mapPDB(ctx context.Context, req ctrl.Request, pdb *dbapi
970
970
971
971
pdb .Status .OpenMode = objmap ["open_mode" ].(string )
972
972
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
974
974
975
975
log .Info ("Successfully mapped PDB to Kubernetes resource" , "PDB Name" , pdb .Spec .PDBName )
976
976
return nil
0 commit comments