Skip to content

Commit

Permalink
fix format config on buildSrc kts srcipt (#3593)
Browse files Browse the repository at this point in the history
  • Loading branch information
BiLuoHen authored Mar 25, 2022
1 parent 8706234 commit d72abac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ public void setFormat(ImageFormat format) {
this.format = format;
}

public void setFormat(String format) {
this.format = ImageFormat.valueOf(format);
}

@Input
@Optional
public List<String> getPorts() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ public void testContainer() {
assertThat(container.getFilesModificationTime()).isEqualTo("some invalid time value");
}

@Test
public void testSetFormat() {
testJibExtension.container(
container -> {
container.setFormat("OCI");
});
ContainerParameters container = testJibExtension.getContainer();
assertThat(container.getFormat()).isSameInstanceAs(ImageFormat.OCI);
}

@Test
public void testContainerizingMode() {
assertThat(testJibExtension.getContainerizingMode()).isEqualTo("exploded");
Expand Down

0 comments on commit d72abac

Please sign in to comment.