Skip to content

Commit

Permalink
I-74 fix_pvc_diff_result (#75)
Browse files Browse the repository at this point in the history
* I-74 fix_pvc_diff_result
  • Loading branch information
dekhtyarev authored Jan 14, 2019
1 parent 12f9d5b commit dec5c73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion k8s_handle/k8s/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,15 @@ def _deploy(self, template_body, file_path):

if template_body['kind'] == 'PersistentVolumeClaim':
resource = kube_client.get()
self._is_pvc_specs_equals(resource.spec, template_body['spec'])
if self._is_pvc_specs_equals(resource.spec, template_body['spec']):
log.info('PersistentVolumeClaim is not changed')
return

if template_body['kind'] == 'PersistentVolume':
resource = kube_client.get()
if resource.status.phase in ['Bound', 'Released']:
log.warning('PersistentVolume has "{}" status, skip replacing'.format(resource.status.phase))
return

kube_client.replace(apply_ports)

Expand Down

0 comments on commit dec5c73

Please sign in to comment.