[Docker] Do not try to delete container on destroyed host
When Environment get deleted both Docker/k8s host and Docker applications get deleted. So it is possible that host will try to delete container from an Instance that was already destroyed. Attempt to send commands to such instance will hang until timeout because there is no more agent exist on the other side. Change-Id: Ia6e8064ae50c24ce595ed08e446ed45b96b4a330 Closes-Bug: #1504623 Depends-On: I298f3f079a153ef87ed7213b7f1432c9e5e4b4b6
This commit is contained in:
parent
4026fd9c9f
commit
0549313491
@ -61,7 +61,6 @@ Methods:
|
||||
|
||||
destroy:
|
||||
Body:
|
||||
- $.host.deploy()
|
||||
- If: $.getAttr(container, null) != null
|
||||
Then:
|
||||
- $container: $.getContainer()
|
||||
|
@ -273,7 +273,7 @@ Methods:
|
||||
- name:
|
||||
Contract: $.string().notNull()
|
||||
Body:
|
||||
- If: $name in $.containers
|
||||
- If: $name in $.containers and $.instance.isDeployed()
|
||||
Then:
|
||||
- $._environment.reporter.report($this, 'Deleting container {0}'.format($name))
|
||||
- $._removeApplicationEndpoints($name)
|
||||
|
@ -63,12 +63,15 @@ Properties:
|
||||
Default: []
|
||||
Usage: Out
|
||||
|
||||
|
||||
Methods:
|
||||
initialize:
|
||||
Body:
|
||||
- $._environment: $.find(std:Environment).require()
|
||||
|
||||
isAvailable:
|
||||
Body:
|
||||
- Return: $.masterNode.isAvailable()
|
||||
|
||||
|
||||
deploy:
|
||||
Body:
|
||||
|
@ -70,3 +70,7 @@ Methods:
|
||||
- $ip: coalesce($.instance.floatingIpAddress, $.getIp())
|
||||
- $._environment.reporter.report($this, $msg.format($ip))
|
||||
|
||||
isAvailable:
|
||||
Body:
|
||||
Return: $.instance.isDeployed()
|
||||
|
||||
|
@ -215,12 +215,14 @@ Methods:
|
||||
- name:
|
||||
Contract: $.string().notNull()
|
||||
Body:
|
||||
- $._loadCurrentPodDefinition()
|
||||
- $._deleteContainer($name)
|
||||
- $.kubernetesCluster.deleteServices(
|
||||
applicationName => $name,
|
||||
podId => $._getPodName())
|
||||
- $.deploy()
|
||||
- If: $.kubernetesCluster.isAvailable()
|
||||
Then:
|
||||
- $._loadCurrentPodDefinition()
|
||||
- $._deleteContainer($name)
|
||||
- $.kubernetesCluster.deleteServices(
|
||||
applicationName => $name,
|
||||
podId => $._getPodName())
|
||||
- $.deploy()
|
||||
|
||||
|
||||
_generateVolumeName:
|
||||
|
Loading…
Reference in New Issue
Block a user