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

kustomize edit set image should correctly parse both tag and digest #4713

Open
karlkfi opened this issue Jul 15, 2022 · 10 comments
Open

kustomize edit set image should correctly parse both tag and digest #4713

karlkfi opened this issue Jul 15, 2022 · 10 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@karlkfi
Copy link
Contributor

karlkfi commented Jul 15, 2022

kustomize edit set image org/repo:tag@sha256:digest is not parsed correctly.

Currently it results in:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- digest: sha256:digest
  name: org/repo:tag

If you leave out the digest, the tag gets parsed correctly, but with the digest, the tag is assumed to be part of the image name, which is incorrect.

I would expect them to parse correctly when both supplied.

It's desirable to specify them both to facilitate security requirements as well as human readability, even if the tag is usually ignored by container runtimes when the digest is specified.

@karlkfi karlkfi added the kind/bug Categorizes issue or PR as related to a bug. label Jul 15, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 15, 2022
@natasha41575
Copy link
Contributor

I'm able to reproduce the issue. IIUC, the correct output should be

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- digest: sha256:digest
  name: org/repo
  newTag: tag

There is some parsing code from #4406 that we can probably reuse to resolve this issue.

/triage accepted
/help
/label good first issue

@k8s-ci-robot
Copy link
Contributor

@natasha41575:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

I'm able to reproduce the issue. IIUC, the correct output should be

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- digest: sha256:digest
 name: org/repo
 newTag: tag

There is some parsing code from #4406 that we can probably reuse to resolve this issue.

/triage accepted
/help
/label good first issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 15, 2022
@natasha41575 natasha41575 added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Jul 15, 2022
mgsh added a commit to mgsh/kustomize that referenced this issue Jul 16, 2022
Support edit set image with both tag and digest
mgsh added a commit to mgsh/kustomize that referenced this issue Jul 16, 2022
mgsh added a commit to mgsh/kustomize that referenced this issue Jul 16, 2022
@mgsh
Copy link

mgsh commented Jul 16, 2022

/assign

@CIPHERTron
Copy link
Member

Heyy @mgsh are you still working on this issue?
I was looking for a good first issue to contribute to customize 😅

@mgsh
Copy link

mgsh commented Aug 15, 2022

Hi @CIPHERTron, I have submitted a PR for it #4714
But not sure how to get it reviewed and merged. No response on the PR.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 13, 2022
@gkumarchilakala
Copy link

@natasha41575 Is there a plan to fix this issue?

@ashutosh887
Copy link

Is this already fixed @natasha41575
If not, I would like to work on this

@vaibhav2107
Copy link

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 27, 2023
@blackjid
Copy link
Contributor

with #5234 merged, I thing this could be closed. I don't know in what version and when it will be released though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging a pull request may close this issue.

10 participants