Skip to content

Commit 3755fc8

Browse files
author
Tom Barnes
committed
Update introspectDomain.py comments. Fix reporting of unresolvable macros.
1 parent 56fe161 commit 3755fc8

File tree

2 files changed

+33
-16
lines changed

2 files changed

+33
-16
lines changed

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

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33
#
4-
# TODO update Description as needed
5-
#
64
# ------------
75
# Description:
86
# ------------
97
#
108
# This code reads the configuration in a WL domain's domain home, and generates
119
# 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.
1312
#
1413
# 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
1615
# useful for running the domain, setting up its networking, and for overriding
1716
# specific parts of its configuration so that it can run in k8s.
1817
#
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-
#
2418
# For more details, see the Description in instrospectDomain.sh (which
2519
# calls this script).
2620
#
@@ -38,10 +32,17 @@
3832
# /weblogic-operator/secrets/username
3933
# /weblogic-operator/secrets/password
4034
#
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+
#
4141
# 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
4546
#
4647
# ---------------------------------
4748
# Outputs (files copied to stdout):
@@ -50,18 +51,30 @@
5051
# topology.yaml -- Domain configuration summary for operator (server names, etc).
5152
# -and/or-
5253
# 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+
#
5461
# boot.properties -- Encoded credentials for starting WL.
5562
# 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.
5764
#
65+
#
5866
# Note:
5967
#
6068
# This code partly depends on a node manager so that we can use it to encrypt
6169
# the username and password and put them into files that can be used to connect
6270
# to the node manager later in the server pods (so that the server pods don't
6371
# have to mount the secret containing the username and password).
6472
#
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+
#
6578

6679

6780
import base64
@@ -828,7 +841,11 @@ def validateUnresolvedMacros(self, file, filestr):
828841
# assume they're supposed to remain in the final sit-cfg xml).
829842

830843
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):
832849
if errstr:
833850
errstr += ","
834851
errstr += unknown_macro

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
2+
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

55
#

0 commit comments

Comments
 (0)