Open srueg opened 4 years ago
With #195, is this still relevant? At least it should be reworded to account for that change.
It's still the same problem, yes. I think it already is worded properly, with references to #93 ?
There's no easy way to actually implement this sanely in a generic fashion. Internally, we've implemented selected combinations of AND-combinations of facts as documented in https://kb.vshn.ch/vshnsyn/how-tos/create-missing-cloud-dist.html#_make_a_distribution_cloud_aware
Context
Currently it's possible to include classes based on facts (currently hard-coded, dynamically with #93). This only allows for OR-combinations of facts though: For example I can only have a class which applies for all Rancher clusters and one for all cloudscale.ch clusters. But not a class which applies to clusters of type Rancher AND cloudscale.ch.
Possible Solution
Enable the ignore class not found feature we already use during component discovery (#138) also during catalog rendering. With this we could include all possible combinations of facts, regardless if the actual class exists or not. For example, with #93 implemented:
This approach would allow to also configure this aspect of the hierarchy. The downside is that we might run into issues with classes which should exist but are ignored (e.g. typos,
yml
vsyaml
, etc.).Alternative
Implement a feature in Commodore to remove classes which don't exist. This should only auto-remove classes which are allowed to be missing, for example such combination classes.
This approach would still allow to configure the hierarchy as implemented in #93 and additionally skip missing classes. The exact rule which classes are allowed to be missing needs careful thought.