Skip to content

Commit be5382d

Browse files
committed
move the major voyager/unqiue webport and INGRESSPERDOMAIN logic to class Domain
1 parent 45964b7 commit be5382d

File tree

7 files changed

+35
-7
lines changed

7 files changed

+35
-7
lines changed

integration-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ The tests accepts optional env var overrides:
211211
| PV_ROOT | The root directory on the kubernetes cluster used for persistent volumes. See "Directory Configuration and Structure" for defaults and a detailed description of test directories. |
212212
| QUICKTEST | When set to "true", limits testing to a subset of the tests. |
213213
| LB_TYPE | The default value is "TRAEFIK". Set to "VOYAGER" if you want to use it as LB. |
214-
| INGRESSPERDOMAIN | The defult value is true. If you want to test creating LB by kubectl yaml for multiple domains, set it to false. |
214+
| INGRESSPERDOMAIN | The defult value is true. If you want to test creating TRAEFIK LB by kubectl yaml for multiple domains, set it to false. |
215215
| WERCKER | Set to true if invoking from Wercker, set to false or "" if running stand-alone or from Jenkins. Default is "". |
216216
| JENKINS | Set to true if invoking from Jenkins, set to false or "" if running stand-alone or from Wercker. Default is "". |
217217
| K8S_NODEPORT_HOST | DNS name of a Kubernetes worker node. Default is the local host's hostname. |

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class Domain {
5757
private int loadBalancerWebPort = 30305;
5858
private String userProjectsDir = "";
5959
private String projectRoot = "";
60-
private boolean ingressPerDomain = false;
60+
private boolean ingressPerDomain = true;
6161

6262
private String createDomainScript = "";
6363
private String inputTemplateFile = "";
@@ -66,6 +66,12 @@ public class Domain {
6666
private static int maxIterations = BaseTest.getMaxIterationsPod(); // 50 * 5 = 250 seconds
6767
private static int waitTime = BaseTest.getWaitTimePod();
6868

69+
private boolean voyager;
70+
// LB_TYPE is an evn var. Set to "VOYAGER" to use it as loadBalancer
71+
private static String LB_TYPE;
72+
// set INGRESSPERDOMAIN to false to create LB's ingress by kubectl yaml file
73+
private static boolean INGRESSPERDOMAIN = true;
74+
6975
public Domain(String inputYaml) throws Exception {
7076
// read input domain yaml to test
7177
this(TestUtils.loadYaml(inputYaml));
@@ -858,10 +864,23 @@ private void createLoadBalancer() throws Exception {
858864
lbMap.put("namespace", domainNS);
859865
lbMap.put("host", domainUid + ".org");
860866
lbMap.put("serviceName", domainUid + "-cluster-" + domainMap.get("clusterName"));
861-
lbMap.put("loadBalancer", domainMap.getOrDefault("loadBalancer", loadBalancer));
862-
lbMap.put("ingressPerDomain", domainMap.getOrDefault("ingressPerDomain", ingressPerDomain));
863-
lbMap.put(
864-
"loadBalancerWebPort", domainMap.getOrDefault("loadBalancerWebPort", loadBalancerWebPort));
867+
if (voyager) {
868+
lbMap.put("loadBalancer", "VOYAGER");
869+
lbMap.put("loadBalancerWebPort", domainMap.get("voyagerWebPort"));
870+
} else {
871+
lbMap.put("loadBalancer", domainMap.getOrDefault("loadBalancer", loadBalancer));
872+
lbMap.put(
873+
"loadBalancerWebPort",
874+
domainMap.getOrDefault("loadBalancerWebPort", new Integer(loadBalancerWebPort)));
875+
}
876+
if (!INGRESSPERDOMAIN) {
877+
lbMap.put("ingressPerDomain", new Boolean("false"));
878+
logger.info("For this domain, INGRESSPERDOMAIN is set to false");
879+
} else {
880+
lbMap.put(
881+
"ingressPerDomain",
882+
domainMap.getOrDefault("ingressPerDomain", new Boolean(ingressPerDomain)));
883+
}
865884
lbMap.put("clusterName", domainMap.get("clusterName"));
866885

867886
loadBalancer = (String) lbMap.get("loadBalancer");
@@ -1025,7 +1044,11 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
10251044
domainMap = inputDomainMap;
10261045
this.userProjectsDir = BaseTest.getUserProjectsDir();
10271046
this.projectRoot = BaseTest.getProjectRoot();
1028-
1047+
this.voyager =
1048+
System.getenv("LB_TYPE") != null && System.getenv("LB_TYPE").equalsIgnoreCase("VOYAGER");
1049+
if (System.getenv("INGRESSPERDOMAIN") != null) {
1050+
INGRESSPERDOMAIN = new Boolean(System.getenv("INGRESSPERDOMAIN")).booleanValue();
1051+
}
10291052
domainMap.put("domainName", domainMap.get("domainUID"));
10301053

10311054
// read sample domain inputs

integration-tests/src/test/resources/domainadminonly.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ namespace: default
1919
serverStartPolicy: ADMIN_ONLY
2020
loadBalancer: TRAEFIK
2121
ingressPerDomain: true
22+
voyagerWebPort: 30309

integration-tests/src/test/resources/domainonpvwdt.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ createDomainFilesDir: wdt
2222
#loadBalancerDashboardPort: 30321
2323
loadBalancer: TRAEFIK
2424
ingressPerDomain: true
25+
voyagerWebPort: 30306

integration-tests/src/test/resources/domainonpvwlst.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ exposeAdminNodePort: true
1616
namespace: default
1717
loadBalancer: TRAEFIK
1818
ingressPerDomain: true
19+
voyagerWebPort: 30305
1920

integration-tests/src/test/resources/domainrecyclepolicy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ namespace: default
1919
weblogicDomainStorageReclaimPolicy: Recycle
2020
loadBalancer: TRAEFIK
2121
ingressPerDomain: true
22+
voyagerWebPort: 30311

integration-tests/src/test/resources/domainsampledefaults.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ domainUID: domainsampledefaults
77
configuredManagedServerCount: 4
88
loadBalancer: TRAEFIK
99
ingressPerDomain: true
10+
voyagerWebPort: 30310

0 commit comments

Comments
 (0)