Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
image sanitizer failing job creation on unknown errors (#1230)
Browse files Browse the repository at this point in the history
Job Image sanitizer fix
  • Loading branch information
amit-git authored Mar 11, 2022
1 parent 1939e3a commit 1361c6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ public void testSuppressedInternalError() {
.verifyComplete();
}

@Test
public void testRegistryRuntimeError() {
when(registryClient.getImageDigest(anyString(), anyString()))
.thenReturn(Mono.error(new RuntimeException("Unable to reach the registry")));

StepVerifier.create(sanitizer.sanitizeAndApply(jobDescriptorWithTag))
.expectError(IllegalArgumentException.class)
.verify();
}

@Test
public void testJobWithDigestExists() {
Image image = jobDescriptorWithDigest.getContainer().getImage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ private boolean isAllowedException(Throwable throwable, Image image) {
imageResource,
throwable.getClass().getSimpleName()
);
return true;
// unknown errors should prevent job creation
return false;
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 1361c6b

Please sign in to comment.