@@ -152,12 +152,18 @@ protected V1ConfigMap computeDomainConfigMap() {
152
152
metadata .setLabels (labels );
153
153
154
154
cm .setMetadata (metadata );
155
+ LOGGER .warning ("xyz- computeDomainConfigMap called, cm.getData() is " + cm .getData ());
155
156
cm .setData (loadScripts ());
157
+ LOGGER .warning ("xyz- computeDomainConfigMap called, cm.getData() after setData().size() is " + cm .getData ().size ());
156
158
157
159
return cm ;
158
160
}
159
-
161
+ Map < String , String > scripts ;
160
162
private synchronized Map <String , String > loadScripts () {
163
+ if (scripts != null ) {
164
+ LOGGER .warning ("xyz- computeDomainConfigMap loadScripts() returning previously loaded scripts" );
165
+ return scripts ;
166
+ }
161
167
URI uri = null ;
162
168
try {
163
169
uri = getClass ().getResource (SCRIPT_LOCATION ).toURI ();
@@ -169,18 +175,19 @@ private synchronized Map<String, String> loadScripts() {
169
175
try {
170
176
if ("jar" .equals (uri .getScheme ())) {
171
177
try (FileSystem fileSystem = FileSystems .newFileSystem (uri , Collections .<String , Object >emptyMap ())) {
172
- return walkScriptsPath (fileSystem .getPath (SCRIPTS ));
178
+ return scripts = walkScriptsPath (fileSystem .getPath (SCRIPTS ));
173
179
}
174
180
} else {
175
- return walkScriptsPath (Paths .get (uri ));
176
- }
177
- } catch (FileSystemAlreadyExistsException ale ) {
178
- LOGGER .warning (MessageKeys .EXCEPTION , new IOException ("xyz-FileSystemAlreadyExistsException uri is " + uri ));
179
- try (FileSystem fileSystem = FileSystems .getFileSystem (uri )) {
180
- return walkScriptsPath (fileSystem .getPath (SCRIPTS ));
181
- } catch (IOException e ) {
182
- throw new RuntimeException (e );
181
+ return scripts = walkScriptsPath (Paths .get (uri ));
183
182
}
183
+ // } catch (FileSystemAlreadyExistsException ale) {
184
+ // LOGGER.warning(MessageKeys.EXCEPTION, new IOException("xyz-FileSystemAlreadyExistsException uri is " + uri));
185
+ // try (FileSystem fileSystem = FileSystems.getFileSystem(uri)) {
186
+ // LOGGER.warning(MessageKeys.EXCEPTION, new IOException("xyz-FileSystem " + fileSystem + ", isOpen()=" + fileSystem.isOpen()));
187
+ // return walkScriptsPath(fileSystem.getPath(SCRIPTS));
188
+ // } catch(IOException e) {
189
+ // throw new RuntimeException(e);
190
+ // }
184
191
} catch (IOException e ) {
185
192
LOGGER .warning (MessageKeys .EXCEPTION , e );
186
193
throw new RuntimeException (e );
0 commit comments