Azure / Azure/BatchExplorer

Can not use pool created from custom image

Open
#2,190 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
205
Forks
75
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Templates dialogue is not working if there is a pool created from custom image int the list.
Looks like api is not returning `offerName` for this machine, however it was set when image was created (field is required anyway), and later template cannot choose correct icon for it. Checking for null argument [here] and some default fall back (https://github.com/Azure/BatchExplorer/blob/master/src/app/utils/pool-utils.ts#L86) will help.
I was able to recreate this issue with multiple different images.

**To Reproduce**
Steps to reproduce the behavior:
1. Create pool based on custom vm image (ubuntu 16.04)
2. Go to Gallery
3. Use custom or predefined template for job
4. See error

**Expected behavior**
Some default image in case if there is no machine type in data:
![CaptureOK](https://user-images.githubusercontent.com/5730477/85068415-a47a6080-b1b2-11ea-8679-0e6633e46714.PNG)

**Screenshots**
Messed dialogue:
![CaptureNOK](https://user-images.githubusercontent.com/5730477/85067087-667c3d00-b1b0-11ea-904c-dd7b540ee305.PNG)
Missed `offer` in `imageReference` (pools request):
![json](https://user-images.githubusercontent.com/5730477/85067653-5022b100-b1b1-11ea-9abe-34c645b77c89.PNG)

**Logs(console)**
core.js:6014 ERROR TypeError: Cannot read property 'toLowerCase' of null
at Function.iconForOffer (pool-utils.ts:90)
at Function.iconForPool (pool-utils.ts:109)
at PoolPickerComponent.iconForPool (pool-picker.component.ts:161)
at Object.updateDirectives (pool-picker.html:21)
at Object.updateDirectives (core.js:44779)
at checkAndUpdateView (core.js:44270)
at callViewAction (core.js:44636)
at execEmbeddedViewsAction (core.js:44593)
at checkAndUpdateView (core.js:44271)
at callViewAction (core.js:44636)

**Version:**
- OS: Windows
- Version 2.7.0-stable.418

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.