devspace icon indicating copy to clipboard operation
devspace copied to clipboard

runtime variables not available in custom pipeline

Open janrito opened this issue 1 year ago • 2 comments

What happened?
Trying to use an image name in a pipeline

→ devspace run-pipeline test --skip-build
info Using namespace 'tmp'
info Using kube context 'minikube'
image

What did you expect to happen instead?
the runtime variable to hold the image name

→ devspace run-pipeline test --skip-build
info Using namespace 'tmp'
info Using kube context 'minikube'
image registry.com/images/example

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

version: v2beta1
name: tmp

pipelines:
  test:
    run: |-
      echo "image ${runtime.images.example.image}"

images:
  example:
    image: registry.com/images/example
    tags:
      - $(ls | md5)
      - test

Local Environment:

  • DevSpace Version: [use devspace --version] devspace version 6.3.12
  • Operating System: mac
  • ARCH of the OS: ARM64 Kubernetes Cluster:
  • Cloud Provider: minikube
  • Kubernetes Version: [use kubectl version] → kubectl version Client Version: v1.30.0 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.28.3 Anything else we need to know?

janrito avatar Apr 30 '24 12:04 janrito

@janrito The pipeline function get_image is more reliable for this purpose.

Here's a devspace.yaml that worked for me:

version: v2beta1
name: tmp

pipelines:
  test:
    run: |-
      echo "image $(get_image --only image example)"
images:
  example:
    image: registry.com/images/example
    tags:
      - $(ls | md5)
      - test

This page needs to be updated, since the variable only sometimes works in pipelines.

lizardruss avatar May 01 '24 15:05 lizardruss

Thanks! I'll take a look

janrito avatar May 01 '24 15:05 janrito