diff --git a/operator/src/main/resources/scripts/introspectDomain.py b/operator/src/main/resources/scripts/introspectDomain.py index 932eb88d71c..0a51929de82 100644 --- a/operator/src/main/resources/scripts/introspectDomain.py +++ b/operator/src/main/resources/scripts/introspectDomain.py @@ -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() @@ -786,7 +787,8 @@ def addSitCfgXml(self): self.writeln("") self.writeln("") self.indent() - self.writeln(" 2020-07-16T19:20+01:00 ") + self.writeln(" 2099-07-16T19:20+01:00 ") + #self.writeln("" + self.env.DOMAIN_NAME + "") self.customizeNodeManagerCreds() self.customizeDomainLogPath() self.customizeServers() @@ -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() diff --git a/site/config-overrides.md b/site/config-overrides.md index 1d25e8e8da9..e5220487255 100644 --- a/site/config-overrides.md +++ b/site/config-overrides.md @@ -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}`. @@ -190,6 +190,7 @@ The following `config.xml` override file demonstrates setting the `max-message-s + ${env:DOMAIN_NAME} admin-server 78787878 @@ -202,6 +203,8 @@ The following `config.xml` override file demonstrates setting the `max-message-s ``` +**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`. @@ -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: ``` @@ -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 diff --git a/src/integration-tests/introspector/override--config.xmlt b/src/integration-tests/introspector/override--config.xmlt index 0c81a906bab..7646b0aa1ac 100644 --- a/src/integration-tests/introspector/override--config.xmlt +++ b/src/integration-tests/introspector/override--config.xmlt @@ -1,5 +1,6 @@ + ${env:DOMAIN_NAME} ${ADMIN_NAME} 78787878