Skip to content

Commit 9a8f5ae

Browse files
authored
Merge pull request oracle#835 from oracle/2.0-sit-cfg
Roll-up of situational configuration changes
2 parents 1fb2446 + c84efa1 commit 9a8f5ae

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

operator/src/main/resources/scripts/introspectDomain.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def open(self):
154154
trace("About to load domain from "+self.getDomainHome())
155155
readDomain(self.getDomainHome())
156156
self.domain = cmo
157+
self.DOMAIN_NAME = self.getDomain().getName()
157158

158159
def close(self):
159160
closeDomain()
@@ -786,7 +787,8 @@ def addSitCfgXml(self):
786787
self.writeln("<?xml version='1.0' encoding='UTF-8'?>")
787788
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\">")
788789
self.indent()
789-
self.writeln("<s:expiration> 2020-07-16T19:20+01:00 </s:expiration>")
790+
self.writeln("<s:expiration> 2099-07-16T19:20+01:00 </s:expiration>")
791+
#self.writeln("<d:name>" + self.env.DOMAIN_NAME + "</d:name>")
790792
self.customizeNodeManagerCreds()
791793
self.customizeDomainLogPath()
792794
self.customizeServers()
@@ -908,6 +910,7 @@ def __init__(self, env):
908910
self.macroMap['env:DOMAIN_UID'] = self.env.DOMAIN_UID
909911
self.macroMap['env:DOMAIN_HOME'] = self.env.DOMAIN_HOME
910912
self.macroMap['env:LOG_HOME'] = self.env.LOG_HOME
913+
self.macroMap['env:DOMAIN_NAME'] = self.env.DOMAIN_NAME
911914

912915
keys=self.macroMap.keys()
913916
keys.sort()

site/config-overrides.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ The operator supports embedding macros within override templates. This helps ma
167167

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

170-
* Environment variable macros have the syntax `${env:ENV-VAR-NAME}`, where the supported environment variables include `DOMAIN_HOME`, `LOG_HOME`, and `DOMAIN_UID`.
170+
* 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`.
171171

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

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

206+
**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.**
207+
205208
### Overriding a data source module
206209

207210
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`.
@@ -267,6 +270,8 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
267270
268271
**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.**
269272
273+
**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).**
274+
270275
271276
Example domain resource yaml:
272277
```
@@ -332,6 +337,8 @@ spec:
332337
333338
**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.**
334339
340+
**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).**
341+
335342
---
336343
# Internal design flow
337344

src/integration-tests/introspector/override--config.xmlt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<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">
3+
<name>${env:DOMAIN_NAME}</name>
34
<server>
45
<name>${ADMIN_NAME}</name>
56
<max-message-size f:combine-mode="replace">78787878</max-message-size>

0 commit comments

Comments
 (0)