@@ -1495,20 +1495,25 @@ func (r *SingleInstanceDatabaseReconciler) createOrReplaceSVC(ctx context.Contex
1495
1495
extSvc = svc
1496
1496
}
1497
1497
1498
- pdbName := strings . ToUpper ( m . Spec . Pdbname )
1499
- sid := m . Spec . Sid
1498
+ var sid , pdbName string
1499
+ var getSidPdbEditionErr error
1500
1500
if m .Spec .Image .PrebuiltDB {
1501
- r .Log .Info ("Initiliazing free database sid, pdb, edition" )
1502
- edition := ""
1503
- _ , _ , edition , err : = dbcommons .GetSidPdbEdition (r , r .Config , ctx , ctrl.Request {NamespacedName : types.NamespacedName {Namespace : m .Namespace , Name : m .Name }})
1504
- if err != nil {
1505
- return requeueY , err
1501
+ r .Log .Info ("Initiliazing database sid, pdb, edition for prebuilt database " )
1502
+ var edition string
1503
+ sid , pdbName , edition , getSidPdbEditionErr = dbcommons .GetSidPdbEdition (r , r .Config , ctx , ctrl.Request {NamespacedName : types.NamespacedName {Namespace : m .Namespace , Name : m .Name }})
1504
+ if getSidPdbEditionErr != nil {
1505
+ return requeueY , getSidPdbEditionErr
1506
1506
}
1507
+ r .Log .Info ("Prebuilt database: %s has SID : %s, PDB : %s, EDITION: %s" , m .Name , sid , pdbName , edition )
1507
1508
m .Status .Edition = cases .Title (language .English ).String (edition )
1508
1509
}
1509
-
1510
- r .Log .Info ("Setting connect string statues" )
1511
-
1510
+ r .Log .Info ("Prebuilt database: %s has SID : %s, PDB : %s, EDITION: %s" , m .Name , sid , pdbName )
1511
+ if sid == "" {
1512
+ sid = strings .ToUpper (m .Spec .Sid )
1513
+ }
1514
+ if pdbName == "" {
1515
+ pdbName = strings .ToUpper (m .Spec .Pdbname )
1516
+ }
1512
1517
if m .Spec .LoadBalancer {
1513
1518
m .Status .ClusterConnectString = extSvc .Name + "." + extSvc .Namespace + ":" + fmt .Sprint (extSvc .Spec .Ports [1 ].Port ) + "/" + strings .ToUpper (sid )
1514
1519
if len (extSvc .Status .LoadBalancer .Ingress ) > 0 {
0 commit comments