@@ -336,14 +336,21 @@ def __init__(self):
336336 session .verify = False
337337 self .session = session
338338
339- def deploy (self , namespace , name , image , command , ** kwargs ):
339+ def deploy (self , namespace , name , image , command , ** kwargs ): # noqa
340340 logger .debug ('deploy {}, img {}, params {}, cmd "{}"' .format (name , image , kwargs , command ))
341341 app_type = kwargs .get ('app_type' )
342342 routable = kwargs .get ('routable' , False )
343343
344344 # Fetch old RC and create the new one for a release
345345 old_rc = self ._get_old_rc (namespace , app_type )
346- new_rc = self ._create_rc (namespace , name , image , command , ** kwargs )
346+
347+ # If an RC already exists then stop processing of the deploy
348+ try :
349+ self ._get_rc (namespace , name )
350+ logger .debug ('RC {} already exists under Namespace {}. Stopping deploy' .format (name , namespace )) # noqa
351+ return
352+ except KubeHTTPException :
353+ new_rc = self ._create_rc (namespace , name , image , command , ** kwargs )
347354
348355 # Get the desired number to scale to
349356 if old_rc :
0 commit comments