Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Create pool with custom image broken #1678

Merged
merged 3 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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