Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion operator/src/main/resources/scripts/introspectDomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def open(self):
trace("About to load domain from "+self.getDomainHome())
readDomain(self.getDomainHome())
self.domain = cmo
self.DOMAIN_NAME = self.getDomain().getName()

def close(self):
closeDomain()
Expand Down Expand Up @@ -786,7 +787,8 @@ def addSitCfgXml(self):
self.writeln("<?xml version='1.0' encoding='UTF-8'?>")
self.writeln("<d:domain xmlns:d=\"http://xmlns.oracle.com/weblogic/domain\" xmlns:f=\"http://xmlns.oracle.com/weblogic/domain-fragment\" xmlns:s=\"http://xmlns.oracle.com/weblogic/situational-config\">")
self.indent()
self.writeln("<s:expiration> 2020-07-16T19:20+01:00 </s:expiration>")
self.writeln("<s:expiration> 2099-07-16T19:20+01:00 </s:expiration>")
#self.writeln("<d:name>" + self.env.DOMAIN_NAME + "</d:name>")
self.customizeNodeManagerCreds()
self.customizeDomainLogPath()
self.customizeServers()
Expand Down Expand Up @@ -908,6 +910,7 @@ def __init__(self, env):
self.macroMap['env:DOMAIN_UID'] = self.env.DOMAIN_UID
self.macroMap['env:DOMAIN_HOME'] = self.env.DOMAIN_HOME
self.macroMap['env:LOG_HOME'] = self.env.LOG_HOME
self.macroMap['env:DOMAIN_NAME'] = self.env.DOMAIN_NAME

keys=self.macroMap.keys()
keys.sort()
Expand Down
9 changes: 8 additions & 1 deletion site/config-overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ The operator supports embedding macros within override templates. This helps ma

Two types of macros are supported `environment variable macros` and `secret macros`:

* Environment variable macros have the syntax `${env:ENV-VAR-NAME}`, where the supported environment variables include `DOMAIN_HOME`, `LOG_HOME`, and `DOMAIN_UID`.
* Environment variable macros have the syntax `${env:ENV-VAR-NAME}`, where the supported environment variables include `DOMAIN_UID`, `DOMAIN_NAME`, `DOMAIN_HOME`, and `LOG_HOME`.

* Secret macros have the syntax `${secret:SECRETNAME.SECRETKEY}` and `${secret:SECRETNAME.SECRETKEY:encrypt}`.

Expand All @@ -190,6 +190,7 @@ The following `config.xml` override file demonstrates setting the `max-message-s
<domain xmlns="http://xmlns.oracle.com/weblogic/domain"
xmlns:f="http://xmlns.oracle.com/weblogic/domain-fragment"
xmlns:s="http://xmlns.oracle.com/weblogic/situational-config">
<name>${env:DOMAIN_NAME}</name>
<server>
<name>admin-server</name>
<max-message-size f:combine-mode="add">78787878</max-message-size>
Expand All @@ -202,6 +203,8 @@ The following `config.xml` override file demonstrates setting the `max-message-s
</domain>
```

**IMPORTANT: To ensure all situational configuration takes effect, remember to reference the name of each bean in the hierarchy that is overridden, including the domain name as in the sample above.**

### Overriding a data source module

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`.
Expand Down Expand Up @@ -267,6 +270,8 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,

**IMPORTANT: Incorrectly formatted override files are 'somewhat' silently ignored. WebLogic Servers log errors or warnings when they detect an incorrectly formatted configuration override template file, but will still boot, and will skip overriding. So it is important to make sure that the template files are correct in a QA environment by checking your WebLogic pod logs for situational configuration errors and warnings, before attempting to use them in production.**

**IMPORTANT: To ensure all custom overrides takes effect, remember to reference the name of each bean in the hierarchy that is overridden, including the domain name when overriding config.xml fields. Also, remember to use the 'replace' verb to modify existing fields in the domain home configuration, and the 'add' verb to add a field that doesn't yet exist in the domain home configuration. Otherwise, situational configuration may be partially ignored without generating any errors or warnings. See the sample in [Override template samples](#override-template-samples).**


Example domain resource yaml:
```
Expand Down Expand Up @@ -332,6 +337,8 @@ spec:

**IMPORTANT: Incorrectly formatted override files are 'somewhat' silently ignored. WebLogic Servers log errors or warnings when they detect an incorrectly formatted configuration override template file, but will still boot, and will skip overriding. So it is important to make sure that the template files are correct in a QA environment by checking your WebLogic pod logs for situational configuration errors and warnings, before attempting to use them in production.**

**IMPORTANT: To ensure all custom overrides takes effect, remember to reference the name of each bean in the hierarchy that is overridden, including the domain name when overriding config.xml fields. Also, remember to use the 'replace' verb to modify existing fields in the domain home configuration, and the 'add' verb to add a field that doesn't yet exist in the domain home configuration. Otherwise, situational configuration may be partially ignored without generating any errors or warnings. See the sample in [Override template samples](#override-template-samples).**

---
# Internal design flow

Expand Down
1 change: 1 addition & 0 deletions src/integration-tests/introspector/override--config.xmlt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:f="http://xmlns.oracle.com/weblogic/domain-fragment" xmlns:s="http://xmlns.oracle.com/weblogic/situational-config">
<name>${env:DOMAIN_NAME}</name>
<server>
<name>${ADMIN_NAME}</name>
<max-message-size f:combine-mode="replace">78787878</max-message-size>
Expand Down