Skip to content

Commit

Permalink
Merge pull request #143 from SelfhostedPro/develop
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
SelfhostedPro authored Oct 3, 2020
2 parents 7a5efb4 + d14c171 commit 7088754
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions backend/api/actions/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ def check_app_updates():
dclient = docker.from_env()
apps = dclient.containers.list(all=True)
for app in apps:
if check_updates(app.image.tags[0]):
apps_list.append(app.name)
if app.attrs['Config']['Image']:
if check_updates(app.attrs['Config']['Image']):
apps_list.append(app.name)
return apps_list

def get_apps():
Expand Down
6 changes: 5 additions & 1 deletion backend/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .settings import Settings
import aiodocker
import docker
from docker.errors import APIError
import json
settings = Settings()

Expand Down Expand Up @@ -361,7 +362,10 @@ def check_updates(tag):
if tag:
dclient = docker.from_env()
current = dclient.images.get(tag)
new = dclient.images.get_registry_data(tag)
try:
new = dclient.images.get_registry_data(tag)
except APIError as err:
return False
if new.attrs['Descriptor']['digest'] in current.attrs['RepoDigests'][0]:
return False
else:
Expand Down

0 comments on commit 7088754

Please sign in to comment.