Azure / Azure/azure-libraries-for-java
[BUG] Container Instance cannot update due to secure value env
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 97
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the container update with the JSON in the issue, including a secure environment variable and changed CPU or memory. Trace the Java container instance update path and its handling of environment variables; done means an omitted secureValue preserves the existing environment while other parameters update successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, java
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100