Skip to content

Commit 1f99d32

Browse files
committed
Merge branch 'mmalvezz' into 'master'
bug 34677093 See merge request rac-docker-dev/oracle-database-operator!230
2 parents d8e9e84 + 0fc0c74 commit 1f99d32

File tree

11 files changed

+74
-2094
lines changed

11 files changed

+74
-2094
lines changed

apis/database/v1alpha1/cdb_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ type CDBSpec struct {
8080
WebServerUser WebServerUser `json:"webServerUser,omitempty"`
8181
// Password for the Web Server User
8282
WebServerPwd WebServerPassword `json:"webServerPwd,omitempty"`
83-
// SCAN Name
84-
SCANName string `json:"scanName,omitempty"`
8583
// Name of the DB server
8684
DBServer string `json:"dbServer,omitempty"`
8785
// DB server port
@@ -152,7 +150,6 @@ type CDBStatus struct {
152150
// +kubebuilder:printcolumn:JSONPath=".spec.cdbName",name="CDB Name",type="string",description="Name of the CDB"
153151
// +kubebuilder:printcolumn:JSONPath=".spec.dbServer",name="DB Server",type="string",description=" Name of the DB Server"
154152
// +kubebuilder:printcolumn:JSONPath=".spec.dbPort",name="DB Port",type="integer",description="DB server port"
155-
// +kubebuilder:printcolumn:JSONPath=".spec.scanName",name="SCAN Name",type="string",description="SCAN Name"
156153
// +kubebuilder:printcolumn:JSONPath=".spec.replicas",name="Replicas",type="integer",description="Replicas"
157154
// +kubebuilder:printcolumn:JSONPath=".status.phase",name="Status",type="string",description="Status of the CDB Resource"
158155
// +kubebuilder:printcolumn:JSONPath=".status.msg",name="Message",type="string",description="Error message, if any"

apis/database/v1alpha1/cdb_webhook.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ func (r *CDB) ValidateCreate() error {
103103
field.Required(field.NewPath("spec").Child("cdbTlsCrt"), "Please specify CDB Tls Certificate(secret)"))
104104
}
105105

106-
if r.Spec.SCANName == "" {
106+
/*if r.Spec.SCANName == "" {
107107
allErrs = append(allErrs,
108108
field.Required(field.NewPath("spec").Child("scanName"), "Please specify SCAN Name for CDB"))
109-
}
109+
}*/
110+
110111
if r.Spec.DBServer == "" {
111112
allErrs = append(allErrs,
112113
field.Required(field.NewPath("spec").Child("dbServer"), "Please specify Database Server Name or IP Address"))

config/crd/bases/database.oracle.com_cdbs.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ spec:
2929
jsonPath: .spec.dbPort
3030
name: DB Port
3131
type: integer
32-
- description: SCAN Name
33-
jsonPath: .spec.scanName
34-
name: SCAN Name
35-
type: string
3632
- description: Replicas
3733
jsonPath: .spec.replicas
3834
name: Replicas
@@ -183,9 +179,6 @@ spec:
183179
replicas:
184180
description: Number of ORDS Containers to create
185181
type: integer
186-
scanName:
187-
description: SCAN Name
188-
type: string
189182
serviceName:
190183
description: Name of the CDB Service
191184
type: string

config/samples/multitenant/cdb.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ metadata:
99
namespace: oracle-database-operator-system
1010
spec:
1111
cdbName: "devcdb"
12-
scanName: "devdb"
1312
dbServer: "172.17.0.4"
1413
dbPort: 1521
1514
replicas: 1
@@ -41,4 +40,4 @@ spec:
4140
webServerPwd:
4241
secret:
4342
secretName: "cdb1-secret"
44-
key: "webserver_pwd"
43+
key: "webserver_pwd"

controllers/DBserver

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This viminfo file was generated by Vim 7.4.
2+
# You may edit it if you're careful!
3+
4+
# Value of 'encoding' when this file was written
5+
*encoding=utf-8
6+
7+
8+
# hlsearch on (H) or off (h):
9+
~H
10+
# Command Line History (newest to oldest):
11+
:q!
12+
:q
13+
14+
# Search String History (newest to oldest):
15+
16+
# Expression History (newest to oldest):
17+
18+
# Input Line History (newest to oldest):
19+
20+
# Input Line History (newest to oldest):
21+
22+
# Registers:
23+
24+
# File marks:
25+
'0 1 0 ~/WORKDIR/Ords22_operator/oracle-database-operator/controllers/grep
26+
27+
# Jumplist (newest first):
28+
-' 1 0 ~/WORKDIR/Ords22_operator/oracle-database-operator/controllers/grep
29+
30+
# History of marks within files (newest to oldest):
31+
32+
> ~/WORKDIR/Ords22_operator/oracle-database-operator/controllers/grep
33+
" 1 0

controllers/database/pdb_controller.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)