Skip to content

Commit

Permalink
Redeploy apps if they are consuming outdated certs
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Jul 17, 2024
1 parent b5b082d commit ce35c93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/middlewared/middlewared/plugins/apps/cert_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ async def get_apps_consuming_outdated_certs(self, filters=None):
):
apps_having_outdated_certs.append(app_name)

return apps
return apps_having_outdated_certs

async def redeploy_apps_consuming_outdated_certs(self):
return await self.middleware.call(
'core.bulk', 'app.redeploy', [[r] for r in await self.get_apps_consuming_outdated_certs()]
)


async def setup(middleware):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ async def start_service(self):
except Exception as e:
await self.set_status(Status.FAILED.value, str(e))
raise
else:
await self.middleware.call('app.certificate.redeploy_apps_consuming_outdated_certs')

@private
async def set_status(self, new_status, extra=None):
Expand Down

0 comments on commit ce35c93

Please sign in to comment.