@@ -1495,20 +1495,25 @@ func (r *SingleInstanceDatabaseReconciler) createOrReplaceSVC(ctx context.Contex
14951495 extSvc = svc
14961496 }
14971497
1498- pdbName := strings . ToUpper ( m . Spec . Pdbname )
1499- sid := m . Spec . Sid
1498+ var sid , pdbName string
1499+ var getSidPdbEditionErr error
15001500 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
15061506 }
1507+ r .Log .Info ("Prebuilt database: %s has SID : %s, PDB : %s, EDITION: %s" , m .Name , sid , pdbName , edition )
15071508 m .Status .Edition = cases .Title (language .English ).String (edition )
15081509 }
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+ }
15121517 if m .Spec .LoadBalancer {
15131518 m .Status .ClusterConnectString = extSvc .Name + "." + extSvc .Namespace + ":" + fmt .Sprint (extSvc .Spec .Ports [1 ].Port ) + "/" + strings .ToUpper (sid )
15141519 if len (extSvc .Status .LoadBalancer .Ingress ) > 0 {
0 commit comments