codefresh-io / steps

36 stars 90 forks source link

add ability to override default image #709

Open sethpollack opened 1 month ago

sethpollack commented 1 month ago

Add ability to override default image.

Allows users to add extra tooling without needing to build a custom step.

Example use case would be post-rendering

lrochette commented 3 weeks ago

I would write the step simply using a default value aka:

"image": { "type": "string", "description": "Override the default image used for the step", "default": "quay.io/codefreshplugins/cfstep-helm" }

then the step can simply be: main: name: helm image: [[ .Arguments.image ]]:[[ .Arguments.helm_version ]] This is how I wrote all my steps (See https://github.com/codefresh-io/steps/blob/1f3433eb808dd903c79756ff6b1f610a1839b8f4/incubating/service-now/step.yaml#L82 and https://github.com/codefresh-io/steps/blob/1f3433eb808dd903c79756ff6b1f610a1839b8f4/incubating/service-now/step.yaml#L176 for a complete example)

sethpollack commented 3 weeks ago

@lrochette how would you deal with the use_debian_image in that case?

lrochette commented 3 weeks ago

@lrochette how would you deal with the use_debian_image in that case?

I would not, you can simply override the image parameter with your debian image as @vadim-kharin-codefresh mentioned

sethpollack commented 3 weeks ago

Then we cant set a default for the debian image anymore.

cf-training commented 3 weeks ago

Then we cant set a default for the debian image anymore.

No you just pass it as a parameter Other option would be to create your own step