Skip to content

Commit 50350ec

Browse files
authored
default to new lax validation for WDT validate with model only (#82)
1 parent 8dab027 commit 50350ec

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/ImageOperation.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ List<String> handleWdtArgsIfRequired(String tmpDir) throws IOException {
375375
//Until WDT supports multiple variable files, take single file argument from CLI and convert to list
376376
dockerfileOptions.setWdtVariables(Collections.singletonList(wdtVariableFilename));
377377
}
378+
379+
dockerfileOptions.setWdtStrictValidation(wdtStrictValidation);
378380
}
379381
logger.exiting();
380382
return retVal;
@@ -571,14 +573,20 @@ public DomainType getWdtDomainType() {
571573
)
572574
private String wdtJavaOptions;
573575

574-
575576
@Option(
576577
names = {"--wdtModelOnly"},
577578
description = "Install WDT and copy the models to the image, but do not create the domain. "
578579
+ "Default: ${DEFAULT-VALUE}."
579580
)
580581
private boolean wdtModelOnly = false;
581582

583+
@Option(
584+
names = {"--wdtStrictValidation"},
585+
description = "Use strict validation for the WDT validation method. Only applies when using model only. "
586+
+ "Default: ${DEFAULT-VALUE}."
587+
)
588+
private boolean wdtStrictValidation = false;
589+
582590
@Unmatched
583591
List<String> unmatchedOptions;
584592
}

imagetool/src/main/java/com/oracle/weblogic/imagetool/util/DockerfileOptions.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class DockerfileOptions {
4343
private String wdtJavaOptions;
4444
private boolean wdtModelOnly;
4545
private boolean wdtRunRcu;
46+
private boolean wdtStrictValidation;
4647

4748
/**
4849
* Options to be used with the Mustache template.
@@ -70,6 +71,7 @@ public DockerfileOptions() {
7071
wdtArchiveList = new ArrayList<>();
7172
wdtVariableList = new ArrayList<>();
7273
wdtRunRcu = false;
74+
wdtStrictValidation = false;
7375
}
7476

7577
/**
@@ -476,6 +478,16 @@ public DockerfileOptions setRunRcu(boolean value) {
476478
return this;
477479
}
478480

481+
482+
public boolean strictValidation() {
483+
return wdtStrictValidation;
484+
}
485+
486+
public DockerfileOptions setWdtStrictValidation(boolean value) {
487+
wdtStrictValidation = value;
488+
return this;
489+
}
490+
479491
public String wlsdeploy_properties() {
480492
return wdtJavaOptions;
481493
}

imagetool/src/main/resources/docker-files/Create_Image.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ RUN unzip -q {{{tmpDir}}}/$WLS_PKG -d {{{tmpDir}}} \
154154
{{/modelOnly}}
155155
{{#modelOnly}}
156156
&& chmod u+x ./*.sh \
157-
&& ./validateModel.sh \
157+
&& ./validateModel.sh {{^strictValidation}}-method lax{{/strictValidation}} \
158158
-oracle_home {{{oracle_home}}} \
159159
-domain_type {{domainType}} \
160160
{{{wdtVariableFileArgument}}} {{{wdtModelFileArgument}}} {{{wdtArchiveFileArgument}}}

imagetool/src/main/resources/docker-files/Update_Image.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
RUN cd {{{wdt_home}}} \
6464
&& cd weblogic-deploy/bin \
6565
&& chmod u+x ./*.sh \
66-
&& ./validateModel.sh \
66+
&& ./validateModel.sh {{^strictValidation}}-method lax{{/strictValidation}} \
6767
-oracle_home {{{oracle_home}}} \
6868
-domain_type {{domainType}} \
6969
{{{wdtVariableFileArgument}}} {{{wdtModelFileArgument}}} {{{wdtArchiveFileArgument}}}

0 commit comments

Comments
 (0)