Skip to content

Commit 8c7e8a2

Browse files
committed
Don't insert previously negated items Applications.append_if_new()
We add a check in `Applications.append_if_new()` to only insert non-negated items if they aren't already on our internal negation list. This fixes the issue where it wasn't possible to preemptively remove an entry from the applications list in a multi-dimensional hierarchy, e.g. in a [Commodore] global defaults repository where we may want to exclude applications for a certain Kubernetes distribution regardless of the cloud on which a cluster with that distribution is running. [Commodore]: https://syn.tools/commodore
1 parent 80d6d15 commit 8c7e8a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

reclass/datatypes/applications.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def append_if_new(self, item):
4242
self._items.remove(item)
4343
except ValueError:
4444
pass
45-
else:
45+
elif item not in self._negations:
46+
# Only insert non-negated items if they're not in our negations list
47+
# already.
4648
super(Applications, self)._append_if_new(item)
4749

4850
def merge_unique(self, iterable):

0 commit comments

Comments
 (0)