Comments (8)
I'm not sure if there's anything special about the applications
array. We could also call it components
for example:
classes:
- cloud.cloudscale
components:
- csi-cloudscale
parameters:
csi_cloudscale:
some: value
from commodore.
There's also some interesting (buggy?) behavior with regard to reclass's documented feature of prefixing entries in applications with a ~
: due to the way the recursive processing of the applications field is managed, dropping entries doesn't always work.
For example, with the following snippets, the final value of applications
for targets/test.yml
is ["argocd", "resource-locker", "steward", "storageclass"]
.
# targets/test.yml
classes:
- global.kubernetes
- tenant.cluster
# global/kubernetes.yml
applications:
- argocd
- resource-locker
- steward
- storageclass
# tenant/cluster.yml
applications:
- ~storageclass
I've spent a good amount of time investigating this issue in reclass, and have found the cause in https://github.com/projectsyn/reclass/blob/2585bfc620ddd8c2cd7d159c4eb6d117a526a819/reclass/core.py#L148-L159, where the calls to _recurse_entity
while processing the entries in classes
are passed merge_base=None
, which has the effect that the applications
field is processed in isolation for each class included in the same file (class or target). Since entries prefixed with ~
in applications are not preserved across calls, but immediately resolved during the calls to merge_base.merge()
, we get the behavior outlined above.
The fix appears to be to change the linked snippet to the version present in https://github.com/projectsyn/reclass/tree/fix/application-removal. Note that this change needs kapicorp/reclass#4 to be merged to work correctly.
from commodore.
Reclass also has the concept of aplications (basically a list of strings?). Maybe we can use this to specify the components to include in the hierarchy? (To prevent creating these empty class files).
This would require a refactoring of the whole inventory and moving the components.$component_name
includes to the applications:
array.
This could also allow the removal of components further "down" the hierarchy by using the ~
prefix in the applications
array (xref #71 ).
from commodore.
Thanks for the hint about applications, I'll have a look at those as well. Looks like that approach might work for component includes in the hierarchy.
from commodore.
Basically the idea boils down to having a separate data structure to define components which should be included (instead of using classes:
directly) and having Commodore generate the appropriate class includes for each component.
from commodore.
I'm not sure if there's anything special about the
applications
array. We could also call itcomponents
for example:
Turns out it needs to be called applications
for the reclass magic to work, cf. https://github.com/kapicorp/reclass/blob/1869c478624b37d3479d6c4ea4769dc9ec41fadd/reclass/core.py#L253-L284
edit: hm, no maybe not, having a closer look.
from commodore.
I also did a quick test with components
but this (obviously in hindsight) doesn't work since only things in classes
, applications
and parameters
are merged together (the rest is dropped).
from commodore.
Implemented in #227.
from commodore.
Related Issues (20)
- Allow users to specify different versions for different instances of the same component
- Sign commits with GPG in Docker image HOT 3
- --local is not useful if new components are added to the catalog HOT 1
- Catalog compile quietly overwrites local changes HOT 1
- Sort the output of 'commodore catalog list' HOT 1
- Refactor classes `Component` and `Package` to have a shared base class
- Add option to filter dependency list for `component sync` and `package sync`
- Improve handling of secondary rate-limits in `sync_dependencies()` HOT 3
- Support rendering preview of template changes in a feature branch for `component update` / `package update`
- `commodore component update` commits files in gitignore HOT 1
- kube-libsonnet is using soon deprecated API versions HOT 4
- Commodore's template sync creates PRs even if there's no actual changes
- YAML generated by Commodore postprocess filters uses non-standard formatting
- `commodore inventory lint` crashes on YAML documents which contain top-level `parameters` key which isn't a dict
- Report template changes in sync PRs
- Add support for explicit component dependencies
- Make Poetry version in Dockerfile renovatable
- Required dependency libmagic not present on macOS HOT 2
- Address new bandit lints B113, B603, B607 HOT 1
- Compilation fails when using an empty string as key HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commodore.