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

SPIKE: fix pullImage for when source already contains digest #92

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

machecazzon
Copy link

This fixes the current implementation to correctly pullImage when the source image from annotations already contains the image digest.

(note this was generated from dt annotate command where the values specify the image digest)

values.yaml

image2:
  registry: example.com
  repository: deploy/aaaaaa/service-a
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: 0.3.0
  digest: sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867

generated Images.lock

apiVersion: v0
kind: ImagesLock
metadata:
  generatedAt: "2024-09-24T07:19:33.65058Z"
  generatedBy: Distribution Tooling for Helm
chart:
  name: test-chart1
  version: 0.1.0
  appVersion: 1.16.0
images:
  - name: service-a
    image: example.com/deploy/aaaaaa/service-a:0.3.0@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867
    chart: test-chart1
    digests:
      - digest: sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867
        arch: linux/amd64

Failure

    ✘  failed to pull images: failed to pull image "service-a": parsing reference " example.com/deploy/aaaaaa/service-a:0.3.0@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867": could not parse reference:  example.com/deploy/aaaaaa/service-a:0.3.0@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867

This fixes the current implementation to correctly pullImage when the source image from annotations already contains the image digest.

```
apiVersion: v0
kind: ImagesLock
metadata:
  generatedAt: "2024-09-24T07:19:33.65058Z"
  generatedBy: Distribution Tooling for Helm
chart:
  name: test-chart1
  version: 0.1.0
  appVersion: 1.16.0
images:
  - name: service-a
    image: example.com/deploy/aaaaaa/service-a:0.3.0@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867
    chart: test-chart1
    digests:
      - digest: sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867
        arch: linux/amd64
```

Failure
```
    ✘  failed to pull images: failed to pull image "service-a": parsing reference " example.com/deploy/aaaaaa/service-a:0.3.0@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867": could not parse reference:  example.com/deploy/aaaaaa/service-a:0.3.0@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867@sha256:f43290f7f2e3c3c8281bee512d216b7c604fd92501b3b4522df9333b1921f867
```
@vmwclabot
Copy link

@machecazzon, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link

@machecazzon, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants