Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
382 stars 1.23k forks source link

"az ml computetarget attach aks" should validate Kubernetes version #515

Open jberezanski-mdg opened 5 years ago

jberezanski-mdg commented 5 years ago

Extension name (the extension in question)

Machine Learning CLI extension version 1.0.10

Description of issue (in as much detail as possible)


The az ml computetarget attach aks will report success even if the Kubernetes version of the provided AKS cluster is outside the supported range. The problem can only be discovered later using e.g. az ml computetarget show:

> az ml computetarget attach aks -n test-aksct -i /subscriptions/e60ce6ff-b000-482a-9db3-1eeb766ac2ff/resourcegroups/test-rg/providers/Microsoft.ContainerService/managedClusters/test-aks -w test-mlsw -g test-rg --verbose
Attaching compute resource...
Resource attach submitted successfully.
To see if your compute target is ready to use, run:
  az ml computetarget show -n test-aksct

> az ml computetarget show -n test-aksct -w test-mlsw -g test-rg --verbose
{
  "location": "eastus",
  "name": "test-aksct",
  "provisioningErrors": [
    {
      "code": "BadRequest",
      "error": {
        "code": "BadRequest",
        "details": [
          {
            "code": "BadRequestFormat",
            "message": "Specified kubernetes version 1.12.4 is not supported. Supported versions are between 1.8 - 1.11 "
          }
        ],
        "message": "The request is invalid",
        "statusCode": 400
      },
      "message": "The request is invalid"
    }
  ],
  "provisioningState": "Failed"
}

The compute target gets attached, but is in an unusable state and needs to be detached manually.

The user experience would be much better if az ml computetarget attach aks validated the Kubernetes version immediately and returned an error, instead of silently creating an unusable compute target.

yonzhan commented 4 years ago

ml