Skip to content

Commit f74283c

Browse files
committed
Merge branch 'mmalvezz' into 'master'
fix 34510825 + check of cert/key/ca input param See merge request rac-docker-dev/oracle-database-operator!228
2 parents d1f91bf + fe853c3 commit f74283c

File tree

6 files changed

+2087
-11
lines changed

6 files changed

+2087
-11
lines changed

apis/database/v1alpha1/cdb_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ type CDBSpec struct {
5252
// Name of the CDB Service
5353
ServiceName string `json:"serviceName,omitempty"`
5454

55-
TestVariable string `json:"TestVariable,omitempty"`
5655

5756
// Password for the CDB System Administrator
5857
SysAdminPwd CDBSysAdminPassword `json:"sysAdminPwd,omitempty"`

apis/database/v1alpha1/cdb_webhook.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,16 @@ func (r *CDB) ValidateCreate() error {
9292
allErrs = append(allErrs,
9393
field.Required(field.NewPath("spec").Child("serviceName"), "Please specify CDB Service name"))
9494
}
95-
96-
if r.Spec.TestVariable == "" {
97-
allErrs = append(allErrs,
98-
field.Required(field.NewPath("spec").Child("TestVariable"), "Please specify CDB testvarable"))
99-
}
95+
96+
if reflect.ValueOf(r.Spec.CDBTlsKey).IsZero() {
97+
allErrs = append(allErrs,
98+
field.Required(field.NewPath("spec").Child("cdbTlsKey"), "Please specify CDB Tls key(secret)"))
99+
}
100+
101+
if reflect.ValueOf(r.Spec.CDBTlsCrt).IsZero() {
102+
allErrs = append(allErrs,
103+
field.Required(field.NewPath("spec").Child("cdbTlsCrt"), "Please specify CDB Tls Certificate(secret)"))
104+
}
100105

101106
if r.Spec.SCANName == "" {
102107
allErrs = append(allErrs,

apis/database/v1alpha1/pdb_webhook.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,21 @@ func (r *PDB) validateAction(allErrs *field.ErrorList) {
147147

148148
pdblog.Info("Valdiating PDB Resource Action : " + action)
149149

150+
if reflect.ValueOf(r.Spec.PDBTlsKey).IsZero() {
151+
*allErrs = append(*allErrs,
152+
field.Required(field.NewPath("spec").Child("pdbTlsKey"), "Please specify PDB Tls Key(secret)"))
153+
}
154+
155+
if reflect.ValueOf(r.Spec.PDBTlsCrt).IsZero() {
156+
*allErrs = append(*allErrs,
157+
field.Required(field.NewPath("spec").Child("pdbTlsCrt"), "Please specify PDB Tls Certificate(secret)"))
158+
}
159+
160+
if reflect.ValueOf(r.Spec.PDBTlsCat).IsZero() {
161+
*allErrs = append(*allErrs,
162+
field.Required(field.NewPath("spec").Child("pdbTlsCat"), "Please specify PDB Tls Certificate Authority(secret)"))
163+
}
164+
150165
switch action {
151166
case "CREATE":
152167
if reflect.ValueOf(r.Spec.AdminName).IsZero() {

controllers/database/cdb_controller.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func (r *CDBReconciler) validateORDSPods(ctx context.Context, req ctrl.Request,
286286
if strings.Contains(out, "HTTP/1.1 200 OK") || strings.Contains(strings.ToUpper(err.Error()), "HTTP/1.1 200 OK") ||
287287
strings.Contains(out, "HTTP/2") || strings.Contains(strings.ToUpper(err.Error()), " HTTP/2") {
288288
readyPods++
289-
} else if strings.Contains(out, "HTTP/1.1 404 Not Found") || strings.Contains(strings.ToUpper(err.Error()), "HTTP/1.1 404 NOT FOUND") {
289+
} else if strings.Contains(out, "HTTP/1.1 404 Not Found") || strings.Contains(strings.ToUpper(err.Error()), "HTTP/1.1 404 NOT FOUND") || strings.Contains(strings.ToUpper(err.Error()), "HTTP/2 404") || strings.Contains(strings.ToUpper(err.Error()), "Failed to connect to localhost") {
290290
// Check if DB connection parameters are correct
291291
getORDSInstallStatus := " grep -q 'Failed to' /tmp/ords_install.log; echo $?;"
292292
out, _ := dbcommons.ExecCommand(r, r.Config, pod.Name, pod.Namespace, "", ctx, req, false, "bash", "-c", getORDSInstallStatus)
@@ -449,10 +449,6 @@ func (r *CDBReconciler) createPodSpec(cdb *dbapi.CDB) corev1.PodSpec {
449449
Name: "ORACLE_HOST",
450450
Value: cdb.Spec.DBServer,
451451
},
452-
{
453-
Name: "TESTVAR",
454-
Value: cdb.Spec.TestVariable,
455-
},
456452
{
457453
Name: "TLSCRT",
458454
Value: cdb.Spec.CDBTlsCrt.Secret.Key,

0 commit comments

Comments
 (0)