Azure-cli: az container create - support decimal values for CPU

Created on 5 Dec 2018  路  3Comments  路  Source: Azure/azure-cli

Describe the bug
Azure Container Instances supports decimal values for the CPU resource allocation and also allows a value less than 1. This works when deploying via ARM template or YAML file. When using the CLI and supplying the --cpu switch it incorrectly expects the value to be an integer. e.g.

az container create: error: argument --cpu: invalid int value: '1.5'

To Reproduce
Run az container create -g myGroup -n demofoo --image microsoft/aci-helloworld --cpu 0.5

Expected behavior
Container group is deployed with fractional CPU allocation

Environment summary
Installed CLI via MSI and also apt-get
Problem occurs on both PowerShell and WSL bash
CLI version azure-cli (2.0.51)

Additional context
This is the offending line of code, changing it to type=float would solve this
https://github.com/Azure/azure-cli/blob/810bebab6a886d17a2cf4d59db048eb62b389ffb/src/command_modules/azure-cli-container/azure/cli/command_modules/container/_params.py#L67

question

Most helpful comment

Just made the fix. Should be merged soon.

All 3 comments

Nearly 6 weeks and not even a comment?

@samkreter for comment.

Just made the fix. Should be merged soon.

Was this page helpful?
0 / 5 - 0 ratings