skaffold
skaffold copied to clipboard
Skaffold image filter with -build-image does not work properly with requires.
Expected behavior
skaffold build -p test -b IMAGE2
should build IMAGE2 along with IMAGE1 as dependency
Actual behavior
Here is a sample skaffold in which, I only want to build IMAGE2, thus I use
skaffold build -p test -b IMAGE2
but since image2 is dependent on image 1 this filter stops build 2 as well since it cannot find build 1 throwing an error
FATA[0034] failed to resolve build result for required artifact "IMAGE1" subtask=-1 task=DevLoop
Information
- Skaffold version: v1.35.6
- Operating system: MacOS Contents of ~/.skaffold/config:
apiVersion: skaffold/v2beta26
kind: Config
profiles:
- name: test
build:
tagPolicy:
envTemplate:
template: latest
artifacts:
- image: IMAGE1
custom:
buildCommand: echo "Bulding image 1"
- image: IMAGE2
custom:
buildCommand: echo "Building image 2"
requires:
- image: IMAGE1
- image: IMAGE3
custom:
buildCommand: echo "Building image 3"
@gaurav0107 Please take a look at https://skaffold.dev/docs/tutorials/artifact-dependencies/ to see how to specify artifact dependencies.
Looking at your config, it does not look like you are using the requires
stanza.
/cc Adding @gsquared94
@tejal29 even if I use the exact same example and build via
skaffold build -b app
since app requires base but its not in -b filter, it gives error as
FATA[0005] failed to resolve build result for required artifact "base" subtask=-1 task=DevLoop
apiVersion: skaffold/v2beta9
kind: Config
build:
artifacts:
- image: app
context: app
requires:
- image: base
alias: BASE
- image: base
context: base
ah got it thanks. I will add the bug label and add it our planning.
Hello,
Got the same annoying bug here.
In my case, i would like to push IMAGE2 but not IMAGE1. I don't see how to do that :(
I tried:
skaffold build -b IMAGE1
skaffold build -b IMAGE2 --push
but I got the same error failed to resolve build result for required artifact
Any updates on this?
Any updates on this? Fairly frustrating that skaffold dev
is the only way to actually test this capability and can not instrument particular artifacts.