Conditionally enable apps
Currently the enable flag just takes a straight boolean as to whether the chart is enabled or not. It would be nice to have a conditional option, based on a runtime argument the app will be conditionally enabled or disabled.
There is something that will do such job just fine: env vars in DSF
An example:
---
apps:
my-app:
enabled: $MY_APP_ENABLED
secretsFiles:
- "../values/[...].yaml"
MY_APP_ENABLED=(true|false) helmsman -spec [...]
It's up to you wether it's true or false in the end, so that is the place where you can use your conditions. Sounds enough?
It would be preferable to have something similar to Helm's feature to conditionally enable sub-charts. Linking to a variable in the values.yaml or something similar. Specifically I'm looking for something that would allow us to enable different charts based on environment.
Helm's solution looks like this
apiVersion: v2
name: myapplication
description: A Helm chart for Kubernetes
type: application
dependencies:
- name: apidocs
condition: apidocs.enabled
So I'd be looking for something like this
apps:
my-app:
enabled: myapp.enabled
valuesFiles:
- "../values/[...].yaml"
Though I am aware that the structure of helmsman might make this unfeasible
As Mateusz mentioned, you can use env variables for this. Another alternative, you can use YAML anchors, something like this:
apps:
my-app:
enabled: &myappEnabled true
secretsFiles:
- "../values/[...].yaml"
otherapp:
enabled: *myappEnabled
secretsFiles:
- "../values/[...].yaml"
with way whenever you disable my-app the otherapp will also be disabled.
This issue has been marked stale due to an inactivity.