kubernetes-sigs / kustomize

Customization of kubernetes YAML configurations
Apache License 2.0
11.09k stars 2.26k forks source link

kustomize edit set image should be idempotent #4724

Open simon-an opened 2 years ago

simon-an commented 2 years ago

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
natasha41575 commented 2 years ago

/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.

k8s-triage-robot commented 1 year ago

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:

You can:

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

/lifecycle stale

k8s-triage-robot commented 1 year ago

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:

You can:

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

/lifecycle rotten

vaibhav2107 commented 1 year ago

/remove-lifecycle rotten

charles-chenzz commented 1 year ago

@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)

k8s-triage-robot commented 2 weeks ago

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted