|
1 | 1 | # Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
|
2 | 2 | # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
|
3 | 3 | #
|
4 |
| -# TODO update Description as needed |
5 |
| -# |
6 | 4 | # ------------
|
7 | 5 | # Description:
|
8 | 6 | # ------------
|
9 | 7 | #
|
10 | 8 | # This code reads the configuration in a WL domain's domain home, and generates
|
11 | 9 | # multiple files that are copied to stdout. It also checks whether the domain
|
12 |
| -# configuration is 'valid' (suitable for running in k8s). |
| 10 | +# configuration is 'valid' (suitable for running in k8s). Finally, it |
| 11 | +# populates customer supplied 'configOverrides' templates. |
13 | 12 | #
|
14 | 13 | # This code is used by the operator to introspect and validate an arbitrary
|
15 |
| -# WL domain before its pods are started. It generates topology information that's |
| 14 | +# WL domain before its pods are started. It generates information that's |
16 | 15 | # useful for running the domain, setting up its networking, and for overriding
|
17 | 16 | # specific parts of its configuration so that it can run in k8s.
|
18 | 17 | #
|
19 |
| -# The configuration overrides are specified via situational config file(s), and |
20 |
| -# include listen addresses, log file locations, etc. Additional information |
21 |
| -# is provided in other files -- including encrypted credentials, domain |
22 |
| -# topology (server names, etc), and any validation warnings/errors. |
23 |
| -# |
24 | 18 | # For more details, see the Description in instrospectDomain.sh (which
|
25 | 19 | # calls this script).
|
26 | 20 | #
|
|
38 | 32 | # /weblogic-operator/secrets/username
|
39 | 33 | # /weblogic-operator/secrets/password
|
40 | 34 | #
|
| 35 | +# Optional custom sit cfg 'configOverrides' templates in: |
| 36 | +# /weblogic-operator/config-overrides-secrets |
| 37 | +# |
| 38 | +# Optional custom sit cfg 'configOverridesSecrets' in: |
| 39 | +# /weblogic-operator/config-overrides-secrets/<secret-name>/<key> |
| 40 | +# |
41 | 41 | # The following env vars:
|
42 |
| -# DOMAIN_UID - completely unique id for this domain |
43 |
| -# DOMAIN_HOME - path for the domain configuration |
44 |
| -# LOG_HOME - path to override WebLogic server log locations |
| 42 | +# DOMAIN_UID - completely unique id for this domain |
| 43 | +# DOMAIN_HOME - path for the domain configuration |
| 44 | +# LOG_HOME - path to override WebLogic server log locations |
| 45 | +# ADMIN_SECRET_NAME - name of secret containing admin credentials |
45 | 46 | #
|
46 | 47 | # ---------------------------------
|
47 | 48 | # Outputs (files copied to stdout):
|
|
50 | 51 | # topology.yaml -- Domain configuration summary for operator (server names, etc).
|
51 | 52 | # -and/or-
|
52 | 53 | # Domain validation warnings/errors.
|
53 |
| -# situational-config.xml -- Overrides for domain configuration (listen addresses, etc). |
| 54 | +# |
| 55 | +# Sit-Cfg-CFG--introspector-situational-config.xml |
| 56 | +# -- Automatic sit cfg overrides for domain configuration |
| 57 | +# (listen addresses, etc). |
| 58 | +# |
| 59 | +# Sit-Cfg-* -- Expanded optional configOverrides sit cfg templates |
| 60 | +# |
54 | 61 | # boot.properties -- Encoded credentials for starting WL.
|
55 | 62 | # userConfigNodeManager.secure -- Encoded credentials for starting NM in a WL pod.
|
56 |
| -# userKeyNodeManager.secure' -- Encoded credentials for starting NM in a WL pod. |
| 63 | +# userKeyNodeManager.secure -- Encoded credentials for starting NM in a WL pod. |
57 | 64 | #
|
| 65 | +# |
58 | 66 | # Note:
|
59 | 67 | #
|
60 | 68 | # This code partly depends on a node manager so that we can use it to encrypt
|
61 | 69 | # the username and password and put them into files that can be used to connect
|
62 | 70 | # to the node manager later in the server pods (so that the server pods don't
|
63 | 71 | # have to mount the secret containing the username and password).
|
64 | 72 | #
|
| 73 | +# The configuration overrides are specified via situational config file(s), and |
| 74 | +# include listen addresses, log file locations, etc. Additional information |
| 75 | +# is provided in other files -- including encrypted credentials, domain |
| 76 | +# topology (server names, etc), and any validation warnings/errors. |
| 77 | +# |
65 | 78 |
|
66 | 79 |
|
67 | 80 | import base64
|
@@ -828,7 +841,11 @@ def validateUnresolvedMacros(self, file, filestr):
|
828 | 841 | # assume they're supposed to remain in the final sit-cfg xml).
|
829 | 842 |
|
830 | 843 | errstr = ''
|
831 |
| - for unknown_macro in re.findall('\${[^}]*(:|.)[^}]*}', filestr): |
| 844 | + for unknown_macro in re.findall('\${[^}]*:[^}]*}', filestr): |
| 845 | + if errstr: |
| 846 | + errstr += "," |
| 847 | + errstr += unknown_macro |
| 848 | + for unknown_macro in re.findall('\${[^}]*[.][^}]*}', filestr): |
832 | 849 | if errstr:
|
833 | 850 | errstr += ","
|
834 | 851 | errstr += unknown_macro
|
|
0 commit comments