Merge branch 'main' into telackey/cp-recreate
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 36s
Smoke Test / Run basic test suite (pull_request) Successful in 4m25s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m56s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m19s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 8m11s

This commit is contained in:
Thomas E Lackey 2024-08-14 19:33:57 +00:00
commit 5ad89bb518
2 changed files with 33 additions and 24 deletions

View File

@ -277,13 +277,16 @@ def command(ctx, kube_config, laconic_config, image_registry, deployment_parent_
requests_by_name = {} requests_by_name = {}
skipped_by_name = {} skipped_by_name = {}
for r in requests: for r in requests:
status = None
try:
if r.id in previous_requests and previous_requests[r.id].get("status", "") != "RETRY": if r.id in previous_requests and previous_requests[r.id].get("status", "") != "RETRY":
print(f"Skipping request {r.id}, we've already seen it.") print(f"Skipping request {r.id}, we've already seen it.")
continue continue
app = laconic.get_record(r.attributes.application) app = laconic.get_record(r.attributes.application)
if not app: if not app:
print("Skipping request %s, cannot locate app." % r.id) print(f"Skipping request {r.id}, cannot locate app.")
status = "SEEN"
continue continue
requested_name = r.attributes.dns requested_name = r.attributes.dns
@ -305,6 +308,12 @@ def command(ctx, kube_config, laconic_config, image_registry, deployment_parent_
print("Found request %s to run application %s on %s." % (r.id, r.attributes.application, requested_name)) print("Found request %s to run application %s on %s." % (r.id, r.attributes.application, requested_name))
requests_by_name[requested_name] = r requests_by_name[requested_name] = r
except Exception as e:
print(f"ERROR examining request {r.id}: " + str(e))
status = "ERROR"
finally:
if status:
dump_known_requests(state_file, [r], status)
# Find deployments. # Find deployments.
deployments = laconic.app_deployments() deployments = laconic.app_deployments()

View File

@ -172,7 +172,7 @@ class LaconicRegistryClient:
name_or_id, name_or_id,
] ]
parsed = [AttrDict(r) for r in json.loads(logged_cmd(self.log_file, *args))] parsed = [AttrDict(r) for r in json.loads(logged_cmd(self.log_file, *args)) if r]
if len(parsed): if len(parsed):
self._add_to_cache(parsed) self._add_to_cache(parsed)
return parsed[0] return parsed[0]