-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skaffold verify should support env vars with templating #9593
Comments
I checked whether it is possible to achieve the desired result using overrides but it doesn't seem so. It doesn't seem to be a strategic merge so the image tag is lost when your override specifies the container. This means you can't make any overrides to a container? verify:
- name: foo-e2e-test
container:
name: foo-e2e-test
image: foo-e2e-test
args:
- -test.v
executionMode:
kubernetesCluster:
overrides: |-
{
"kind": "Job",
"apiVersion": "batch/v1",
"spec": {
"template": {
"spec": {
"containers": [
{
"name": "foo-e2e-test",
"env": [
{
"name": "FOO",
"value": "BAR"
}
]
}
]
}
}
}
} DEBU[0065] Running command: [tput colors] subtask=-1 task=DevLoop
DEBU[0065] Command output: [256
] subtask=-1 task=DevLoop
1 error(s) occurred:
* creating verify job in cluster: Job.batch "foo-e2e-test" is invalid: spec.template.spec.containers[0].image: Required value |
Tried this too, but it doesn't resolve the templated image within the overrides: verify:
- name: foo-e2e-test
container:
name: foo-e2e-test
image: foo-e2e-test
executionMode:
kubernetesCluster:
overrides: |-
{
"kind": "Job",
"apiVersion": "batch/v1",
"spec": {
"template": {
"spec": {
"containers": [
{
"name": "foo-e2e-test",
"image": "{{.IMAGE_FULLY_QUALIFIED_foo-e2e-test}}",
"args": [
"-test.v"
],
"env": [
{
"name": "FOO",
"value": "BAR"
}
]
}
]
}
}
}
} |
It seems that there is a For an E2E test, there are dynamic values that we need to be able to pass to the verify container. We are going to be deploying and running the verify as an E2E test so we want to be able to easily change the namespace, provide a unique identifier for the test run, etc. We could burn these values into an env-file but then we can't use the normal overlapping profiles with overrides strategy that we've been using successfully for skaffold so far. Maybe some more complete examples for complex use cases of |
Another example of a dynamic value we need to pass to the E2E test: we're testing a system which needs to create pods whose containers use images built by skaffold so we need to be able to tell the test the tag for those images. It's usually possible to reference these with |
The
skaffold.yaml
API forverify
container only documents usage for name, image, command and args. This is insufficient for us to specify our tests which need env vars and need to be able to template values based on the environment that is running skaffold, similar to what we can do for our deployed helm charts.We would like to do something like:
Information
The text was updated successfully, but these errors were encountered: