@@ -4789,9 +4789,8 @@ def create_thread_to_notify_user_application_pulled( self, myDesktop:ODDesktop,
4789
4789
if event_received['pulled'] is still False
4790
4790
'''
4791
4791
assert isinstance (event_received , dict ), f"event_received has invalid type { type (event_received )} "
4792
- assert isinstance (myDesktop , ODDesktop ), f"desktop has invalid type { type (myDesktop )} "
4793
- assert isinstance (data , dict ), f"data has invalid type { type (data )} "
4794
- self .logger .debug ( '' )
4792
+ assert isinstance (myDesktop , ODDesktop ), f"desktop has invalid type { type (myDesktop )} "
4793
+ assert isinstance (data , dict ), f"data has invalid type { type (data )} "
4795
4794
notify_thread = threading .Thread (target = self .notify_user_application_pulled , args = [myDesktop , data , event_received ] )
4796
4795
notify_thread .start ()
4797
4796
return notify_thread
@@ -4803,9 +4802,9 @@ def notify_user_application_pulled( self, myDesktop:ODDesktop, data:dict, event_
4803
4802
if event_received['pulled'] is still False
4804
4803
'''
4805
4804
assert isinstance (event_received , dict ), f"event_received has invalid type { type (event_received )} "
4806
- assert isinstance (myDesktop , ODDesktop ), f"desktop has invalid type { type (myDesktop )} "
4807
- assert isinstance (data , dict ), f"data has invalid type { type (data )} "
4808
- self .logger .debug ( '' )
4805
+ assert isinstance (myDesktop , ODDesktop ), f"desktop has invalid type { type (myDesktop )} "
4806
+ assert isinstance (data , dict ), f"data has invalid type { type (data )} "
4807
+ self .logger .debug ('' )
4809
4808
self .logger .debug ( f'event_received={ event_received } before sleep for { oc .od .settings .desktop ['K8S_NOTIFY_USER_APPLICATION_PULLED_DELAY_SECONDS' ]} ' )
4810
4809
time .sleep ( oc .od .settings .desktop ['K8S_NOTIFY_USER_APPLICATION_PULLED_DELAY_SECONDS' ] )
4811
4810
if event_received .get ('pulled' ) is False :
@@ -5155,8 +5154,9 @@ def thread_to_watch_for_end_of_pod_initializing( self, myDesktop:ODDesktop, pod_
5155
5154
self .orchestrator .notify_user ( myDesktop , 'container' , data )
5156
5155
5157
5156
if isinstance (c .state .terminated , V1ContainerStateTerminated ):
5158
- data ['message' ] = c .state .terminated .reason
5159
- self .orchestrator .notify_user ( myDesktop , 'container' , data )
5157
+ if c .state .terminated .reason != 'Completed' :
5158
+ data ['message' ] = c .state .terminated .reason
5159
+ self .orchestrator .notify_user ( myDesktop , 'container' , data )
5160
5160
5161
5161
'''
5162
5162
elif isinstance(c.state.running, V1ContainerStateRunning ):
@@ -5255,22 +5255,22 @@ def thread_to_watch_for_pulling_event( self, myDesktop:ODDesktop, pod_name:str,
5255
5255
# event_object.first_timestamp
5256
5256
# self.orchestrator.notify_user( myDesktop, 'container', data )
5257
5257
self .create_thread_to_notify_user_application_pulled ( myDesktop , data , event_received )
5258
- w .stop ()
5259
5258
continue
5260
-
5259
+
5261
5260
elif event_object .reason == 'Pulled' :
5262
5261
event_received ['pulled' ] = True # for the thread notify_user_application_pulled
5263
5262
if event_received .get ('pulling.notify_user' ) is True :
5264
5263
data ['name' ] = event_object .reason
5265
5264
data ['message' ] = event_object .message
5266
5265
self .orchestrator .notify_user ( myDesktop , 'container' , data )
5266
+ w .stop ()
5267
5267
continue
5268
5268
5269
5269
elif event_object .reason == 'Started' :
5270
5270
# always stop the watch on Started event
5271
5271
w .stop ()
5272
5272
continue
5273
-
5273
+
5274
5274
elif event_object .reason == 'Created' :
5275
5275
pass # nothing to do
5276
5276
0 commit comments