Skip to content

When the image is remote and cached, skaffold tries to pull it locally and ignores the cache. #9177

@3droj7

Description

@3droj7

Hey,
We're using helm to deploy our images to the EKS and the images themselves are saved in the gitlab registry.
When we're trying to use skaffold, it will always try to download the image locally when it shouldn't because the deployment doesn't use the local images.

There's seems to be a bug in

if entry, err = c.tryImport(ctx, a, tag, hash, pl); err != nil {

It tries to import the image when the image can be remote and doesn't need to be imported.
func isImageLocal(runCtx *runcontext.RunContext, imageName string) (bool, error) {

Also I would suggest to put some debug logs to understand if skaffold decided that the image is remote or local.

Expected behavior

Checking cache...

  • manager_microservice: Found

Actual behavior

Checking cache...

  • manager_microservice: Not found. Building

Information

  • Skaffold version: 2.9.0
  • Operating system: ubuntu 22.04
  • Installed via: skaffold.dev
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta8
kind: Config
metadata:
  name: manager-microservice
build:
  cluster: {}
  artifacts:
    - image: manager_microservice
      context: ../../
      sync: {}
      custom:
        buildCommand: Build/buildx.sh "Manager/DtmMicroservice/Dockerfile" development
        dependencies:
          dockerfile:
            path: Manager/DtmMicroservice/Dockerfile
  tagPolicy:
    inputDigest: {}

skaffold build --default-repo registry.gitlab.com/.... --platform=linux/amd64 -v debug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions