Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed Nov 14, 2023
1 parent c1012da commit a1c6a38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,8 @@ protected static void dumpPodLogs(String podName, String namespace, String fileP
final File outputFile =
new File(
TEST_LOGS_DIR,
"%s.%s.%s.%s.log".formatted(filePrefix, namespace, podName, container));
"%s.%s.%s.%s.log"
.formatted(filePrefix, namespace, podName, container));
try (FileWriter writer = new FileWriter(outputFile)) {
writer.write(logs);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,24 @@ void testBlockDeployWhileDeleting() {
store.delete(tenant, "myapp", false);
applicationCustomResource = k3s.getClient().resource(applicationCustomResource).get();
assertFalse(applicationCustomResource.isMarkedForDeletion());
assertTrue(ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.isMarkedForDeletion());
assertEquals(ApplicationSpecOptions.DeleteMode.CLEANUP_REQUIRED, ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.getDeleteMode());
assertTrue(
ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.isMarkedForDeletion());
assertEquals(
ApplicationSpecOptions.DeleteMode.CLEANUP_REQUIRED,
ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.getDeleteMode());

store.delete(tenant, "myapp", true);
applicationCustomResource = k3s.getClient().resource(applicationCustomResource).get();
assertFalse(applicationCustomResource.isMarkedForDeletion());
assertTrue(ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.isMarkedForDeletion());
assertEquals(ApplicationSpecOptions.DeleteMode.CLEANUP_BEST_EFFORT, ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.getDeleteMode());

assertTrue(
ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.isMarkedForDeletion());
assertEquals(
ApplicationSpecOptions.DeleteMode.CLEANUP_BEST_EFFORT,
ApplicationSpec.deserializeOptions(applicationCustomResource.getSpec().getOptions())
.getDeleteMode());

try {
store.put(tenant, "myapp", app, "code-1", null);
Expand Down

0 comments on commit a1c6a38

Please sign in to comment.