@@ -1148,7 +1148,7 @@ ComponentSettings:
1148
1148
Expect (err ).ToNot (HaveOccurred ())
1149
1149
})
1150
1150
1151
- When ("modifying memoryLimit for container in Devfile" , func () {
1151
+ When ("modifying name for container in Devfile" , func () {
1152
1152
var stdout string
1153
1153
var stderr string
1154
1154
BeforeEach (func () {
@@ -1171,8 +1171,8 @@ ComponentSettings:
1171
1171
stdout = string (stdoutBytes )
1172
1172
stderr = string (stderrBytes )
1173
1173
}()
1174
- src := "memoryLimit: 1024Mi "
1175
- dst := "memoryLimit: 1023Mi "
1174
+ src := "runtime "
1175
+ dst := "other "
1176
1176
helper .ReplaceString ("devfile.yaml" , src , dst )
1177
1177
if manual {
1178
1178
devSession .PressKey ('p' )
@@ -1181,45 +1181,38 @@ ComponentSettings:
1181
1181
})
1182
1182
1183
1183
It (fmt .Sprintf ("should react on the Devfile modification (podman=%v, manual=%v, customPortForwarding=%v, customAddress=%v)" , podman , manual , customPortForwarding , customAddress ), func () {
1184
- if podman {
1185
- By ("warning users that odo dev needs to be restarted" , func () {
1186
- Expect (stdout ).To (ContainSubstring (
1187
- "Detected changes in the Devfile, but this is not supported yet on Podman. Please restart 'odo dev' for such changes to be applied." ))
1188
- })
1189
- } else {
1190
- By ("not warning users that odo dev needs to be restarted" , func () {
1191
- warning := "Please restart 'odo dev'"
1192
- Expect (stdout ).ShouldNot (ContainSubstring (warning ))
1193
- Expect (stderr ).ShouldNot (ContainSubstring (warning ))
1194
- })
1195
- By ("updating the pod" , func () {
1196
- podName := commonVar .CliRunner .GetRunningPodNameByComponent (cmpName , commonVar .Project )
1197
- bufferOutput := commonVar .CliRunner .Run ("get" , "pods" , podName , "-o" , "jsonpath='{.spec.containers[0].resources.requests.memory}'" ).Out .Contents ()
1198
- output := string (bufferOutput )
1199
- Expect (output ).To (ContainSubstring ("1023Mi" ))
1200
- })
1184
+ By ("not warning users that odo dev needs to be restarted" , func () {
1185
+ warning := "Please restart 'odo dev'"
1186
+ Expect (stdout ).ShouldNot (ContainSubstring (warning ))
1187
+ Expect (stderr ).ShouldNot (ContainSubstring (warning ))
1188
+ })
1189
+ By ("updating the pod" , func () {
1190
+ component := helper .NewComponent (cmpName , "app" , labels .ComponentDevMode , commonVar .Project , commonVar .CliRunner )
1191
+ podDef := component .GetPodDef ()
1192
+ containerName := podDef .Spec .Containers [0 ].Name
1193
+ Expect (containerName ).To (ContainSubstring ("other" ))
1194
+ })
1201
1195
1202
- By ("exposing the endpoint" , func () {
1203
- Eventually (func (g Gomega ) {
1204
- url := fmt .Sprintf ("http://%s" , ports [containerPort ])
1205
- if customPortForwarding {
1206
- Expect (url ).To (ContainSubstring (strconv .Itoa (localPort )))
1207
- }
1208
- if customAddress {
1209
- Expect (url ).To (ContainSubstring (localAddress ))
1210
- }
1211
- resp , err := http .Get (url )
1212
- g .Expect (err ).ToNot (HaveOccurred ())
1213
- defer resp .Body .Close ()
1214
-
1215
- body , _ := io .ReadAll (resp .Body )
1216
- for _ , i := range []string {"Hello from Node.js Starter Application!" } {
1217
- g .Expect (string (body )).To (ContainSubstring (i ))
1218
- }
1219
- g .Expect (err ).ToNot (HaveOccurred ())
1220
- }).WithPolling (1 * time .Second ).WithTimeout (20 * time .Second ).Should (Succeed ())
1221
- })
1222
- }
1196
+ By ("exposing the endpoint" , func () {
1197
+ Eventually (func (g Gomega ) {
1198
+ url := fmt .Sprintf ("http://%s" , ports [containerPort ])
1199
+ if customPortForwarding {
1200
+ Expect (url ).To (ContainSubstring (strconv .Itoa (localPort )))
1201
+ }
1202
+ if customAddress {
1203
+ Expect (url ).To (ContainSubstring (localAddress ))
1204
+ }
1205
+ resp , err := http .Get (url )
1206
+ g .Expect (err ).ToNot (HaveOccurred ())
1207
+ defer resp .Body .Close ()
1208
+
1209
+ body , _ := io .ReadAll (resp .Body )
1210
+ for _ , i := range []string {"Hello from Node.js Starter Application!" } {
1211
+ g .Expect (string (body )).To (ContainSubstring (i ))
1212
+ }
1213
+ g .Expect (err ).ToNot (HaveOccurred ())
1214
+ }).WithPolling (1 * time .Second ).WithTimeout (20 * time .Second ).Should (Succeed ())
1215
+ })
1223
1216
})
1224
1217
})
1225
1218
})
@@ -1327,9 +1320,6 @@ ComponentSettings:
1327
1320
1328
1321
By ("not warning users that odo dev needs to be restarted because the Devfile has not changed" , func () {
1329
1322
warning := "Please restart 'odo dev'"
1330
- if podman {
1331
- warning = "Detected changes in the Devfile, but this is not supported yet on Podman. Please restart 'odo dev' for such changes to be applied."
1332
- }
1333
1323
Expect (stdout ).ShouldNot (ContainSubstring (warning ))
1334
1324
Expect (stderr ).ShouldNot (ContainSubstring (warning ))
1335
1325
})
0 commit comments