I have this profile in my v6 devspace.yaml file.
- name: staging-review
parents:
- profile: suspend-cron-jobs
I want to add another parent profile but I only want it to render if a certain devspace variable is true.
I created and tried to conditionally render a profile named ngrok-webhooks-staging-review.
It should render conditionally if NGROK_PROFILE variable is true.
I’m using the activation approach specified in the devspace docs but it just doesn’t seem to work at all https://www.devspace.sh/docs/configuration/profiles/activation. No matter what the variable is set to it always renders ngrok-webhooks-staging-review, even if I just render that profile directly (not through staging-review).
vars:
NGROK_PROFILE:
source: command
command: |-
if [[ "${devspace.namespace}" =~ "staging-review" ]]; then
echo true
else
echo false
fi
- name: ngrok-webhooks-staging-review
activation:
- vars:
NGROK_PROFILE: true
patches:
- op: replace
path: deployments.users.helm.values.rails.webapp.extraContainers
value:
- name: ngrok
image: ngrok/ngrok:latest
env:
- name: NGROK_AUTHTOKEN
value: 123
command:
- "/bin/ngrok"
- "tunnel"
- "http://users"
- "--label=edge=edghts_123"
- "--log=stdout"
- "--log-level=debug"
- name: staging-review
parents:
- profile: suspend-cron-jobs
- profile: ngrok-webhooks-staging-review
I’m running devspace deploy --render --profile=ngrok-webhooks-staging-review cat > "test"
and I still see the ngrok image/cmd/env added in. Or even if I just deploy I can see ngrok spinning up which it shouldn’t be unless devspace.namespace is staging-review.
I know there is nothing wrong with my cmd or image creation, and if I set the var to just something simple activation still doesn’t seem to apply. Am I missing some enable activation setting or something?
Can anyone help me with this?
Rory Clark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.