Azure / Azure/azure-libraries-for-java

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

Ouverte
#856 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Container Instances Service Attention
Langage dominant
Java
Étoiles
97
Forks
102
Métriques de merge des PR
Aucune PR mergée en 30 j

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
```json
{
"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
```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.
```json
"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.
```json
{
"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
- [x] Bug Description Added
- [x] Repro Steps Added
- [x] Setup information Added

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par reproduire la mise à jour du conteneur avec le JSON de l’issue, y compris une variable d’environnement sécurisée et une valeur de CPU ou de mémoire modifiée. Suivez le chemin de mise à jour de l’instance de conteneur Java et sa gestion des variables d’environnement ; le travail est terminé lorsqu’un secureValue omis conserve l’environnement existant tandis que les autres paramètres sont mis à jour avec succès.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
azure, java
Domaine
cloud
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.