Skip to content

Commit

Permalink
Fix: Create pool with custom image broken (#1678)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Oct 4, 2018
1 parent fbed697 commit 71f2bfd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Increase pool quota quick fix not working [\#1667](https://github.com/Azure/BatchExplorer/issues/1667)
* Error on toggle filter button [\#1671](https://github.com/Azure/BatchExplorer/issues/1671)
* Error when copying property which value is not a string(int) [\#1675](https://github.com/Azure/BatchExplorer/issues/1675)
* Can't create a pool with custom images [\#1677](https://github.com/Azure/BatchExplorer/issues/1677)


# 0.18.1
Expand Down
22 changes: 22 additions & 0 deletions app/models/dtos/pool-create/pool-create.dto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,26 @@ describe("PoolCreateDto", () => {
},
} as any);
});

it("set virtualMachineImageId correctly", () => {
const dto = new PoolCreateDto({
id: "centos-73-test",
virtualMachineConfiguration: {
nodeAgentSKUId: "batch.node.centos 7",
imageReference: {
virtualMachineImageId: "/custom-image/001",
},
},
} as any);

expect(dto.toJS()).toEqual({
id: "centos-73-test",
virtualMachineConfiguration: {
nodeAgentSKUId: "batch.node.centos 7",
imageReference: {
virtualMachineImageId: "/custom-image/001",
},
},
} as any);
});
});
1 change: 1 addition & 0 deletions app/models/dtos/virtual-machine-configuration.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export class ImageReferenceDto extends Dto<ImageReferenceDto> {
@DtoAttr() public offer: string;
@DtoAttr() public sku: string;
@DtoAttr() public version: string;
@DtoAttr() public virtualMachineImageId: string;
}

export class WindowsConfigurationDto extends Dto<WindowsConfigurationDto> {
Expand Down
1 change: 1 addition & 0 deletions app/models/forms/create-pool-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export function createPoolToData(output: CreatePoolModel): PoolCreateDto {
if (output.certificateReferences) {
data.certificateReferences = output.certificateReferences;
}

return new PoolCreateDto(data);
}

Expand Down

0 comments on commit 71f2bfd

Please sign in to comment.