Skip to content

OWLS-83537 - Update domain home in image samples to use WIT instead of docker-images samples #2290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 109 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from 100 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
073963f
create common wdt-utility.sh
alai8 Feb 5, 2021
7cfccb8
use wdt
alai8 Feb 5, 2021
a7634c4
correct argument
alai8 Feb 6, 2021
cacdc7f
run_wdt supports domain_type arg
alai8 Feb 8, 2021
75e633a
Merge branch 'develop' into update-samples
alai8 Mar 16, 2021
f72cc1e
modify domain-home-in-image to use WIT to create image with domain
alai8 Mar 18, 2021
ad1de46
fix defaulting wdt and wit versions when not specified in input file
alai8 Mar 19, 2021
260b337
de-parameterized testSampleDomainInImage since we replace wdt and wls…
alai8 Mar 19, 2021
7c8d518
create secret if not exist in testSampleDomainInPv
alai8 Mar 19, 2021
0237356
minor cleanup domain-home-in-image scripts
alai8 Mar 19, 2021
50bc3c8
update fmw domain home in image sample to use wit instead of docker f…
alai8 Mar 19, 2021
3167adb
revert changes
alai8 Mar 23, 2021
b3cc84f
update domain-home-in-image sample doc with WIT
alai8 Mar 23, 2021
eb04269
more WIT related changes to samples docs
alai8 Mar 23, 2021
039baa1
make wdt and wit install dir customizable
alai8 Mar 24, 2021
7a1d40c
update comments and doc for toolsDir
alai8 Mar 24, 2021
0fd273f
uses different model depends on fmwDomainType in create-domai-fmw-inf…
alai8 Mar 26, 2021
afa55d9
Merge branch 'develop' into update-samples
alai8 Mar 26, 2021
7090be2
Merge branch 'update-samples' of https://github.com/oracle/weblogic-k…
alai8 Mar 26, 2021
8bfe127
rename topology.yaml to wdt_model_dynamic.yaml
alai8 Mar 26, 2021
0b2aa64
use https_proxy to download zip files if set
alai8 Mar 26, 2021
78195dc
add https_proxy env to create domain job
alai8 Mar 26, 2021
73fe777
add https_proxy env to create domain job
alai8 Mar 26, 2021
3daaaf5
need to call extractDomainResource.sh for wdt
alai8 Mar 26, 2021
424f66c
doc update
alai8 Mar 26, 2021
46f5bf5
remove -k option in create-domain.sh for domain-home-in-image samples
alai8 Mar 26, 2021
82fd4d6
Merge branch 'develop' into update-samples
alai8 Mar 29, 2021
e92e773
doc updates
alai8 Mar 29, 2021
1d9e5a9
domain-home-in-image samples doc update
alai8 Mar 29, 2021
d010401
remove debug outputs
alai8 Mar 29, 2021
63d054b
remove unused configuredManagedServerCount
alai8 Mar 29, 2021
86323e7
clarify rcu related params only required if fmwDomainType is JRF
alai8 Mar 29, 2021
589467e
create doc on fmw infrastructure domain home in image and updates to …
alai8 Mar 29, 2021
3033b87
minor doc fixes
alai8 Mar 29, 2021
8b3a35e
minor doc fixes
alai8 Mar 29, 2021
0aaa40b
updates to samples doc based on review feedback. Add sections on dele…
alai8 Mar 30, 2021
ccc6aa6
renamed wdt-utility.sh to wdt-and-wit-utility.sh, changed default WDT…
alai8 Mar 30, 2021
bc39d55
renamed wdt-utility.sh to wdt-and-wit-utility.sh
alai8 Mar 30, 2021
abdd5aa
prints out imagetool command for debugging
alai8 Mar 31, 2021
5657678
fix imagetool params
alai8 Mar 31, 2021
664e2af
fix wdtVersion param
alai8 Mar 31, 2021
304ea55
Merge pull request #2293 from oracle/update-samples-wip
alai8 Mar 31, 2021
d360c4a
use additionalBuildCommands to create and copy domains/applications d…
alai8 Mar 31, 2021
95b9af0
clarify that tools directory is configurable
alai8 Mar 31, 2021
cdd8594
set DOMAIN_TYPE env var in create domain job for use in createDomain.…
alai8 Apr 1, 2021
a4ec35c
parameterize ItFmwSample test to test both wdt and wlst for domain on pv
alai8 Apr 1, 2021
b15279c
minor doc fixes
alai8 Apr 2, 2021
e5bcfac
remove validation for configuredManagedServerCount for fmw domain-hom…
alai8 Apr 2, 2021
f9d2c12
encrypt model before calling imagetool to create domain in image
alai8 Apr 7, 2021
3f4e664
Merge branch 'main' into update-samples-pw
alai8 Apr 8, 2021
6c8c2e3
provide wdt encryption key via new -n create-domain.sh option
alai8 Apr 9, 2021
97b8e6d
Merge branch 'main' into update-samples-pw
alai8 Apr 12, 2021
636d0d1
remove merge conflict leftover
alai8 Apr 12, 2021
4ae34d3
remove merge conflict leftover
alai8 Apr 12, 2021
6f34831
add -n option to create-domain.sh to support optionally encrypt passw…
alai8 Apr 12, 2021
9363cae
correct merge conflict errors
alai8 Apr 12, 2021
bd1f4e5
document -n option for encryption key in create-domain.sh in domain-h…
alai8 Apr 12, 2021
22bf29f
Merge branch 'main' into update-samples-merge
alai8 Apr 13, 2021
1d66276
Merge branch 'main' into update-samples-merge
alai8 Apr 16, 2021
7f1bc88
Merge branch 'main' into update-samples
alai8 Apr 19, 2021
808808a
add sample on using wlst script with imageTool to create WebLogic dom…
alai8 Apr 22, 2021
bd37662
comments
alai8 Apr 22, 2021
8d47751
add domainHome and createDomainWdtModel input parameters, and various…
alai8 Apr 23, 2021
3be689c
minor fixes
alai8 Apr 23, 2021
09813a6
minor cleanup
alai8 Apr 26, 2021
9106e0a
validation, improved error messsages, do not print password from prop…
alai8 Apr 26, 2021
943e4c9
exit 1 if wlst.sh return non-zero
alai8 Apr 26, 2021
7418f81
Merge pull request #2333 from oracle/update-samples-wlst
alai8 Apr 26, 2021
f90104f
move wdt model yaml files to wdt directory
alai8 Apr 26, 2021
ad89c7c
Merge branch 'main' into update-samples-wip
alai8 Apr 26, 2021
604549a
update usages text
alai8 Apr 26, 2021
fbd4164
doc fixes
alai8 Apr 26, 2021
e861c63
update doc with wlst script option
alai8 Apr 26, 2021
a37f2e5
support calling create-domain.sh from a different directory
alai8 Apr 27, 2021
019f776
parameterized testSampleDomainInImage to support both wdt and wlst
alai8 Apr 27, 2021
828abb1
updated to work with modified encrypt_model arguments
alai8 Apr 27, 2021
299a7b4
remove leftover debug message
alai8 Apr 27, 2021
54615d1
add wlst script support to fmw domain home in image sample
alai8 Apr 28, 2021
769aeab
add wlst support to fmw domain home in image sample
alai8 Apr 28, 2021
a84f565
fix usage of create-domain.sh
alai8 Apr 28, 2021
00c4dbe
Merge branch 'main' into update-samples-wip
alai8 Apr 28, 2021
132c661
misc comment/output fixes
alai8 Apr 28, 2021
aaebb2a
remove unused files
alai8 Apr 29, 2021
7f5f37a
fmw image chmod oracle:oracle -> oracle:root
alai8 Apr 29, 2021
c4b1332
minor cleanup
alai8 Apr 29, 2021
66be631
remove DEBUG_PORT and DEBUG_FLAG
alai8 Apr 30, 2021
450c39e
minor doc edits
alai8 Apr 30, 2021
6e04d3b
Merge branch 'main' into update-samples-wip
alai8 Apr 30, 2021
37140ed
move mode from create-domain.sh option to create-domain-inputs.yaml, …
alai8 May 3, 2021
3a3981f
doc fixes
alai8 May 3, 2021
17cb95b
minor doc fixes
alai8 May 3, 2021
19ccbab
fixes copy and paste leftover
alai8 May 3, 2021
285bdb9
Merge branch 'update-samples-wip' of github.com:oracle/weblogic-kuber…
alai8 May 3, 2021
7a2dfc8
error message fix
alai8 May 3, 2021
197ba32
replace -m wlst with mode: wlst in input file
alai8 May 3, 2021
cb4b47a
replace rcuSchemaPassword input parameters with -q create-domain.sh o…
alai8 May 3, 2021
02bd51d
replace rcuSchemaPassword input parameters with -q create-domain.sh o…
alai8 May 3, 2021
9b4be17
add -q create-domain.sh to doc for fmw infrastructure domain home in …
alai8 May 4, 2021
c140b67
Merge branch 'main' into update-samples
alai8 May 4, 2021
8ea6c55
WebLogic Server Kubernetes Operator -> WebLogic Kubernetes Operator
alai8 May 4, 2021
c8265aa
do not echo password and other minor fixes per review comments
alai8 May 5, 2021
79de633
doc fixes
alai8 May 5, 2021
e239da1
typo fix
ddsharpe May 6, 2021
f80d782
fixed typos
alai8 May 10, 2021
342bc8c
Merge branch 'main' into update-samples
alai8 May 10, 2021
969496b
samples doc update per review comments
alai8 May 11, 2021
a0b3f11
remove quotes from --tag
alai8 May 11, 2021
ba1ddbc
typo
alai8 May 11, 2021
715f227
update urls to doc sites for wdt and wit
alai8 May 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions documentation/staging/content/quickstart/cleanup.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,20 @@ weight: 7
```shell
$ kubectl delete namespace traefik
```

#### Delete the generated image.

1. When no longer needed, delete the generated image by using the `docker rmi` command.
Use the following command to delete an image tagged with `domain-home-in-image:12.2.1.4`:

```shell
$ docker rmi domain-home-in-image:12.2.1.4
```

#### Delete the tools directory.

1. When no longer needed, delete the directory where WebLogic Deploy Tool and WebLogic Image Tool are installed.

```shell
$ rm -rf /tmp/dhii-sample/tools/
```
3 changes: 3 additions & 0 deletions documentation/staging/content/quickstart/create-domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ weight: 6
respectively, as you provided when creating the Kubernetes Secret in Step 2.
{{% /notice %}}

For the detailed steps that the `create-domain.sh` script performs, see [Domain Home In Image]({{< relref "/samples/simple/domains/domain-home-in-image/_index.md" >}}).


1. Confirm that the operator started the servers for the domain:

a. Use `kubectl` to show that the Domain was created:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "FMW Infrastructure domain"
title: "FMW Infrastructure domain on a PV"
date: 2019-04-18T07:32:31-05:00
weight: 5
description: "Sample for creating an FMW Infrastructure domain home on an existing PV or
Expand All @@ -20,7 +20,9 @@ Before you begin, read this document, [Domain resource]({{< relref "/userguide/m
The following prerequisites must be met prior to running the create domain script:

* Make sure the WebLogic Kubernetes Operator is running.
* The operator requires FMW Infrastructure 12.2.1.3.0 with patch 29135930 applied or FMW Infrastructure 12.2.1.4.0. For details on how to obtain or create the image, refer to [FMW Infrastructure domains]({{< relref "/userguide/managing-domains/fmw-infra/_index.md#obtaining-the-fmw-infrastructure-docker-image" >}}).
* The operator requires FMW Infrastructure 12.2.1.3.0 with patch 29135930 applied or FMW Infrastructure 12.2.1.4.0.
For details on how to obtain or create the image, refer to
[FMW Infrastructure domains]({{< relref "/userguide/managing-fmw-domains/fmw-infra/#obtaining-the-fmw-infrastructure-image" >}}).
* Create a Kubernetes Namespace for the domain unless you intend to use the default namespace.
* In the same Kubernetes Namespace, create the Kubernetes PersistentVolume (PV) where the domain
home will be hosted, and the Kubernetes PersistentVolumeClaim (PVC) for the domain. For samples
Expand All @@ -32,12 +34,18 @@ The following prerequisites must be met prior to running the create domain scrip
with an inputs file that has the `domainUID` set to `domain1`.
* Create the Kubernetes Secrets `username` and `password` of the administrative account in the same Kubernetes
namespace as the domain.
* Configure access to your database. For details, see [here]({{< relref "/userguide/managing-fmw-domains/fmw-infra/_index.md#configuring-access-to-your-database" >}}).
* Create a Kubernetes Secret with the RCU credentials. For details, refer to this [document](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/kubernetes/samples/scripts/create-rcu-credentials/README.md).

* Unless you are creating a Restricted-JRF domain, you also need to:
* Configure access to your database. For details, see [here]({{< relref "/userguide/managing-fmw-domains/fmw-infra/_index.md#configuring-access-to-your-database" >}}).
* Create a Kubernetes Secret with the RCU credentials. For details, refer to this [document](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/kubernetes/samples/scripts/create-rcu-credentials/README.md).

#### Use the script to create a domain

Make a copy of the `create-domain-inputs.yaml` file, and run the create script, pointing it at
The sample for creating domains is in this directory:

```shell
$ cd kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv
```
Make a copy of the `create-domain-inputs.yaml` file, update it with the correct values, and run the create script, pointing it at
your inputs file and an output directory:

```shell
Expand Down Expand Up @@ -116,8 +124,9 @@ The following parameters can be provided in the inputs file.
| `domainUID` | Unique ID that will be used to identify this particular domain. Used as the name of the generated WebLogic domain as well as the name of the Domain. This ID must be unique across all domains in a Kubernetes cluster. This ID cannot contain any character that is not valid in a Kubernetes Service name. | `domain1` |
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
| `fmwDomainType` | FMW Infrastructure Domain Type. Legal values are `JRF` or `RestrictedJRF`. | `JRF` |
| `httpAccessLogInLogHome` | Boolean indicating if server HTTP access log files should be written to the same directory as `logHome`. Otherwise, server HTTP access log files will be written to the directory specified in the WebLogic domain home configuration. | `true` |
| `image` | WebLogic Server image. The operator requires FMW Infrastructure 12.2.1.3.0 with patch 29135930 applied or FMW Infrastructure 12.2.1.4.0. For details on how to obtain or create the image, see [FMW Infrastructure domains]({{< relref "/userguide/managing-fmw-domains/fmw-infra/_index.md#obtaining-the-fmw-infrastructure-docker-image" >}}). | `container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4` |
| `image` | FMW Infrastructure image. The operator requires FMW Infrastructure 12.2.1.3.0 with patch 29135930 applied or FMW Infrastructure 12.2.1.4.0. For details on how to obtain or create the image, see [FMW Infrastructure domains]({{< relref "/userguide/managing-fmw-domains/fmw-infra/#obtaining-the-fmw-infrastructure-image" >}}). | `container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4` |
| `imagePullPolicy` | WebLogic Server image pull policy. Legal values are `IfNotPresent`, `Always`, or `Never`. | `IfNotPresent` |
| `imagePullSecretName` | Name of the Kubernetes Secret to access the container registry to pull the WebLogic Server image. The presence of the secret will be validated when this parameter is specified. | |
| `includeServerOutInPodLog` | Boolean indicating whether to include the server `.out` in the pod's `stdout`. | `true` |
Expand All @@ -140,7 +149,7 @@ The following parameters can be provided in the inputs file.

Note that the names of the Kubernetes resources in the generated YAML files may be formed with the
value of some of the properties specified in the `create-inputs.yaml` file. Those properties include
the `adminServerName`, `clusterName` and `managedServerNameBase`. If those values contain any
the `adminServerName`, `clusterName`, and `managedServerNameBase`. If those values contain any
characters that are invalid in a Kubernetes Service name, those characters are converted to
valid values in the generated YAML files. For example, an uppercase letter is converted to a
lowercase letter and an underscore `("_")` is converted to a hyphen `("-")`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

import io.kubernetes.client.openapi.ApiException;
import oracle.weblogic.kubernetes.actions.impl.primitive.Command;
Expand All @@ -17,7 +19,8 @@
import org.awaitility.core.ConditionFactory;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
Expand Down Expand Up @@ -57,7 +60,7 @@
/**
* Tests related to FMW domain samples.
*/
@DisplayName("Verify the JRF domain on pv sample using wlst")
@DisplayName("Verify the JRF domain on pv sample using wlst and wdt")
@IntegrationTest
public class ItFmwSample {

Expand All @@ -66,20 +69,14 @@ public class ItFmwSample {

private static final Path samplePath = Paths.get(ITTESTS_DIR, "../kubernetes/samples");
private static final Path tempSamplePath = Paths.get(WORK_DIR, "fmw-sample-testing");
private final String domainUid = "fmwsamplepv";

private static final String RCUSCHEMAPREFIX = "fmwsamplepv";
private static final String ORACLEDBURLPREFIX = "oracle-db.";
private static final String ORACLEDBSUFFIX = ".svc.cluster.local:1521/devpdb.k8s";
private static final String RCUSYSUSERNAME = "sys";
private static final String RCUSYSPASSWORD = "Oradoc_db1";
private static final String RCUSCHEMAUSERNAME = "myrcuuser";
private static final String RCUSCHEMAPASSWORD = "Oradoc_db1";
private static String dbUrl = null;
// in general the node port range has to be between 30,100 to 32,767
// to avoid port conflict because of the delay in using it, the port here
// starts with 30172
final int t3ChannelPort = getNextFreePort(30172, 32767);

// create standard, reusable retry/backoff policy
private static final ConditionFactory withStandardRetryPolicy
Expand All @@ -89,6 +86,13 @@ public class ItFmwSample {

private static LoggingFacade logger = null;

private static final String[] params = { "wdt:fmwsamplepv", "wlst:fmwsamplepv2"};

// generates the stream of objects used by parametrized test.
private static Stream<String> paramProvider() {
return Arrays.stream(params);
}

/**
* Start DB service and create RCU schema.
* Assigns unique namespaces for operator and domains.
Expand All @@ -115,13 +119,24 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
domainNamespace = namespaces.get(2);

int dbPort = 30011 + getNewSuffixCount();
logger.info("Start DB and create RCU schema for namespace: {0}, RCU prefix: {1}, "
+ "dbUrl: {2}, dbImage: {3}, fmwImage: {4}, dbPort: {5} ", dbNamespace, RCUSCHEMAPREFIX, dbUrl,
logger.info("Start DB and for namespace: {0}, "
+ "dbImage: {2}, fmwImage: {3}, dbPort: {4} ", dbNamespace,
DB_IMAGE_TO_USE_IN_SPEC, FMWINFRA_IMAGE_TO_USE_IN_SPEC, dbPort);
assertDoesNotThrow(() -> setupDBandRCUschemaBySample(DB_IMAGE_TO_USE_IN_SPEC, FMWINFRA_IMAGE_TO_USE_IN_SPEC,
RCUSCHEMAPREFIX, dbNamespace, dbPort, dbUrl),
String.format("Failed to create RCU schema for prefix %s in the namespace %s with "
+ "dbUrl %s", RCUSCHEMAPREFIX, dbNamespace, dbUrl));
assertDoesNotThrow(() -> setupDBBySample(DB_IMAGE_TO_USE_IN_SPEC, FMWINFRA_IMAGE_TO_USE_IN_SPEC,
dbNamespace, dbPort),
String.format("Failed to create DB in the namespace %s with dbPort %d ",
dbNamespace, dbPort));

for (String param: params) {
String rcuSchemaPrefix = param.split(":")[1];

logger.info("Create RCU schema with fmwImage: {0}, rcuSchemaPrefix: {1}, dbUrl: {2}, "
+ " dbNamespace: {3}:", FMWINFRA_IMAGE_TO_USE_IN_SPEC, rcuSchemaPrefix, dbUrl, dbNamespace);
assertDoesNotThrow(() -> createRcuSchema(FMWINFRA_IMAGE_TO_USE_IN_SPEC, rcuSchemaPrefix, dbUrl, dbNamespace),
String.format("Failed to create RCU schema for prefix %s in the namespace %s with dbUrl %s",
rcuSchemaPrefix, dbNamespace, dbUrl));
}



// create pull secrets for WebLogic image when running in non Kind Kubernetes cluster
Expand All @@ -133,14 +148,21 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
}

/**
* Test JRF domain on pv samples using domains created by wlst.
* Verify Pod is ready and service exists for both admin server and managed servers.
* Verify EM console is accessible.
* Test JRF domain on pv samples using domains created by wlst and wdt. Verify Pod is ready and
* service exists for both admin server and managed servers. Verify EM console is accessible.
*
* @param model domain name and script type to create domain. Acceptable values of format String:wlst|wdt
*/
@Test
@DisplayName("Test FMW Sample domain on PV")
public void testFmwSampleDomainInPvUsingWlst() {
@ParameterizedTest
@MethodSource("paramProvider")
@DisplayName("Test FMW domain on PV sample")
public void testFmwDomainInPv(String model) {

String domainUid = model.split(":")[1];
String script = model.split(":")[0];

setupSample();

// create persistent volume and persistent volume claims used by the samples
createPvPvc(domainUid);

Expand All @@ -159,6 +181,8 @@ public void testFmwSampleDomainInPvUsingWlst() {

// change image name
assertDoesNotThrow(() -> {
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
"createDomainFilesDir: wlst", "createDomainFilesDir: " + script);
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
"image: container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4",
"image: " + FMWINFRA_IMAGE_TO_USE_IN_SPEC);
Expand Down Expand Up @@ -323,14 +347,20 @@ private static void setupSample() {
});

String command = "chmod -R 755 " + tempSamplePath;
logger.info("The command to be executed: " + command);
logger.info("The command to be executed: " + command);
assertTrue(new Command()
.withParams(new CommandParams()
.command(command))
.execute(), "Failed to chmod tempSamplePath");
}

private void updateDomainInputsFile(String domainUid, Path sampleBase) {
// in general the node port range has to be between 30,100 to 32,767
// to avoid port conflict because of the delay in using it, the port here
// starts with 30172
final int t3ChannelPort = getNextFreePort(30172, 32767);
final int adminNodePort = getNextFreePort(30701, 32767);

// change namespace from default to custom, domain name, and t3PublicAddress
assertDoesNotThrow(() -> {
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
Expand All @@ -345,6 +375,8 @@ private void updateDomainInputsFile(String domainUid, Path sampleBase) {
"exposeAdminT3Channel: false", "exposeAdminT3Channel: true");
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
"exposeAdminNodePort: false", "exposeAdminNodePort: true");
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
"adminNodePort: 30701", "adminNodePort: " + adminNodePort);
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
"#imagePullSecretName:", "imagePullSecretName: " + BASE_IMAGES_REPO_SECRET);
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
Expand All @@ -357,15 +389,13 @@ private void updateDomainInputsFile(String domainUid, Path sampleBase) {
*
* @param dbImage image name of database
* @param fmwImage image name of FMW
* @param rcuSchemaPrefix rcu SchemaPrefix
* @param dbNamespace namespace where DB and RCU schema are going to start
] * @param dbNamespace namespace where DB and RCU schema are going to start
* @param dbPort NodePort of DB
* @param dbUrl URL of DB
* @throws Exception if any error occurs when setting up RCU database
*/

private static void setupDBandRCUschemaBySample(String dbImage, String fmwImage,
String rcuSchemaPrefix, String dbNamespace, int dbPort, String dbUrl) throws ApiException {
private static void setupDBBySample(String dbImage, String fmwImage,
String dbNamespace, int dbPort) throws ApiException {
LoggingFacade logger = getLogger();

setupSample();
Expand All @@ -376,10 +406,6 @@ private static void setupDBandRCUschemaBySample(String dbImage, String fmwImage,
logger.info("Start Oracle DB with dbImage: {0}, dbPort: {1}, dbNamespace: {2}",
dbImage, dbPort, dbNamespace);
startOracleDB(dbImage, dbPort, dbNamespace);
logger.info("Create RCU schema with fmwImage: {0}, rcuSchemaPrefix: {1}, dbUrl: {2}, "
+ " dbNamespace: {3}:", fmwImage, rcuSchemaPrefix, dbUrl, dbNamespace);
createRcuSchema(fmwImage, rcuSchemaPrefix, dbUrl, dbNamespace);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import static oracle.weblogic.kubernetes.assertions.TestAssertions.domainExists;
import static oracle.weblogic.kubernetes.assertions.TestAssertions.pvExists;
import static oracle.weblogic.kubernetes.assertions.TestAssertions.pvcExists;
import static oracle.weblogic.kubernetes.assertions.TestAssertions.secretExists;
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkClusterReplicaCountMatches;
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodDoesNotExist;
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodExists;
Expand Down Expand Up @@ -125,9 +126,8 @@ public static void initAll(@Namespaces(2) List<String> namespaces) {
}

/**
* Test domain in image samples using domains created by wlst and wdt.
* Test domain in image samples using domains created by image tool using wlst and wdt.
*
* @param model domain name and script type to create domain. Acceptable values of format String:wlst|wdt
*/
@Order(1)
@ParameterizedTest
Expand Down Expand Up @@ -158,20 +158,23 @@ public void testSampleDomainInImage(String model) {
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
"#image:",
"image: " + imageName);
});

if (script.equalsIgnoreCase("wdt")) {
if (script.equals("wlst")) {
assertDoesNotThrow(() -> {
replaceStringInFile(Paths.get(sampleBase.toString(), "create-domain-inputs.yaml").toString(),
"domainHomeImageBuildPath: ./docker-images/OracleWebLogic/samples/12213-domain-home-in-image",
"domainHomeImageBuildPath: ./docker-images/OracleWebLogic/samples/12213-domain-home-in-image-wdt");
}
});
"mode: wdt",
"mode: wlst");
});
}

// build the command to run create-domain.sh
String additonalOptions = " -u "
+ ADMIN_USERNAME_DEFAULT
+ " -p "
+ ADMIN_PASSWORD_DEFAULT;


String[] additonalStr = {additonalOptions, imageName};

// run create-domain.sh to create domain.yaml file, run kubectl to create the domain and verify
Expand All @@ -197,6 +200,14 @@ public void testSampleDomainInPv(String model) {

//copy the samples directory to a temporary location
setupSample();
String secretName = domainName + "-weblogic-credentials";
if (!secretExists(secretName, domainNamespace)) {
createSecretWithUsernamePassword(
secretName,
domainNamespace,
ADMIN_USERNAME_DEFAULT,
ADMIN_PASSWORD_DEFAULT);
}
//create PV and PVC used by the domain
createPvPvc(domainName);

Expand Down
Loading