@@ -92,7 +92,7 @@ def log(self, message, level=logging.INFO):
9292 This prefixes log messages with an application "tag" that the customized
9393 drycc-logspout will be on the lookout for. When it's seen, the message-- usually
9494 an application event of some sort like releasing or scaling, will be considered
95- as "belonging" to the application instead of the contoller and will be handled
95+ as "belonging" to the application instead of the controller and will be handled
9696 accordingly.
9797 """
9898 logger .log (level , "[{}]: {}" .format (self .uuid , message ))
@@ -131,6 +131,7 @@ def unbind(self, *args, **kwargs):
131131 self ._scheduler .servicecatalog .get_binding (self .app .id , self .name )
132132 self ._scheduler .servicecatalog .delete_binding (self .app .id , self .name )
133133 self .binding = None
134+ self .data = {}
134135 self .save ()
135136 except KubeException as e :
136137 raise ServiceUnavailable ("Could not unbind resource {} for application {}" .format (self .name , self .app_id )) from e # noqa
@@ -175,6 +176,7 @@ def retrieve(self, *args, **kwargs):
175176 self .app .id , self .name ).json ()
176177 self .status = resp_i .get ('status' , {}).\
177178 get ('lastConditionState' )
179+ self .options = resp_i .get ('spec' , {}).get ('parameters' , {})
178180 update_flag = True
179181 except KubeException as e :
180182 logger .info ("retrieve instance info error: {}" .format (e ))
@@ -185,7 +187,6 @@ def retrieve(self, *args, **kwargs):
185187 self .app .id , self .name ).json ()
186188 self .binding = resp_b .get ('status' , {}).\
187189 get ('lastConditionState' )
188- self .options = resp_b .get ('spec' , {}).get ('parameters' , {})
189190 update_flag = True
190191 secret_name = resp_b .get ('spec' , {}).get ('secretName' )
191192 if secret_name :
@@ -197,7 +198,7 @@ def retrieve(self, *args, **kwargs):
197198 logger .info ("retrieve binding info error: {}" .format (e ))
198199 if update_flag is True :
199200 self .save ()
200- if self .status and self .binding :
201+ if self .status == "Ready" and self .binding == "Ready" :
201202 return True
202203 else :
203204 return False
0 commit comments