Skip to content

Commit c68b844

Browse files
committed
Merge branch 'develop' into restartversiontests
2 parents 0cf66f1 + e366af8 commit c68b844

File tree

18 files changed

+440
-698
lines changed

18 files changed

+440
-698
lines changed

docs-source/content/developerguide/branching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The `develop` branch is protected and contains source for the latest completed f
1111

1212
Because we want to balance separating destabilizing work into feature branches against the possibility of later difficult merges, we encourage developers working on features to pull out any necessary refactoring or improvements that are general purpose into their own shorter-lived branches and create pull requests to `develop` when these smaller work items are completed.
1313

14-
All commits to `develop` must pass the [integration test suite]({{< relref "/developerguide/integration-tests.md" >}}). Please run these tests locally before submitting a pull request. Additionally, each push to a branch in our GitHub repository triggers a run of a subset of the integration tests with the results visible [here](https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs).
14+
All commits to `develop` must pass the [integration test suite]({{< relref "/developerguide/integration-tests.md" >}}). Please run these tests locally before submitting a pull request. Additionally, each push to a branch in our GitHub repository triggers a run of a subset of the integration tests with the results visible [here](http://build.weblogick8s.org:8080/job/weblogic-kubernetes-operator-quicktest/).
1515

1616
Please submit pull requests to the `develop` branch unless you are collaborating on a feature and have another target branch. Please see details on the Oracle Contributor Agreement (OCA) and guidelines for pull requests on the [README]({{< relref "/_index.md#contributing-to-the-oracle-weblogic-server-kubernetes-operator-repository" >}}).
1717

docs-source/content/userguide/managing-domains/configoverrides/_index.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ Typical attributes for overrides include:
8787
* Server and domain log locations
8888
* Node Manager related configuration
8989
* Changing any existing MBean name
90+
* Adding or removing a module (for example, a JDBC module)
9091

9192
**Specifically, do not use custom overrides for:**
9293

9394
* Adding or removing:
9495
* Servers
9596
* Clusters
9697
* Network Access Points (custom channels)
98+
* Modules
9799
* Changing any of the following:
98100
* Dynamic cluster size
99101
* Default, SSL, and Admin channel `Enabled`, listen address, and port
@@ -122,7 +124,7 @@ The operator requires a different file name format for override templates than W
122124
| JDBC module | `jdbc-MODULENAME.xml` |
123125
| Diagnostics module | `diagnostics-MODULENAME.xml` |
124126

125-
A `MODULENAME` must correspond to the MBean name of a system resource defined in your original `config.xml` file.
127+
A `MODULENAME` must correspond to the MBean name of a system resource defined in your original `config.xml` file. It's not possible to add a new module by using overrides. If you need your overrides to set up a new module, then have your original configuration specify 'skeleton' modules that can be overridden.
126128

127129
#### Override template schemas
128130

@@ -184,24 +186,28 @@ The secret macro `SECRETNAME` field must reference the name of a Kubernetes secr
184186

185187
#### Override template syntax special requirements
186188

187-
**Check each item below to ensure custom situational configuration takes effect:**
189+
**Check each item below for best practices and to ensure custom situational configuration takes effect:**
188190

189191
* Reference the name of the current bean and each parent bean in any hierarchy you override.
190192
* Note that the `combine-mode` verbs (`add` and `replace`) should be omitted for beans that are already defined in your original domain home configuration.
191-
* See [Override template samples](#override-template-samples) for examples.
193+
* See [Override template samples](#override-template-samples) for examples.
192194
* Use situational config `replace` and `add` verbs as follows:
193195
* If you are adding a new bean that doesn't already exist in your original domain home `config.xml`, then specify `add` on the MBean itself and on each attribute within the bean.
194196
* See the `server-debug` stanza in [Override template samples](#override-template-samples) for an example.
195197
* If you are adding a new attribute to an existing bean in the domain home `config.xml`, then the attribute needs an `add` verb.
196198
* See the `max-message-size` stanza in [Override template samples](#override-template-samples) for an example.
197199
* If you are changing the value of an existing attribute within a domain home `config.xml`, then the attribute needs a `replace` verb.
198-
* See the `public-address` stanza in [Override template samples](#override-template-samples) for an example.
200+
* See the `public-address` stanza in [Override template samples](#override-template-samples) for an example.
199201
* When overriding `config.xml`:
200202
* The XML namespace (`xmlns:` in the XML) must be exactly as specified in [Override template schemas](#override-template-schemas).
201203
* For example, use `d:` to reference `config.xml` beans and attributes, `f:` for `add` and `replace` `domain-fragment` verbs, and `s:` to reference the situational configuration schema.
202204
* Avoid specifying the domain name stanza, as this may cause some overrides to be ignored (for example, server-template scoped overrides).
203205
* When overriding modules:
204206
* It is a best practice to use XML namespace abbreviations `jms:`, `jdbc:`, and `wldf:` respectively for JMS, JDBC, and WLDF (diagnostics) module override files.
207+
* A module must already exist in your original configuration if you want to override it; it's not possible to add a new module by using overrides. If you need your overrides to set up a new module, then have your original configuration specify 'skeleton' modules that can be overridden.
208+
* See [Overriding a data source module](#overriding-a-data-source-module) for best practice advice. Note that similar advice applies generally to other module types.
209+
* Consider having your original configuration reference invalid user names, passwords, and URLs:
210+
* If your original (non-overridden) configuration references non-working user names, passwords, and URLS, then this helps guard against accidentally deploying a working configuration that's invalid for the intended environment. For example, if your base configuration references a working QA database, and there is some mistake in setting up overrides, then it's possible the running servers will connect to the QA database when you deploy to your production environment.
205211

206212
#### Override template samples
207213

@@ -238,8 +244,13 @@ The following `config.xml` override file demonstrates:
238244

239245
#### Overriding a data source module
240246

241-
The following `jdbc-testDS.xml` override template demonstrates setting the URL, user name, and password-encrypted fields of a JDBC module named `testDS` via `secret macros`. The generated situational configuration that replaces the macros with secret values will be located in the `DOMAIN_HOME/optconfig/jdbc` directory. The `password-encrypted` field will be populated with an encrypted value because it uses a secret macro with an `:encrypt` suffix. The secret is named `dbsecret` and contains three keys: `url`, `username`, and `password`.
247+
The following `jdbc-testDS.xml` override template demonstrates setting the URL, user name, and password-encrypted fields of a JDBC module named `testDS` by using `secret macros`. The generated situational configuration that replaces the macros with secret values will be located in the `DOMAIN_HOME/optconfig/jdbc` directory. The `password-encrypted` field will be populated with an encrypted value because it uses a secret macro with an `:encrypt` suffix. The secret is named `dbsecret` and contains three keys: `url`, `username`, and `password`.
242248

249+
Best practices for data source modules and their overrides:
250+
251+
* A data source module must already exist in your original configuration if you want to override it; it's not possible to add a new module by using overrides. If you need your overrides to set up a new module, then have your original configuration specify 'skeleton' modules that can be overridden. See the next two bulleted items for the typical contents of a skeleton data source module.
252+
* Set your original (non-overridden) URL, username, and password to invalid values. This helps prevent accidentally starting a server without overrides, and then having the data source successfully connect to a database that's wrong for the current environment. For example, if these attributes are set to reference a QA database in your original configuration, then a mistake configuring overrides in your production Kubernetes deployment could cause your production applications to use your QA database.
253+
* Set your original (non-overridden) `JDBCConnectionPoolParams` `MinCapacity` and `InitialCapacity` to `0`, and set your original `DriverName` to a reference an existing JDBC Driver. This ensures that you can still successfully boot a server even when you have configured invalid URL/username/password values, your database isn't running, and/or you haven't specified your overrides yet.
243254

244255
```
245256
<?xml version='1.0' encoding='UTF-8'?>
@@ -282,7 +293,7 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
282293
kubectl -n MYNAMESPACE label cm MYCMNAME weblogic.domainUID=DOMAIN_UID
283294
```
284295
* Create any Kubernetes secrets referenced by a template 'secret macro'.
285-
* Secrets can have multiple keys (files) that can hold either cleartext or base64 values. We recommend that you use base64 values for passwords via `Opaque` type secrets in their `data` field, so that they can't be easily read at a casual glance. For more information, see https://kubernetes.io/docs/concepts/configuration/secret/.
296+
* Secrets can have multiple keys (files) that can hold either cleartext or base64 values. We recommend that you use base64 values for passwords by using `Opaque` type secrets in their `data` field, so that they can't be easily read at a casual glance. For more information, see https://kubernetes.io/docs/concepts/configuration/secret/.
286297
* Secrets must be in the same Kubernetes namespace as the domain.
287298
* If a secret is going to be used by a single `DOMAIN_UID`, then we recommend adding the `weblogic.domainUID=<mydomainuid>` label to help track the resource.
288299
* For example:
@@ -382,7 +393,7 @@ Incorrectly formatted override files may be accepted without warnings or errors
382393
383394
* When a domain is first deployed, or is restarted, the operator runtime creates an introspector Kubernetes job named `DOMAIN_UID-introspect-domain-job`.
384395
* The introspector job's pod:
385-
* Mounts the Kubernetes configuration map and secrets specified via the operator domain resource `configOverrides`, `webLogicCredentialsSecret`, and `configOverrideSecrets` fields.
396+
* Mounts the Kubernetes configuration map and secrets specified by using the operator domain resource `configOverrides`, `webLogicCredentialsSecret`, and `configOverrideSecrets` fields.
386397
* Reads the mounted situational configuration templates from the configuration map and expands them to create the actual situational configuration files for the domain:
387398
* It expands some fixed replaceable values (for example, `${env:DOMAIN_UID}`).
388399
* It expands referenced secrets by reading the value from the corresponding mounted secret file (for example, `${secret:mysecret.mykey}`).

docs-source/themes/hugo-theme-learn/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This repository contains a theme for [Hugo](https://gohugo.io/), based on great
44

55
Visit the [theme documentation](https://learn.netlify.com/en/) to see what is going on. It is actually built with this theme.
66

7-
[![wercker status](https://app.wercker.com/status/233466a2be73fcea400e7dc02ef6adf9/s/master "wercker status")](https://app.wercker.com/project/byKey/233466a2be73fcea400e7dc02ef6adf9)
7+
8+
[![Build Status](http://build.weblogick8s.org:8080/buildStatus/icon?job=weblogic-kubernetes-operator-quicktest)](http://build.weblogick8s.org:8080/job/weblogic-kubernetes-operator-quicktest/)
89
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmatcornic%2Fhugo-theme-learn.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmatcornic%2Fhugo-theme-learn?ref=badge_shield)
910

1011
## Main features

integration-tests/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ This documentation describes the functional use cases that are covered in integr
44

55
# Environments
66

7-
The tests currently run in three modes: "Wercker", "Jenkins", and "standalone" Oracle Linux, where the mode is controlled by the `WERCKER` and `JENKINS` environment variables described below. The default is "standalone".
7+
The tests currently run in three modes: "shared cluster", "Jenkins", and "standalone" Oracle Linux, where the mode is controlled by the `SHARED_CLUSTER` and `JENKINS` environment variables described below. The default is "standalone".
88

99
* "Standalone" Oracle Linux, i.e, run the tests manually with the `mvn` command.
10-
* Wercker - https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs - `integration-test-java` is the pipeline name.
10+
* Shared cluster - http://build.weblogick8s.org:8080/job/weblogic-kubernetes-operator-quicktest/
1111
* Jenkins - http://wls-jenkins.us.oracle.com/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/ - Jenkins Run is restricted to Oracle Internal development process.
1212

13-
Wercker runs only Quick test use cases, Jenkins runs both Quick and Full test use cases.
13+
Shared cluster runs only Quick test use cases, Jenkins runs both Quick and Full test use cases.
1414

1515
# Use Cases
1616

@@ -41,7 +41,7 @@ Defaults for `RESULT_ROOT` & `PV_ROOT`:
4141
| --- | --- | --- | --- |
4242
| stand-alone | /scratch/$USER/wl_k8s_test_results | /scratch/$USER/wl_k8s_test_results | test defaults |
4343
| Jenkins | /scratch/k8s_dir | /scratch/k8s_dir | jenkins configuration |
44-
| Wercker | /pipeline/output/k8s_dir | /scratch | wercker.yml |
44+
| Shared cluster | /pipeline/output/k8s_dir | /scratch | |
4545

4646

4747
'Physical' subdirectories created by test:
@@ -158,7 +158,7 @@ When the integration test class ITOperator is executed, staticPrepare() method i
158158

159159
staticPrepare() - initializes the application properties from OperatorIT.properties and creates resultRoot, pvRoot, userprojectsDir directories by calling initialize() method from the base class BaseTest.
160160

161-
staticUnPrepare() - releases the cluster lease on wercker env.
161+
staticUnPrepare() - releases the cluster lease.
162162

163163
test methods - testDomainOnPVUsingWLST, testDomainOnPVUsingWDT, testTwoDomainsManagedByTwoOperators, testCreateDomainWithStartPolicyAdminOnly, testCreateDomainPVReclaimPolicyRecycle, testCreateDomainWithDefaultValuesInSampleInputs, testAutoAndCustomSitConfigOverrides, testOperatorRESTIdentityBackwardCompatibility, testOperatorRESTUsingCertificateChain
164164

@@ -211,14 +211,14 @@ The tests accepts optional env var overrides:
211211
| QUICKTEST | When set to "true", limits testing to a subset of the tests. |
212212
| LB_TYPE | The default value is "TRAEFIK". Set to "VOYAGER" if you want to use it as LB. |
213213
| INGRESSPERDOMAIN | The defult value is true. If you want to test creating TRAEFIK LB by kubectl yaml for multiple domains, set it to false. |
214-
| WERCKER | Set to true if invoking from Wercker, set to false or "" if running stand-alone or from Jenkins. Default is "". |
215-
| JENKINS | Set to true if invoking from Jenkins, set to false or "" if running stand-alone or from Wercker. Default is "". |
214+
| SHARED_CLUSTER | Set to true if invoking on shared cluster, set to false or "" if running stand-alone or from Jenkins. Default is "". |
215+
| JENKINS | Set to true if invoking from Jenkins, set to false or "" if running stand-alone or on shared cluster. Default is "". |
216216
| K8S_NODEPORT_HOST | DNS name of a Kubernetes worker node. Default is the local host's hostname. |
217217
| BRANCH_NAME | Git branch name. Default is determined by calling 'git branch'. |
218218
| LEASE_ID | Set to a unique value to (A) periodically renew a lease on the k8s cluster that indicates that no other test run should attempt to use the cluster, and (B) delete this lease when the test completes. |
219219

220220
The following additional overrides are currently only used when
221-
WERCKER=true:
221+
SHARED_CLUSTER=true:
222222

223223
| Variable | Description |
224224
| --- | --- |
@@ -305,8 +305,6 @@ $RESULT_ROOT/acceptance_test_tmp is archived under $RESULT_ROOT/acceptance_test_
305305

306306
$PV_ROOT/acceptance_test_pv is archived under $PV_ROOT/acceptance_test_pv_archive
307307

308-
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
309-
310308
# How to add a new test
311309

312310
Add a new JUnit test under integration-tests/src/test/java/oracle/kubernetes/operator.

integration-tests/src/test/java/oracle/kubernetes/operator/BaseTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public static void initialize(String appPropsFile) throws Exception {
127127
}
128128

129129
// for manual/local run, do cleanup
130-
if (System.getenv("WERCKER") == null && System.getenv("JENKINS") == null) {
130+
if (System.getenv("SHARED_CLUSTER") == null && System.getenv("JENKINS") == null) {
131131

132132
// delete k8s artifacts created if any, delete PV directories
133133
ExecResult clnResult = cleanup();
@@ -176,7 +176,7 @@ public static void initialize(String appPropsFile) throws Exception {
176176
logger.info("Adding file handler, logging to file at " + resultDir + "/java_test_suite.out");
177177

178178
// for manual/local run, create file handler, create PVROOT
179-
if (System.getenv("WERCKER") == null && System.getenv("JENKINS") == null) {
179+
if (System.getenv("SHARED_CLUSTER") == null && System.getenv("JENKINS") == null) {
180180
logger.info("Creating PVROOT " + pvRoot);
181181
Files.createDirectories(Paths.get(pvRoot));
182182
ExecResult result = ExecCommand.exec("chmod 777 " + pvRoot);
@@ -518,7 +518,7 @@ public static ExecResult cleanup() throws Exception {
518518
protected void logTestBegin(String testName) throws Exception {
519519
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
520520
logger.info("BEGIN " + testName);
521-
// renew lease at the beginning for every test method, leaseId is set only for Wercker
521+
// renew lease at the beginning for every test method, leaseId is set only for shared cluster
522522
TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
523523
}
524524

@@ -636,7 +636,7 @@ private void callWebAppAndVerifyScaling(Domain domain, int replicas) throws Exce
636636
*
637637
* @param iTClassName - IT class name to be used in the archive file name
638638
* @throws Exception when errors while running statedump.sh or cleanup.sh scripts or while
639-
* renewing the lease for wercker run
639+
* renewing the lease for shared cluster run
640640
*/
641641
public static void tearDown(String iTClassName) throws Exception {
642642
logger.log(

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,9 +1354,15 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
13541354
}
13551355

13561356
if (domainMap.containsKey("domainHomeImageBuildPath")) {
1357-
domainHomeImageBuildPath = ((String) domainMap.get("domainHomeImageBuildPath")).trim();
1357+
domainHomeImageBuildPath =
1358+
BaseTest.getResultDir()
1359+
+ "/"
1360+
+ ((String) domainMap.get("domainHomeImageBuildPath")).trim();
13581361
domainMap.put(
1359-
"domainHomeImageBuildPath", BaseTest.getResultDir() + "/" + domainHomeImageBuildPath);
1362+
"domainHomeImageBuildPath",
1363+
BaseTest.getResultDir()
1364+
+ "/"
1365+
+ ((String) domainMap.get("domainHomeImageBuildPath")).trim());
13601366
}
13611367
if (System.getenv("IMAGE_PULL_SECRET_WEBLOGIC") != null) {
13621368
domainMap.put("imagePullSecretName", System.getenv("IMAGE_PULL_SECRET_WEBLOGIC"));

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,13 @@ private void generateInputYaml() throws Exception {
378378
sb.append(operatorNS);
379379
break;
380380
}
381-
sb.append(" DNS:");
381+
// here we are assuming that if the "host name" starts with a digit, then it is actually
382+
// an IP address, and so we need to use the "IP" prefix in the SANS.
383+
if (Character.isDigit(TestUtils.getHostName().charAt(0))) {
384+
sb.append(" IP:");
385+
} else {
386+
sb.append(" DNS:");
387+
}
382388
sb.append(TestUtils.getHostName());
383389
sb.append(" >> ");
384390
sb.append(generatedInputYamlFile);
@@ -476,7 +482,7 @@ private void initialize(
476482
}
477483

478484
// customize the inputs yaml file to use our pre-built docker image
479-
// IMAGE_NAME_OPERATOR & IMAGE_TAG_OPERATOR variables are used for wercker
485+
// IMAGE_NAME_OPERATOR & IMAGE_TAG_OPERATOR variables are used for shared cluster
480486
if (System.getenv("IMAGE_NAME_OPERATOR") != null
481487
&& System.getenv("IMAGE_TAG_OPERATOR") != null) {
482488
operatorMap.put(

0 commit comments

Comments
 (0)