@@ -493,11 +493,25 @@ private void recreateConfigMapandRestart(String oldSecret, String newSecret) thr
493493 // stop all running wls pods
494494 int clusterReplicas =
495495 TestUtils .getClusterReplicas (DOMAINUID , domain .getClusterName (), domain .getDomainNs ());
496- String patchStr = "'{\" spec\" :{\" serverStartPolicy\" :\" NEVER\" }}'" ;
496+ String patchStr = "'{\" spec\" :{\" serverStartPolicy\" :\" NEVER\" }}'" ;
497497 TestUtils .kubectlpatch (DOMAINUID , domain .getDomainNs (), patchStr );
498498 Thread .sleep (60000 );
499499 domain .verifyServerPodsDeleted (clusterReplicas );
500+ TestUtils .exec ("kubectl get all --all-namespaces" , true );
500501
502+ // recreate the configmap with new overrride files
503+ String cmd =
504+ "kubectl create configmap "
505+ + DOMAINUID
506+ + "-sitconfigcm --from-file="
507+ + configOverrideDir
508+ + " -o yaml --dry-run | kubectl replace -f -" ;
509+ TestUtils .exec (cmd , true );
510+
511+ cmd = "kubectl describe cm -n " + domain .getDomainNs () + " customsitconfigdomain-sitconfigcm" ;
512+ TestUtils .exec (cmd , true );
513+
514+ // now modify the domain.yaml if the secret name is changed
501515 if (!oldSecret .equals (newSecret )) {
502516 String content =
503517 new String (Files .readAllBytes (Paths .get (domainYaml )), StandardCharsets .UTF_8 );
@@ -506,38 +520,25 @@ private void recreateConfigMapandRestart(String oldSecret, String newSecret) thr
506520 Paths .get (domainYaml ),
507521 content .getBytes (StandardCharsets .UTF_8 ),
508522 StandardOpenOption .TRUNCATE_EXISTING );
523+ logger .log (Level .INFO , content );
509524
510525 // delete the old secret and add new secret to domain.yaml
511526 TestUtils .exec ("kubectl delete secret " + domain .getDomainUid () + "-" + oldSecret , true );
512- String cmd =
527+ cmd =
513528 "kubectl -n "
514529 + domain .getDomainNs ()
515530 + " create secret generic "
516531 + domain .getDomainUid ()
517532 + "-"
518533 + newSecret
519534 + " --from-literal=hostname="
520- + TestUtils . getHostName ()
535+ + fqdn
521536 + " --from-literal=dbusername=root"
522537 + " --from-literal=dbpassword=root123" ;
523538 TestUtils .exec (cmd , true );
539+ // apply the new domain.yaml
540+ TestUtils .exec ("kubectl apply -f " + domainYaml , true );
524541 }
525-
526- // recreate the configmap with new overrride files
527- String cmd =
528- "kubectl create configmap "
529- + DOMAINUID
530- + "-sitconfigcm --from-file="
531- + configOverrideDir
532- + " -o yaml --dry-run | kubectl replace -f -" ;
533- TestUtils .exec (cmd , true );
534-
535- cmd = "kubectl describe cm -n " + domain .getDomainNs () + " customsitconfigdomain-sitconfigcm" ;
536- TestUtils .exec (cmd , true );
537-
538- // apply the new domain.yaml
539- TestUtils .exec ("kubectl apply -f " + domainYaml , true );
540-
541542 // start the pods so that introspector can run and replace files with new secret if changed and
542543 // with new config override files
543544 patchStr = "'{\" spec\" :{\" serverStartPolicy\" :\" IF_NEEDED\" }}'" ;
0 commit comments