diff --git a/k8s_handle/k8s/resource.py b/k8s_handle/k8s/resource.py index 2d15230..93552e0 100644 --- a/k8s_handle/k8s/resource.py +++ b/k8s_handle/k8s/resource.py @@ -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)