Skip to content

Commit 066b874

Browse files
author
Matthew Fisher
committed
fix(api): check latest release, not app
An application does not have a build attribute, but its latest release does.
1 parent 333b7a6 commit 066b874

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

rootfs/api/management/commands/load_db_state_to_k8s.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ def handle(self, *args, **options):
2424
# deploy applications
2525
print("Deploying available applications")
2626
for application in App.objects.all():
27-
if application.build is None:
27+
rel = application.release_set.latest()
28+
if rel.build is None:
2829
print('WARNING: {} has no build associated with '
2930
'its latest release. Skipping deployment...'.format(application))
3031
continue
31-
32-
rel = application.release_set.latest()
3332
application.deploy(rel)
3433

3534
print("Done Publishing DB state to kubernetes.")

0 commit comments

Comments
 (0)