[
https://issues.apache.org/jira/browse/KNOX-2301?focusedWorklogId=407831&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407831
]
ASF GitHub Bot logged work on KNOX-2301:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Mar/20 10:38
Start Date: 23/Mar/20 10:38
Worklog Time Spent: 10m
Work Description: smolnar82 commented on pull request #297: KNOX-2301 and
KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r396352071
##########
File path:
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorHandler.java
##########
@@ -571,13 +579,49 @@ private static File
resolveProviderConfigurationReference(final String reference
if (topologyFilename == null) {
topologyFilename = desc.getCluster();
}
+
topologyDescriptor = new File(destDirectory, topologyFilename +
".xml");
- try (OutputStream outputStream =
Files.newOutputStream(topologyDescriptor.toPath());
- OutputStreamWriter outputStreamWriter = new
OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
- BufferedWriter fw = new BufferedWriter(outputStreamWriter)) {
- fw.write(sw.toString());
- fw.flush();
+ // KNOX-2302
+ boolean persistGenerated = false;
+ // Determine if the topology already exists.
+ if (topologyDescriptor.exists()) {
Review comment:
I'd move this new logic to its own private method with a meaningful name
(e.g. `shouldRedeployTopology`) to make the code cleaner.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 407831)
Time Spent: 2h 50m (was: 2h 40m)
> Trigger discovery for descriptors at gateway start time
> -------------------------------------------------------
>
> Key: KNOX-2301
> URL: https://issues.apache.org/jira/browse/KNOX-2301
> Project: Apache Knox
> Issue Type: Improvement
> Components: Server
> Affects Versions: 1.4.0
> Reporter: Philip Zampino
> Assignee: Philip Zampino
> Priority: Major
> Time Spent: 2h 50m
> Remaining Estimate: 0h
>
> Discovery and topology generation is triggered only by changes to provider
> configuration or descriptor files on disk. Knox should also perform discovery
> for all existing descriptors (that include discovery config) when the gateway
> is started.
> This will help ensure that the generated topologies are accurate reflections
> of the proxied services' configurations.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)