Config Expressions
Config expressions are a powerful feature to load the devspace.yaml in a more dynamic way. A config expression works by specifying $( my bash expression )
instead of a field and the stdout of the bash expression is taken as value instead.
Load a deployment specification from file:
deployments:
- $(cat deployment.yaml)
Change config based on devspace variables:
deployments:
# Inline if-else
- $( [ ${DEVSPACE_NAMESPACE} == "test" ] && cat deployment.yaml || echo "" )
# Multiline if-else
- |-
$(
if [ ${DEVSPACE_CONTEXT} == "minikube" ]; then
cat minikube.yaml
else
echo ""
fi
)
Generate a complete section
dev: $(./my-script.sh ${DEVSPACE_NAMESPACE} ${DEVSPACE_CONTEXT} ${DEVSPACE_PROFILE})
Return JSON
images:
test:
image: my-image/image
build: '$( echo {"disabled": true} )'
Other Changes
- You can now use
image(default)
andtag(default)
in hook commands and args:
images:
test:
image: test/test
hooks:
- command: |-
./custom-script image(test):tag(test) # -> Transformed to ./custom-script test/test:#####
when:
after:
images: all
- New flag
--image-selector
for commandsdevspace enter
,devspace logs
&devspace attach
- Fixed an issue where
pathType
was not automatically set for newer ingress versions - Fixed an issue where namespace and context were wrong in UI commands
- Fixed an issue where replacing pods with the same image selector across different
devspace.yaml
would target the same pods (#1633)