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

[BUG] Container Instance cannot update due to secure value env #856

Open
3 tasks done
ChenTanyi opened this issue Sep 30, 2019 · 2 comments
Open
3 tasks done

[BUG] Container Instance cannot update due to secure value env #856

ChenTanyi opened this issue Sep 30, 2019 · 2 comments

Comments

@ChenTanyi
Copy link
Contributor

ChenTanyi commented Sep 30, 2019

Describe the bug
This is the service problem. When updating the container instance, if there is secure value in any container environment, it could only be updated successfully for setting a new secure value or deleting the secure environment.

Code Snippet
example:

  • create a container
{
    "name": "nginx",
    "properties": {
        "image": "nginx",
        "ports": [
            {
                "protocol": "TCP",
                "port": 80
            }
        ],
        "environmentVariables": [
            {
                "name": "env",
                "secureValue": "val"
            }
        ],
        "resources": {
            "requests": {
                "memoryInGB": 1.5,
                "cpu": 1.0
            }
        }
    }
}
  • return json
{
    "name": "nginx",
    "properties": {
        "image": "nginx",
        "ports": [
            {
                "protocol": "TCP",
                "port": 80
            }
        ],
        "environmentVariables": [
            {
                "name": "env"
            }
        ],
        "resources": {
            "requests": {
                "memoryInGB": 1.5,
                "cpu": 1.0
            }
        }
    }
}
  • for updating:
    • If I use original return json, it would throw the cloud exception about:
    The environment variable 'env' in container 'nginx' of container group 'cgtest' is invalid. One and only one property of 'value' and 'secureValue' can be specified in an environment variable.
    
    • If I delete the 'environmentVariables' parameter, it would return with empty environment for nginx, but actually I need the environment.
    • Only if I set the secureValue with same value (or a new value), I can update other parameters.

Expected behavior
I can send with the following 'environmentVariables' to update other parameters for container instance.

"environmentVariables": [
    {
        "name": "env"
    }
]

For Example
I send the following json and it could update cpu and memory, while the environments stay same as it would be.

{
    "name": "nginx",
    "properties": {
        "image": "nginx",
        "ports": [
            {
                "protocol": "TCP",
                "port": 80
            }
        ],
        "environmentVariables": [
            {
                "name": "env"
            }
        ],
        "resources": {
            "requests": {
                "memoryInGB": 2.0,
                "cpu": 2.0
            }
        }
    }
}

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@ChenTanyi
Copy link
Contributor Author

Blocking PR :
#766
Azure/azure-libraries-for-net#714

@ChenTanyi
Copy link
Contributor Author

It is said that the issue may be solved in the next api-version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant