-
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
remoteManifests don't replace image on deployment if digest specified #5216
Comments
This behaviour is intentional @spmason, but we're looking to make this behaviour configurable. |
Do you know the reasons for this @briandealwis ? I couldn't find any discussion about it I'd think that at least in the case of |
Sounds similar to #5855. |
Reducing the priority since we don't have it planned for q3. |
@briandealwis I am also curious why this is expected behavior. For reference we primarily use the helm deployer and we can no longer simply skaffold run and have the image overwritten. This is causing a great deal of confusion as it appears to be a regression. We'll be rolling our version back until we can hear more about this |
Hey @nkubala, I upgraded to Skaffold 1.33.0, deployed my service, made a code change, deployed my service again (even used --cache-artifacts=false for good measure), and am still seeing the error. It's worth mentioning that we are using the helm deployer primarily and the OP and the fix you've linked seem to be focused on the kubectl deployer. Here is an example of what our deploy section looks like (using skaffold/v2beta16 currently, but can upgrade if needed) deploy:
helm:
releases:
- name: my-service
remoteChart: my-remote/chart-path
version: 5.0.x
artifactOverrides:
image: my-service
valuesFiles:
- ./values/values.yaml @briandealwis mentioned that you are looking to make it configurable and if there is new configuration that we need to set to achieve the desired behavior here I'm happy to do that! For a little more information, I did a skaffold run in debug mode and this appears to be the relevant logs:
|
Any update on this? Should I maybe make a separate issue that explicitly mentions the helm deployer? |
Thanks @j2udevelopment. Like @briandealwis mentioned this behavior is intentional. We don't have plans to make configurable in upcoming H2 2022 cycle. We would love to get any community help on this. |
This works nicely with chartPath
Logs
This does not work with Remote Helm Chart Repo Repo
Logs
|
It would be extremely helpful if Skaffold had an option to match a Skaffold configuration's build.artifacts[*].image:
against a manifest's containers[*].image even when it uses a digest:
Our use case is that we want to have a base K8s configuration that references the images by digest, which a tool like Argo CD consumes directly, and then have overlay developer configurations that Skaffold consumes. Our current workaround is to have overlay developer configurations rewrite the images they expect Skaffold to manage, using Kustomize. The Kustomize config replaces the digest and any tag with just ":latest", to make it acceptable to Skaffold:
But it's really tedious including this image rewrite in every overlay developer configuration, particularly when this is Skaffold's area of expertise - identifying what images to handle. |
Expected behavior
When using
remoteManifests
, if the deployed manifest contains an image digest then the image is not replaced with the one built by skaffoldActual behavior
The image is not replaced and a warning
WARN[0002] image [foo] is not used by the deployment
is printedInformation
This is a basic reproduction I've cooked up
And deployment.yaml:
Steps to reproduce the behavior
skaffold.yaml
anddeployment.yaml
fileskubectl create ns skaffold-digest-bug
kubectl apply -f deployment.yaml
skaffold run
WARN[0002] image [nginx] is not used by the deployment
as describeddeployment.yaml
to remove the sha from the image (ieimage: nginx:1.14.2
)kubectl apply -f deployment.yaml
skaffold run
It looks like the problem is here: https://github.com/GoogleContainerTools/skaffold/blame/v1.17.2/pkg/skaffold/kubernetes/manifest/images.go#L108
That check was added in e3fd350 - but the comment on the commit ("Ignore tags (not digests) in manifests") is directly contradicted by the code and the behaviour. By not adding to
r.found
it is ignoring digests...Is this behaviour intentional somehow?
The text was updated successfully, but these errors were encountered: