Skip to content

Commit 10d27a9

Browse files
Backport ocrenv #3136 to release/3.4 (#3325)
* copy all the files from backport-ocrenv * sync istio.md to the latest release/3.4 Co-authored-by: Ryan Eberhard <[email protected]>
1 parent 3d16c51 commit 10d27a9

File tree

95 files changed

+587
-615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+587
-615
lines changed

Jenkinsfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ pipeline {
147147
choices: ['phx.ocir.io', 'container-registry.oracle.com'],
148148
description: 'Repository to pull the base images. Make sure to modify the image names if you are modifying this parameter value.'
149149
)
150+
string(name: 'TEST_IMAGES_REPO',
151+
description: '',
152+
defaultValue: 'phx.ocir.io'
153+
)
150154
string(name: 'WEBLOGIC_IMAGE_NAME',
151155
description: 'WebLogic base image name. Default is the image name in OCIR. Use middleware/weblogic for OCR.',
152156
defaultValue: 'weblogick8s/test-images/weblogic'
@@ -449,13 +453,14 @@ EOF
449453
environment {
450454
runtime_path = "${WORKSPACE}/bin:${PATH}"
451455
IMAGE_PULL_SECRET_WEBLOGIC = credentials("${image_pull_secret_weblogic_creds}")
452-
OCR_USERNAME = credentials("${ocr_username_creds}")
453-
OCR_PASSWORD = credentials("${ocr_password_creds}")
454-
OCR_EMAIL = credentials("${ocr_username_creds}")
455-
OCIR_REGISTRY = credentials("${ocir_registry_creds}")
456-
OCIR_USERNAME = credentials("${ocir_username_creds}")
457-
OCIR_PASSWORD = credentials("${ocir_password_creds}")
458-
OCIR_EMAIL = credentials("${ocir_email_creds}")
456+
BASE_IMAGES_REPO = credentials("${ocir_registry_creds}")
457+
BASE_IMAGES_REPO_USERNAME = credentials("${ocir_username_creds}")
458+
BASE_IMAGES_REPO_PASSWORD = credentials("${ocir_password_creds}")
459+
BASE_IMAGES_REPO_EMAIL = credentials("${ocir_username_creds}")
460+
TEST_IMAGES_REPO = credentials("${ocir_registry_creds}")
461+
TEST_IMAGES_REPO_USERNAME = credentials("${ocir_username_creds}")
462+
TEST_IMAGES_REPO_PASSWORD = credentials("${ocir_password_creds}")
463+
TEST_IMAGES_REPO_EMAIL = credentials("${ocir_email_creds}")
459464
}
460465
steps {
461466
sh '''
@@ -482,8 +487,9 @@ EOF
482487
echo "-DNUMBER_OF_THREADS=\"${NUMBER_OF_THREADS}\"" >> ${WORKSPACE}/.mvn/maven.config
483488
echo "-Dwko.it.wdt.download.url=\"${WDT_DOWNLOAD_URL}\"" >> ${WORKSPACE}/.mvn/maven.config
484489
echo "-Dwko.it.wit.download.url=\"${WIT_DOWNLOAD_URL}\"" >> ${WORKSPACE}/.mvn/maven.config
485-
echo "-Dwko.it.repo.registry=\"${REPO_REGISTRY}\"" >> ${WORKSPACE}/.mvn/maven.config
490+
>> ${WORKSPACE}/.mvn/maven.config
486491
echo "-Dwko.it.base.images.repo=\"${BASE_IMAGES_REPO}\"" >> ${WORKSPACE}/.mvn/maven.config
492+
echo "-Dwko.it.test.images.repo=\"${TEST_IMAGES_REPO}\"" >> ${WORKSPACE}/.mvn/maven.config
487493
echo "-Dwko.it.weblogic.image.name=\"${WEBLOGIC_IMAGE_NAME}\"" >> ${WORKSPACE}/.mvn/maven.config
488494
echo "-Dwko.it.weblogic.image.tag=\"${WEBLOGIC_IMAGE_TAG}\"" >> ${WORKSPACE}/.mvn/maven.config
489495
echo "-Dwko.it.fmwinfra.image.name=\"${FMWINFRA_IMAGE_NAME}\"" >> ${WORKSPACE}/.mvn/maven.config

integration-tests/README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ weblogic-kubernetes-operator/integration-tests/src/test/resources - properties,
2626
- Clone the `weblogic-kubernetes-operator` repository.
2727
- Set up a personal account on `container-registry.oracle.com`.
2828
- Log in to `https://container-registry.oracle.com` and accept Oracle Standard Terms and Restrictions to pull WebLogic images from `container-registry.oracle.com/middleware/weblogic`.
29-
- Export the following environment variables before running the tests:
29+
- Following environment variables must be set before running the tests. BASE_IMAGES_REPO variables are used to download the Oracle public images. TEST_IMAGES_REPO variable are used to store any public image used to certify the WebLogic Kubernates Operator (such as NGNIX Controller, Prometheous etc.) and to store the intermediate WebLogic domain images while running the integration tests.
3030
```
3131
export BASE_IMAGES_REPO="container-registry.oracle.com"
32-
export OCR_EMAIL=<ocr_email>
33-
export OCR_USERNAME=<ocr_username>
34-
export OCR_PASSWORD=<ocr_password>
32+
export BASE_IMAGES_REPO_USERNAME=<ocr_username>
33+
export BASE_IMAGES_REPO_PASSWORD=<ocr_password>
34+
export BASE_IMAGES_REPO_EMAIL=<ocr_email>
35+
36+
export TEST_IMAGES_REPO="local-registry.oracle.com"
37+
export TEST_IMAGES_REPO_USERNAME=<local_repo_username>
38+
export TEST_IMAGES_REPO_PASSWORD=<local_repo_password>
39+
export TEST_IMAGES_REPO_EMAIL=<local_repo_email>
40+
3541
```
3642
- `cd weblogic-kubernetes-operator` and run the following commands:
3743
```
@@ -57,11 +63,12 @@ mvn -Dit.test="!ItCrossDomainTransaction,!ItMiiUpdateDomainConfig" -pl integrati
5763
| `SKIP_CLEANUP` | Test infrastructure removes all Kubernetes objects created during test execution. To retain all such objects for triaging test failures, this environment variable should be set to true. Users need to run `weblogic-kubernetes-operator/operator/integration-tests/bash/cleanup.sh` to clean up Kubernetes objects after traiging. | false
5864
| `COLLECT_LOGS_ON_SUCCESS` | Test infrastructure does not keep the diagnostic log for successful tests. To archive the diagnostic log for successful tests, this environment variable should be set to true. | false
5965
| `RESULT_ROOT` | Root directory for the integration test results and artifacts generated during test execution. | `/tmp/it-testsresults`
60-
| `BASE_IMAGES_REPO` | The repository URL to download WebLogic and FMW image. Make sure you have access to this repository. The other supported repository is `phx.ocir.io` (OCIR). | `container-registry.oracle.com` (OCR)
61-
| `WEBLOGIC_IMAGE_NAME` | Name of the WebLogic image in the chosen repository.| `middleware/weblogic` (OCR)
66+
| `BASE_IMAGES_REPO` | The repository URL to download WebLogic and FMW images. Make sure you have access to this repository. | No Default
67+
| `TEST_IMAGES_REPO` | The repository URL variable are used to store any public image used to certify the WebLogic Kubernates Operator (such as NGNIX Controller, Prometheous etc.) and to store the intermediate WebLogic domain images while running the integration tests | No Default
68+
| `WEBLOGIC_IMAGE_NAME` | Name of the WebLogic image in the chosen repository.| `middleware/weblogic` (If OCR repository is set as BASE_IMAGES_REPO)
6269
| `WEBLOGIC_IMAGE_TAG` | The tag for WebLogic base image. Generally, it represents the WebLogic Server version with JDK and/or installation type. Possible values are 12.2.1.3, 12.2.1.3-dev, 12.2.1.4-slim, 14.1.1.0-11 or 14.1.1.0-8. Please check the repository for the availability of these images. | 12.2.1.4
6370
| `FMWINFRA_IMAGE_TAG` | The tag for Fusion Middleware Infrastructure base image. Generally, it represents the FMW version. Possible values are 12.2.1.3, 12.2.1.4. Please check the repository for the availability of these images. | 12.2.1.4
64-
| `FMWINFRA_IMAGE_NAME` | Name of the Fusion Middleware Infrastructure image in the chosen repository.| `middleware/fmw-infrastructure` (OCR)
71+
| `FMWINFRA_IMAGE_NAME` | Name of the Fusion Middleware Infrastructure image in the chosen repository.| `middleware/fmw-infrastructure` (If OCR repository is set as BASE_IMAGES_REPO)
6572

6673
## Logging/Archiving
6774

integration-tests/pom.xml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
<wko.it.skip.cleanup>${env.SKIP_CLEANUP}</wko.it.skip.cleanup>
2323
<wko.it.domain.version>${env.DOMAIN_VERSION}</wko.it.domain.version>
2424
<wko.it.kind.repo>${env.KIND_REPO}</wko.it.kind.repo>
25-
<wko.it.ocir.registry>${env.OCIR_REGISTRY}</wko.it.ocir.registry>
26-
<wko.it.repo.registry>${env.REPO_REGISTRY}</wko.it.repo.registry>
25+
<wko.it.test.images.repo>${env.TEST_IMAGES_REPO}</wko.it.test.images.repo>
2726
<wko.it.base.images.repo>${env.BASE_IMAGES_REPO}</wko.it.base.images.repo>
2827
<wko.it.weblogic.image.name>${env.WEBLOGIC_IMAGE_NAME}</wko.it.weblogic.image.name>
2928
<wko.it.weblogic.image.tag>${env.WEBLOGIC_IMAGE_TAG}</wko.it.weblogic.image.tag>
29+
<wko.it.weblogic.image.tags>${env.WEBLOGIC_IMAGE_TAGS}</wko.it.weblogic.image.tags>
3030
<wko.it.fmwinfra.image.name>${env.FMWINFRA_IMAGE_NAME}</wko.it.fmwinfra.image.name>
3131
<wko.it.fmwinfra.image.tag>${env.FMWINFRA_IMAGE_TAG}</wko.it.fmwinfra.image.tag>
3232
<wko.it.db.image.name>${env.DB_IMAGE_NAME}</wko.it.db.image.name>
@@ -64,7 +64,7 @@
6464
<wko.it.collect.logs.on.success>${env.COLLECT_LOGS_ON_SUCCESS}</wko.it.collect.logs.on.success>
6565
<wko.it.sleep.seconds.after.failure>${env.SLEEP_SECONDS_AFTER_FAILURE}</wko.it.sleep.seconds.after.failure>
6666
<wko.it.wit.java.home>${env.WIT_JAVA_HOME}</wko.it.wit.java.home>
67-
<wko.it.weblogic.image_tags>${env.WEBLOGIC_IMAGE_TAGS}</wko.it.weblogic.image_tags>
67+
<wko.it.weblogic.image.tag>${env.WEBLOGIC_IMAGE_TAG}</wko.it.weblogic.image.tag>
6868
<wko.it.k8s.nodeport.host1>${env.K8S_NODEPORT_HOST1}</wko.it.k8s.nodeport.host1>
6969
<wko.it.k8s.nodeport.host2>${env.K8S_NODEPORT_HOST2}</wko.it.k8s.nodeport.host2>
7070
<wko.it.opdemo>${env.opdemo}</wko.it.opdemo>
@@ -127,24 +127,32 @@
127127
<skip>${skipITs}</skip>
128128
<rules>
129129
<requireEnvironmentVariable>
130-
<message>Set the OCIR_USERNAME environment variable to specify the OCIR username to use for pulling/pushing images.</message>
131-
<variableName>OCIR_USERNAME</variableName>
130+
<message>Set the TEST_IMAGES_REPO environment variable to specify the TEST_IMAGES_REPO username to use for pulling/pushing images.</message>
131+
<variableName>TEST_IMAGES_REPO</variableName>
132+
</requireEnvironmentVariable>
133+
<requireEnvironmentVariable>
134+
<message>Set the TEST_IMAGES_REPO_USERNAME environment variable to specify the TEST_IMAGES_REPO username to use for pulling/pushing images.</message>
135+
<variableName>TEST_IMAGES_REPO_USERNAME</variableName>
132136
</requireEnvironmentVariable>
133137
<requireEnvironmentVariable>
134-
<message>Set the OCIR_PASSWORD environment variable to specify the OCIR password to use for pulling/pushing images.</message>
135-
<variableName>OCIR_PASSWORD</variableName>
138+
<message>Set the TEST_IMAGES_REPO_PASSWORD environment variable to specify the TEST_IMAGES_REPO password to use for pulling/pushing images.</message>
139+
<variableName>TEST_IMAGES_REPO_PASSWORD</variableName>
136140
</requireEnvironmentVariable>
137141
<requireEnvironmentVariable>
138-
<message>Set the OCIR_EMAIL environment variable to specify the OCIR user's email address to use for creating the image pull secret.</message>
139-
<variableName>OCIR_EMAIL</variableName>
142+
<message>Set the TEST_IMAGES_REPO_EMAIL environment variable to specify the TEST_IMAGES_REPO user's email address to use for creating the image pull secret.</message>
143+
<variableName>TEST_IMAGES_REPO_EMAIL</variableName>
140144
</requireEnvironmentVariable>
141145
<requireEnvironmentVariable>
142-
<message>Set the OCR_USERNAME environment variable to specify the OCR username to use for pulling images.</message>
143-
<variableName>OCR_USERNAME</variableName>
146+
<message>Set the BASE_IMAGES_REPO environment variable to specify the BASE_IMAGES_REPO username to use for pulling images.</message>
147+
<variableName>BASE_IMAGES_REPO</variableName>
144148
</requireEnvironmentVariable>
145149
<requireEnvironmentVariable>
146-
<message>Set the OCR_PASSWORD environment variable to specify the OCR password to use for pulling images.</message>
147-
<variableName>OCR_PASSWORD</variableName>
150+
<message>Set the BASE_IMAGES_REPO_USERNAME environment variable to specify the BASE_IMAGES_REPO username to use for pulling images.</message>
151+
<variableName>BASE_IMAGES_REPO_USERNAME</variableName>
152+
</requireEnvironmentVariable>
153+
<requireEnvironmentVariable>
154+
<message>Set the BASE_IMAGES_REPO_PASSWORD environment variable to specify the BASE_IMAGES_REPO password to use for pulling images.</message>
155+
<variableName>BASE_IMAGES_REPO_PASSWORD</variableName>
148156
</requireEnvironmentVariable>
149157
</rules>
150158
</configuration>
@@ -184,9 +192,8 @@
184192
<wko.it.skip.cleanup>${wko.it.skip.cleanup}</wko.it.skip.cleanup>
185193
<wko.it.domain.version>${wko.it.domain.version}</wko.it.domain.version>
186194
<wko.it.kind.repo>${wko.it.kind.repo}</wko.it.kind.repo>
187-
<wko.it.ocir.registry>${wko.it.ocir.registry}</wko.it.ocir.registry>
188-
<wko.it.repo.registry>${wko.it.repo.registry}</wko.it.repo.registry>
189195
<wko.it.base.images.repo>${wko.it.base.images.repo}</wko.it.base.images.repo>
196+
<wko.it.test.images.repo>${wko.it.test.images.repo}</wko.it.test.images.repo>
190197
<wko.it.weblogic.image.name>${wko.it.weblogic.image.name}</wko.it.weblogic.image.name>
191198
<wko.it.weblogic.image.tag>${wko.it.weblogic.image.tag}</wko.it.weblogic.image.tag>
192199
<wko.it.fmwinfra.image.name>${wko.it.fmwinfra.image.name}</wko.it.fmwinfra.image.name>
@@ -225,7 +232,8 @@
225232
<wko.it.collect.logs.on.success>${wko.it.collect.logs.on.success}</wko.it.collect.logs.on.success>
226233
<wko.it.sleep.seconds.after.failure>${wko.it.sleep.seconds.after.failure}</wko.it.sleep.seconds.after.failure>
227234
<wko.it.wit.java.home>${wko.it.wit.java.home}</wko.it.wit.java.home>
228-
<wko.it.weblogic.image_tags>${wko.it.weblogic.image_tags}</wko.it.weblogic.image_tags>
235+
<wko.it.weblogic.image.tag>${wko.it.weblogic.image.tag}</wko.it.weblogic.image.tag>
236+
<wko.it.weblogic.image.tags>${wko.it.weblogic.image.tag}</wko.it.weblogic.image.tags>
229237
<wko.it.k8s.nodeport.host1>${wko.it.k8s.nodeport.host1}</wko.it.k8s.nodeport.host1>
230238
<wko.it.k8s.nodeport.host2>${wko.it.k8s.nodeport.host2}</wko.it.k8s.nodeport.host2>
231239
<wko.it.opdemo>${wko.it.opdemo}</wko.it.opdemo>

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCoherenceTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
3838
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
3939
import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION;
40-
import static oracle.weblogic.kubernetes.TestConstants.OCIR_SECRET_NAME;
40+
import static oracle.weblogic.kubernetes.TestConstants.TEST_IMAGES_REPO_SECRET_NAME;
4141
import static oracle.weblogic.kubernetes.actions.ActionConstants.APP_DIR;
4242
import static oracle.weblogic.kubernetes.actions.TestActions.createDomainCustomResource;
4343
import static oracle.weblogic.kubernetes.actions.TestActions.execCommand;
@@ -47,7 +47,7 @@
4747
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkServiceExists;
4848
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
4949
import static oracle.weblogic.kubernetes.utils.ImageUtils.createImageAndVerify;
50-
import static oracle.weblogic.kubernetes.utils.ImageUtils.createOcirRepoSecret;
50+
import static oracle.weblogic.kubernetes.utils.ImageUtils.createTestRepoSecret;
5151
import static oracle.weblogic.kubernetes.utils.ImageUtils.dockerLoginAndPushImageToRegistry;
5252
import static oracle.weblogic.kubernetes.utils.OperatorUtils.installAndVerifyOperator;
5353
import static oracle.weblogic.kubernetes.utils.PodUtils.checkPodReady;
@@ -256,7 +256,7 @@ private static String createAndVerifyDomainImage() {
256256
// create docker registry secret to pull the image from registry
257257
// this secret is used only for non-kind cluster
258258
logger.info("Create docker registry secret in namespace {0}", domainNamespace);
259-
createOcirRepoSecret(domainNamespace);
259+
createTestRepoSecret(domainNamespace);
260260

261261
return domImage;
262262
}
@@ -320,7 +320,7 @@ private static void createDomainCrAndVerify(String adminSecretName, String domIm
320320
.domainHomeSourceType("Image")
321321
.image(domImage)
322322
.addImagePullSecretsItem(new V1LocalObjectReference()
323-
.name(OCIR_SECRET_NAME))
323+
.name(TEST_IMAGES_REPO_SECRET_NAME))
324324
.webLogicCredentialsSecret(new V1SecretReference()
325325
.name(adminSecretName)
326326
.namespace(domainNamespace))

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
import static io.kubernetes.client.util.Yaml.dump;
6161
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
6262
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
63-
import static oracle.weblogic.kubernetes.TestConstants.BASE_IMAGES_REPO_SECRET;
63+
import static oracle.weblogic.kubernetes.TestConstants.BASE_IMAGES_REPO_SECRET_NAME;
6464
import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION;
6565
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
6666
import static oracle.weblogic.kubernetes.TestConstants.OKD;
@@ -92,7 +92,7 @@
9292
import static oracle.weblogic.kubernetes.utils.DeployUtil.deployUsingRest;
9393
import static oracle.weblogic.kubernetes.utils.DomainUtils.createDomainAndVerify;
9494
import static oracle.weblogic.kubernetes.utils.ExecCommand.exec;
95-
import static oracle.weblogic.kubernetes.utils.ImageUtils.createSecretForBaseImages;
95+
import static oracle.weblogic.kubernetes.utils.ImageUtils.createBaseRepoSecret;
9696
import static oracle.weblogic.kubernetes.utils.JobUtils.createDomainJob;
9797
import static oracle.weblogic.kubernetes.utils.JobUtils.getIntrospectJobName;
9898
import static oracle.weblogic.kubernetes.utils.MySQLDBUtils.createMySQLDB;
@@ -186,7 +186,7 @@ public void initAll(@Namespaces(2) List<String> namespaces) {
186186

187187
// create pull secrets for WebLogic image when running in non Kind Kubernetes cluster
188188
// this secret is used only for non-kind cluster
189-
createSecretForBaseImages(domainNamespace);
189+
createBaseRepoSecret(domainNamespace);
190190

191191

192192
//start two MySQL database instances
@@ -925,7 +925,7 @@ private void createDomain() {
925925
.imagePullPolicy("IfNotPresent")
926926
.imagePullSecrets(Arrays.asList(
927927
new V1LocalObjectReference()
928-
.name(BASE_IMAGES_REPO_SECRET))) // this secret is used only in non-kind cluster
928+
.name(BASE_IMAGES_REPO_SECRET_NAME))) // this secret is used only in non-kind cluster
929929
.webLogicCredentialsSecret(new V1SecretReference()
930930
.name(wlSecretName)
931931
.namespace(domainNamespace))

0 commit comments

Comments
 (0)