Fixes replication controller deletion

KubernetesCluster method to delete RC was using incorrect
property and there was a typo in execution plan making it
fail on validation

Also renames destroy* methods to delete* methods to match
Kubernetes terms

Change-Id: I2ff71679deeb5ad3692fcc1a5fcfed8fa0e8d94f
Closes-Bug: #1443857
This commit is contained in:
Stan Lagun 2015-04-15 03:02:09 +03:00
parent fc827e50b2
commit e9a04c4db0
7 changed files with 34 additions and 34 deletions

View File

@ -148,15 +148,15 @@ Methods:
- $.masterNode.instance.agent.call($template, $resources)
destroyReplicationController:
deleteReplicationController:
Arguments:
- id:
Contract: $.string().notNull()
Body:
- $.deploy()
- $resources: new(sys:Resources)
- $template: $resources.yaml('DestroyReplicationController.template').bind(dict(rcId => $id))
- $.kubernetesCluster.masterNode.instance.agent.call($template, $resources)
- $template: $resources.yaml('DeleteReplicationController.template').bind(dict(rcId => $id))
- $.masterNode.instance.agent.call($template, $resources)
createServices:
@ -257,7 +257,7 @@ Methods:
Do:
- If: not $service in $servicesUsed
Then:
- $._destroyService($service)
- $._deleteService($service)
- $._environment.stack.push()
@ -349,26 +349,26 @@ Methods:
- $.setAttr(lastGatewayCount, $.gatewayCount)
_destroyService:
_deleteService:
Arguments:
serviceName:
Contract: $.string().notNull()
Body:
- $resources: new(sys:Resources)
- $template: $resources.yaml('DestroyService.template').bind(dict(
- $template: $resources.yaml('DeleteService.template').bind(dict(
serviceId => $service
))
- $.masterNode.instance.agent.call($template, $resources)
destroyService:
deleteService:
Arguments:
- applicationName:
Contract: $.string().notNull()
- podId:
Contract: $.string().notNull()
Body:
- $._destroyService($applicationName, $podId)
- $._deleteService($applicationName, $podId)
_findUnusedPort:

View File

@ -0,0 +1,20 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Delete Replication Controller
Parameters:
rcId: $rcId
Body: |
return deleteReplicationController(args.rcId).stdout
Scripts:
deleteReplicationController:
Type: Application
Version: 1.0.0
EntryPoint: deleteReplicationController.sh
Files: []
Options:
captureStdout: true
captureStderr: true

View File

@ -1,18 +1,18 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Destroy Service
Name: Delete Service
Parameters:
serviceId: $serviceId
Body: |
return destroyService('{0}'.format(args.serviceId)).stdout
return deleteService('{0}'.format(args.serviceId)).stdout
Scripts:
destroyService:
deleteService:
Type: Application
Version: 1.0.0
EntryPoint: destroyService.sh
EntryPoint: deleteService.sh
Files: []
Options:
captureStdout: true

View File

@ -1,20 +0,0 @@
FormattVersion: 2.0.0
Version: 1.0.0
Name: Destroy Replication Controller
Parameters:
rcId: $rcId
Body: |
return destroyReplicationController(args.rcId).stdout
Scripts:
destroyReplicationController:
Type: Application
Version: 1.0.0
EntryPoint: destroyReplicationController.sh
Files: []
Options:
captureStdout: true
captureStderr: true

View File

@ -158,7 +158,7 @@ Methods:
Contract: $.string().notNull()
Body:
- $._deleteContainer($name)
- $.kubernetesCluster.destroyService(
- $.kubernetesCluster.deleteService(
applicationName => $name,
podId => $._getPodName())
- $.deploy()
@ -195,7 +195,7 @@ Methods:
definition => $rcDefinition, isNew => $prevReplicas = 0)
- If: $.replicas = 0 and $prevReplicas > 0
Then:
- $.kubernetesCluster.destroyReplicationController($._getReplicationControllerId())
- $.kubernetesCluster.deleteReplicationController($._getReplicationControllerId())
- $.setAttr(lastReplicas, $.replicas)
- $._environment.reporter.report($, 'Pod {0} is ready'.format($.name))