kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

Ability to set create true/false on label

Open eduanb opened this issue 2 years ago • 7 comments

Eschewed features

  • [X] This issue is not requesting templating, unstuctured edits, build-time side-effects from args or env vars, or any other eschewed feature.

What would you like to have added?

When specifying a label/commonLabel I would like to override whether a specific path should be created. Seems like commonLabel might be removed, so makes sense to add it to labels which is already more customizable.

My rough first idea:

labels:
  - pairs:
      someName: someValue
    create:
      - path: spec/selector/matchLabels
        kind: PodDisruptionBudget

Why is this needed?

I ran into exactly this issue https://github.com/kubernetes-sigs/kustomize/issues/2716 For some reason, the create is hard-coded to be false for DPB selectors. For my use case, I would like it true, but other users might prefer false. This could be the case for all the labels. Additionally, if more paths are needed in the future, a user can configure it without Kustomize explicitly adding support.

Can you accomplish the motivating task without this feature, and if so, how?

A patch can accomplish it. However, PDBs are fairly small manifests, so a patch is almost the same as recreating the whole manifest over again.

What other solutions have you considered?

A patch which does work but that makes the overall yaml more when using Kustomize than without it.

Anything else we should know?

No response

Feature ownership

  • [ ] I am interested in contributing this feature myself! 🎉

eduanb avatar Nov 14 '23 15:11 eduanb

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle stale
  • Close this issue 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 Feb 12 '24 16:02 k8s-triage-robot

/remove-lifecycle stale

stormqueen1990 avatar Feb 19 '24 16:02 stormqueen1990

Hello there, @eduanb! 👋

The built-in transformer labels already has a mechanism to override this behaviour for the PodDisruptionBudget resource, through the fields option:

labels:
  - pairs:
      someName: someValue
    fields:
      - path: spec/selector/matchLabels
        kind: PodDisruptionBudget
        create: true

Would you be able to give it a try and confirm whether this works for your use case?

stormqueen1990 avatar Feb 19 '24 21:02 stormqueen1990

/kind support /triage needs-information

stormqueen1990 avatar Feb 19 '24 21:02 stormqueen1990

/remove-kind feature

stormqueen1990 avatar Feb 19 '24 21:02 stormqueen1990

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle stale
  • Close this issue 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 May 19 '24 22:05 k8s-triage-robot

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle rotten
  • Close this issue 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 Jun 18 '24 22:06 k8s-triage-robot

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

This bot triages issues 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:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close not-planned

k8s-triage-robot avatar Jul 18 '24 23:07 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

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

This bot triages issues 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:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close not-planned

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-sigs/prow repository.

k8s-ci-robot avatar Jul 18 '24 23:07 k8s-ci-robot