Skip to content

Commit

Permalink
fix: handle missing deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiga1993 committed Jan 25, 2024
1 parent 96391c1 commit 33e924e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion octoploy/config/DeploymentActionConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ def __init__(self, app_config: AppConfig, data):
def run(self, k8s: K8sApi):
namespace = self._app_config.get_root().get_namespace_name()
if self._data == 'deploy':
k8s.rollout(self._app_config.get_name(), namespace=namespace)
deployment_name = self._app_config.get_name()
try:
k8s.rollout(deployment_name, namespace=namespace)
except Exception as e:
if '(NotFound)' in str(e):
self.log.warning(f'Could not restart {deployment_name} because it does not exist')
return
return

exec_config = self._data.get('exec', None)
Expand Down

0 comments on commit 33e924e

Please sign in to comment.