Skip to content

Commit 021c110

Browse files
author
Tom Barnes
committed
Merge branch 'sit-cfg-unit-testing' of https://github.com/oracle/weblogic-kubernetes-operator into sit-cfg-unit-testing
2 parents 64a4ef2 + a771106 commit 021c110

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,28 @@ def generateAndValidate(self):
878878
if not os.path.exists(self.env.CUSTOM_SITCFG_PATH):
879879
return
880880

881+
# We expect the user to include a 'version.txt' file in their situational
882+
# config directory.
883+
#
884+
# That file is expected to contain '2.0'
885+
#
886+
versionPath=os.path.join(self.env.CUSTOM_SITCFG_PATH,"version.txt")
887+
if not os.path.exists(versionPath):
888+
self.env.addError("Error, Required file, '"+versionPath+"', does not exist")
889+
else:
890+
version=self.env.readFile(versionPath).strip()
891+
if not version == "2.0":
892+
# truncate and ellipsify at 75 characters
893+
version = version[:75] + (version[75:] and '...')
894+
self.env.addError("Error, "+versionPath+" does not have the value of"
895+
+ " '2.0'. The current content: '" + version
896+
+ "' is not valid.")
897+
881898
for the_file in os.listdir(self.env.CUSTOM_SITCFG_PATH):
882899

900+
if the_file == "version.txt":
901+
continue
902+
883903
the_file_path = os.path.join(self.env.CUSTOM_SITCFG_PATH, the_file)
884904

885905
if not os.path.isfile(the_file_path):

0 commit comments

Comments
 (0)