Skip to content
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 reloads unchanged, existing image again into the cluster #4955

Closed
ghost opened this issue Oct 27, 2020 · 5 comments · May be fixed by #9408
Closed

Skaffold reloads unchanged, existing image again into the cluster #4955

ghost opened this issue Oct 27, 2020 · 5 comments · May be fixed by #9408
Labels
good first issue Good for newcomers kind/bug Something isn't working platform/k3d priority/p2 May take a couple of releases

Comments

@ghost
Copy link

ghost commented Oct 27, 2020

Expected behavior

Skaffold should not load already loaded image. In my case that's the image eu.gcr.io/tools-org-veroo/party-service:d46578239dd325395e15e8ab16a2c499616a15e662ed196c18549e8d2bea38b6.

Actual behavior

Skaffold does load image eu.gcr.io/tools-org-veroo/party-service:d46578239dd325395e15e8ab16a2c499616a15e662ed196c18549e8d2bea38b6 anew.

Information

  • Skaffold version: v1.15.0
  • operating system: macOS Catalina 10.15.7

I am loading two images into my k3d cluster.

This is the log output:

Checking cache...
 - eu.gcr.io/tools-org-veroo/party-service: Found Locally
 - eu.gcr.io/tools-org-veroo/party-service-flyway: Found Locally
Tags used in deployment:
 - eu.gcr.io/tools-org-veroo/party-service -> eu.gcr.io/tools-org-veroo/party-service:d46578239dd325395e15e8ab16a2c499616a15e662ed196c18549e8d2bea38b6
 - eu.gcr.io/tools-org-veroo/party-service-flyway -> eu.gcr.io/tools-org-veroo/party-service-flyway:65572b687b0f4a65e31fe7ef32545a4fa2902a05473701a5cc9dc45e2c707a69
Loading images into k3d cluster nodes...
 - eu.gcr.io/tools-org-veroo/party-service:d46578239dd325395e15e8ab16a2c499616a15e662ed196c18549e8d2bea38b6 -> Loaded
 - eu.gcr.io/tools-org-veroo/party-service-flyway:65572b687b0f4a65e31fe7ef32545a4fa2902a05473701a5cc9dc45e2c707a69 -> Found

However, both images are already in my cluster. So both images should have been found.

When I execute the command kubectl get nodes -o jsonpath='{@.items[*].status.images[*].names[*]}' I get this output:

eu.gcr.io/tools-org-veroo/party-service:d46578239dd325395e15e8ab16a2c499616a15e662ed196c18549e8d2bea38b6 eu.gcr.io/tools-org-veroo/party-service-flyway:65572b687b0f4a65e31fe7ef32545a4fa2902a05473701a5cc9dc45e2c707a69 docker.io/library/postgres@sha256:d26ddee3648a324a9747b3257236322141920d5f9a82ca703def6bff1cca7067 docker.io/library/postgres:alpine docker.io/rancher/klipper-helm@sha256:9cab2b9230d0454933de576b4e768cda8e0f1395cd5aca86ab649fc1d3be47bc docker.io/rancher/klipper-helm:v0.3.0 docker.io/rancher/library-traefik@sha256:3ba3ed48c4632f2b02671923950b30b5b7f1b556e559ce15446d1f5d648a037d docker.io/rancher/library-traefik:1.7.19 docker.io/rancher/coredns-coredns@sha256:e70c936deab8efed89db66f04847fec137dbb81d5b456e8068b6e71cb770f6c0 docker.io/rancher/coredns-coredns:1.6.9 docker.io/rancher/local-path-provisioner@sha256:40cb8c984c1759f1860eee088035040f47051c959a6d07cdb126e132c6f43b45 docker.io/rancher/local-path-provisioner:v0.0.14 docker.io/rancher/metrics-server@sha256:b85628b103169d7db52a32a48b46d8942accb7bde3709c0a4888a23d035f9f1e docker.io/rancher/metrics-server:v0.3.6 docker.io/rancher/klipper-lb@sha256:2fb97818f5d64096d635bc72501a6cb2c8b88d5d16bc031cf71b5b6460925e4a docker.io/rancher/klipper-lb:v0.1.2 docker.io/rancher/pause@sha256:d22591b61e9c2b52aecbf07106d5db313c4f178e404d660b32517b18fcbf0144 docker.io/rancher/pause:3.1

The image eu.gcr.io/tools-org-veroo/party-service:d46578239dd325395e15e8ab16a2c499616a15e662ed196c18549e8d2bea38b6 is also contained in this output.

Why is this image loaded anew into my cluster?

@tejal29 tejal29 added kind/bug Something isn't working platform/k3d priority/p2 May take a couple of releases needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug labels Oct 27, 2020
@tejal29
Copy link
Member

tejal29 commented Oct 27, 2020

@ErolPeel Skaffold does not check if an image is already present in the cluster.
You can add the command you mentioned above here https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/runner/load_images.go#L42

would you be up for the submitting a PR to do so?

@tejal29 tejal29 added good first issue Good for newcomers and removed needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug labels Oct 27, 2020
@ghost
Copy link
Author

ghost commented Oct 28, 2020

@ErolPeel Skaffold does not check if an image is already present in the cluster.
You can add the command you mentioned above here https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/runner/load_images.go#L42

would you be up for the submitting a PR to do so?

As far as I can see, Skaffold checks, whether an image is already in the cluster or not:

func findKnownImages(ctx context.Context, cli *kubectl.CLI) ([]string, error) {

And as far as I can tell this function is called for both k3d and kind.
Or am I missing something?

@tejal29
Copy link
Member

tejal29 commented Nov 3, 2020

Or am I missing something?

you are correct. i didn't look further in the code :)

@briandealwis
Copy link
Member

Closing as I tested Skaffold v1.17.2 with kind and I see images being detected. @ghost please let us know if you're still seeing issues.

ComaVN added a commit to ComaVN/skaffold that referenced this issue May 2, 2024
The single quotes around the `jsonpath` expression are incorrect: they are only needed when called in a shell, not when using `os.exec`
The result was that the first image returned had a `'` prepended to the name, and the last image had a `'` appended, meaning that those images would never be considered already loaded.

issue GoogleContainerTools#4955
@ComaVN
Copy link

ComaVN commented May 3, 2024

I had the same problem, and I think I fixed it in the PR above. Does this issue need to be reopened? I'm not 100% sure on this project's workflow :)

ComaVN added a commit to ComaVN/skaffold that referenced this issue Jun 3, 2024
The single quotes around the `jsonpath` expression are incorrect: they are only needed when called in a shell, not when using `os.exec`
The result was that the first image returned had a `'` prepended to the name, and the last image had a `'` appended, meaning that those images would never be considered already loaded.

issue GoogleContainerTools#4955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/bug Something isn't working platform/k3d priority/p2 May take a couple of releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants