@@ -352,11 +352,10 @@ def cleanup_release(self, namespace, controller):
352352
353353 def _update_application_service (self , namespace , name , app_type , port , routable = False ):
354354 """Update application service with all the various required information"""
355- try :
356- # Fetch service
357- service = self .get_service (namespace , namespace ).json ()
358- old_service = service .copy () # in case anything fails for rollback
355+ service = self .get_service (namespace , namespace ).json ()
356+ old_service = service .copy () # in case anything fails for rollback
359357
358+ try :
360359 # Update service information
361360 if routable :
362361 service ['metadata' ]['labels' ]['router.deis.io/routable' ] = 'true'
@@ -399,37 +398,6 @@ def scale(self, namespace, name, image, command, **kwargs):
399398 self ._scale_rc (namespace , name , old ['spec' ]['replicas' ])
400399 raise
401400
402- def create (self , namespace , ** kwargs ):
403- """Create a basic structure for an application in k8s"""
404- logger .debug ('creating Namespace {} and services' .format (namespace ))
405- try :
406- # Create essential resources
407- try :
408- self .get_namespace (namespace )
409- except KubeException :
410- self .create_namespace (namespace )
411-
412- try :
413- self .get_service (namespace , namespace )
414- except KubeException :
415- self .create_service (namespace , namespace )
416- except KubeException :
417- # Blow it all away only if something horrible happens
418- self .delete_namespace (namespace )
419- raise
420-
421- def destroy (self , namespace ):
422- """Destroy a application by deleting its namespace."""
423- logger .debug ("destroying Namespace {}" .format (namespace ))
424- self .delete_namespace (namespace )
425-
426- # wait 30 seconds for termination
427- for _ in range (30 ):
428- try :
429- self .get_namespace (namespace ).json ()
430- except KubeException :
431- break
432-
433401 def run (self , namespace , name , image , entrypoint , command , ** kwargs ):
434402 """Run a one-off command."""
435403 logger .info ('run {}, img {}, entrypoint {}, cmd "{}"' .format (
0 commit comments