Skip to content

Commit

Permalink
Update README.md (#46)
Browse files Browse the repository at this point in the history
* Update README.md
* Remove redundant throws (resolves #32)
* Add test of logger text (resolves #31)

Co-authored-by: Karl DeBisschop <[email protected]>
  • Loading branch information
kdebisschop and Karl DeBisschop authored Mar 10, 2020
1 parent 5f2b14b commit e2a8474
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ Configuration:
- Users will need to add those keys to storage in addition to entering them as password
on the configuration page.

Note:

Note that Rancher uses container ID to to construct the URL used to make API requests.
When services are upgraded, new containers are created so the API urls used in the
node operations cannot work anymore. The container does not exist, so the URL will
fail. As long nodes are defined by containers, there is probably no way to avoid this.

The result is that file copies and node executions will not work when performed in the
same execution context after an upgrade because the node set is defined in that job
context. The Rundeck solution to this issue is to do the upgrade then:

1. Run a "Refresh Nodes" workflow step
2. Run the node execute or file copy step as a job reference

Note that refreshing nodes, Rundeck changes the nodes in the global context, but not
the running job. So it is essential that the execution is in a job reference and not
in the same job context.

### Rancher Node Executor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ private JsonNode getToken(boolean attachStdout) throws IOException {
* @throws JsonMappingException When JSON is invalid.
* @throws JsonProcessingException When JSON is invalid.
*/
private String apiData(boolean attachStdout)
throws JsonMappingException, JsonProcessingException {
private String apiData(boolean attachStdout) throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree("{}");
((ObjectNode) root).put("tty", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public void testActivate() throws IOException, NodeStepException {
subject.executeNodeStep(ctx, cfg, node);
verify(client, times(1)).get(any());
verify(client, times(1)).post(any(), eq(""));
verify(logger, times(1)).
log(eq(com.dtolabs.rundeck.core.Constants.INFO_LEVEL), matches("Step activate complete on .*"));
}

@Test
Expand All @@ -121,6 +123,8 @@ public void testDeactivate() throws IOException, NodeStepException {
subject.executeNodeStep(ctx, cfg, node);
verify(client, times(1)).get(any());
verify(client, times(1)).post(any(), eq(""));
verify(logger, times(1)).
log(eq(com.dtolabs.rundeck.core.Constants.INFO_LEVEL), matches("Step deactivate complete on .*"));
}

@Test
Expand All @@ -138,6 +142,8 @@ public void testRestart() throws IOException, NodeStepException {
subject.executeNodeStep(ctx, cfg, node);
verify(client, times(1)).get(any());
verify(client, times(1)).post(any(), eq(""));
verify(logger, times(1)).
log(eq(com.dtolabs.rundeck.core.Constants.INFO_LEVEL), matches("Step restart complete on .*"));
}

@Test(expected = NodeStepException.class)
Expand Down

0 comments on commit e2a8474

Please sign in to comment.