Only consider the latest removal request per deployment.
All checks were successful
All checks were successful
This commit is contained in:
parent
5198f2d3cc
commit
27437ba869
@ -161,11 +161,18 @@ def command(ctx, laconic_config, deployment_parent_dir,
|
|||||||
# TODO: should we handle CRNs?
|
# TODO: should we handle CRNs?
|
||||||
removals_by_deployment[r.attributes.deployment] = r
|
removals_by_deployment[r.attributes.deployment] = r
|
||||||
|
|
||||||
requests_to_execute = []
|
one_per_deployment = {}
|
||||||
for r in requests:
|
for r in requests:
|
||||||
if not r.attributes.deployment:
|
if not r.attributes.deployment:
|
||||||
print(f"Skipping removal request {r.id} since it was a cancellation.")
|
print(f"Skipping removal request {r.id} since it was a cancellation.")
|
||||||
elif skip_by_tag(r, include_tags, exclude_tags):
|
elif r.attributes.deployment in one_per_deployment:
|
||||||
|
print(f"Skipping removal request {r.id} since it was superseded.")
|
||||||
|
else:
|
||||||
|
one_per_deployment[r.attributes.deployment] = r
|
||||||
|
|
||||||
|
requests_to_execute = []
|
||||||
|
for r in one_per_deployment.values():
|
||||||
|
if skip_by_tag(r, include_tags, exclude_tags):
|
||||||
print("Skipping removal request %s, filtered by tag (include %s, exclude %s, present %s)" % (r.id,
|
print("Skipping removal request %s, filtered by tag (include %s, exclude %s, present %s)" % (r.id,
|
||||||
include_tags,
|
include_tags,
|
||||||
exclude_tags,
|
exclude_tags,
|
||||||
|
Loading…
Reference in New Issue
Block a user