kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

kustomize edit set image should be idempotent

Open simon-an opened this issue 2 years ago • 1 comments

Version:kustomize/v4.4.1

Is your feature request related to a problem? Please describe.

When running kustomize edit set image multiple times with the same parameters the result is multiple images blocks.

apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
- app-deployment.yaml
- app-service.yaml
images:
- name: app:latest
  newTag: "123456"
  newName: anyregistry/app

images:
- name: app:latest
  newTag: "123456"
  newName: anyregistry/app

Describe the solution you'd like

apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
- app-deployment.yaml
- app-service.yaml
images:
- name: app:latest
  newTag: "123456"
  newName: anyregistry/app

simon-an avatar Jul 26 '22 08:07 simon-an

/triage accepted /kind bug

At the very least, the kustomization file should not end up with two different images fields. It should also be possible to deduplicate the images field.

natasha41575 avatar Sep 28 '22 16:09 natasha41575

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-triage-robot avatar Dec 27 '22 16:12 k8s-triage-robot

The Kubernetes project currently lacks enough active 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 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 rotten

k8s-triage-robot avatar Jan 26 '23 17:01 k8s-triage-robot

/remove-lifecycle rotten

vaibhav2107 avatar Sep 27 '23 07:09 vaibhav2107

@simon-an hi, would you like to provide detail setup on how to reproduce it? I was unable to reproduce in my mac ( I'm running kustomize v5.1.1)

charles-chenzz avatar Nov 20 '23 12:11 charles-chenzz