Skip to content

Commit fba4c8b

Browse files
p-bouchonp-bouchon
andauthored
Add Init Containers to common definitions (#19855)
* add init containers to common definitions * move changes to 06-01 preview * remove repeated container definition * fix allof syntax * fix anonymous container definition * fix lintdiff errors * fix container allof syntax * add more init examples * split baseContainer definition * remove description Co-authored-by: p-bouchon <[email protected]>
1 parent 2b61c76 commit fba4c8b

File tree

6 files changed

+132
-11
lines changed

6 files changed

+132
-11
lines changed

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/CommonDefinitions.json

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
}
3535
}
3636
},
37-
"Container": {
38-
"description": "Container App container definition.",
37+
"BaseContainer": {
38+
"description": "Container App base container definition.",
3939
"type": "object",
4040
"properties": {
4141
"image": {
@@ -74,24 +74,44 @@
7474
"$ref": "#/definitions/ContainerResources",
7575
"description": "Container resource requirements."
7676
},
77-
"probes": {
78-
"description": "List of probes for the container.",
77+
"volumeMounts": {
78+
"description": "Container volume mounts.",
7979
"type": "array",
8080
"items": {
81-
"$ref": "#/definitions/ContainerAppProbe"
81+
"$ref": "#/definitions/VolumeMount"
8282
},
8383
"x-ms-identifiers": [
84-
"type"
84+
"volumeName"
8585
]
86-
},
87-
"volumeMounts": {
88-
"description": "Container volume mounts.",
86+
}
87+
}
88+
},
89+
"InitContainer": {
90+
"description": "Container App init container definition",
91+
"type": "object",
92+
"allOf": [
93+
{
94+
"$ref": "#/definitions/BaseContainer"
95+
}
96+
]
97+
},
98+
"Container": {
99+
"description": "Container App container definition",
100+
"type": "object",
101+
"allOf": [
102+
{
103+
"$ref": "#/definitions/BaseContainer"
104+
}
105+
],
106+
"properties": {
107+
"probes": {
108+
"description": "List of probes for the container.",
89109
"type": "array",
90110
"items": {
91-
"$ref": "#/definitions/VolumeMount"
111+
"$ref": "#/definitions/ContainerAppProbe"
92112
},
93113
"x-ms-identifiers": [
94-
"volumeName"
114+
"type"
95115
]
96116
}
97117
}
@@ -495,6 +515,16 @@
495515
"description": "User friendly suffix that is appended to the revision name",
496516
"type": "string"
497517
},
518+
"initContainers": {
519+
"description": "List of specialized containers that run before app containers.",
520+
"type": "array",
521+
"items": {
522+
"$ref": "#/definitions/InitContainer"
523+
},
524+
"x-ms-identifiers": [
525+
"name"
526+
]
527+
},
498528
"containers": {
499529
"description": "List of container definitions for the Container App.",
500530
"type": "array",

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_CreateOrUpdate.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@
8080
]
8181
}
8282
],
83+
"initContainers": [
84+
{
85+
"image": "repo/testcontainerApp0:v4",
86+
"name": "testinitcontainerApp0",
87+
"resources": {
88+
"cpu": 0.2,
89+
"memory": "100Mi"
90+
},
91+
"command": [
92+
"/bin/sh"
93+
],
94+
"args": [
95+
"-c",
96+
"while true; do echo hello; sleep 10;done"
97+
]
98+
}
99+
],
83100
"scale": {
84101
"minReplicas": 1,
85102
"maxReplicas": 5,
@@ -190,6 +207,23 @@
190207
]
191208
}
192209
],
210+
"initContainers": [
211+
{
212+
"image": "repo/testcontainerApp0:v4",
213+
"name": "testinitcontainerApp0",
214+
"resources": {
215+
"cpu": 0.2,
216+
"memory": "100Mi"
217+
},
218+
"command": [
219+
"/bin/sh"
220+
],
221+
"args": [
222+
"-c",
223+
"while true; do echo hello; sleep 10;done"
224+
]
225+
}
226+
],
193227
"scale": {
194228
"minReplicas": 1,
195229
"maxReplicas": 5,
@@ -272,6 +306,23 @@
272306
]
273307
}
274308
],
309+
"initContainers": [
310+
{
311+
"image": "repo/testcontainerApp0:v4",
312+
"name": "testinitcontainerApp0",
313+
"resources": {
314+
"cpu": 0.2,
315+
"memory": "100Mi"
316+
},
317+
"command": [
318+
"/bin/sh"
319+
],
320+
"args": [
321+
"-c",
322+
"while true; do echo hello; sleep 10;done"
323+
]
324+
}
325+
],
275326
"scale": {
276327
"minReplicas": 1,
277328
"maxReplicas": 5,

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Get.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@
8282
}
8383
}
8484
],
85+
"initContainers": [
86+
{
87+
"image": "repo/testcontainerApp0:v4",
88+
"name": "testinitcontainerApp0",
89+
"resources": {
90+
"cpu": 0.2,
91+
"memory": "100Mi"
92+
}
93+
}
94+
],
8595
"scale": {
8696
"minReplicas": 1,
8797
"maxReplicas": 5,

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListByResourceGroup.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@
8383
}
8484
}
8585
],
86+
"initContainers": [
87+
{
88+
"image": "repo/testcontainerApp0:v4",
89+
"name": "testinitcontainerApp0",
90+
"resources": {
91+
"cpu": 0.2,
92+
"memory": "100Mi"
93+
}
94+
}
95+
],
8696
"scale": {
8797
"minReplicas": 1,
8898
"maxReplicas": 5,

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListBySubscription.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@
8282
}
8383
}
8484
],
85+
"initContainers": [
86+
{
87+
"image": "repo/testcontainerApp0:v4",
88+
"name": "testinitcontainerApp0",
89+
"resources": {
90+
"cpu": 0.2,
91+
"memory": "100Mi"
92+
}
93+
}
94+
],
8595
"scale": {
8696
"minReplicas": 1,
8797
"maxReplicas": 5,

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Patch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@
8383
]
8484
}
8585
],
86+
"initContainers": [
87+
{
88+
"image": "repo/testcontainerApp0:v4",
89+
"name": "testinitcontainerApp0",
90+
"resources": {
91+
"cpu": 0.2,
92+
"memory": "100Mi"
93+
}
94+
}
95+
],
8696
"scale": {
8797
"minReplicas": 1,
8898
"maxReplicas": 5,

0 commit comments

Comments
 (0)