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

feat: support edit set label for labels and not only commonLabels #4478

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gaeljw
Copy link

@gaeljw gaeljw commented Feb 17, 2022

Aims to solves #3866

Please review with care as I've never written Go before!

Also unit tests doesn't actually go through the command parsing so there might be issues on this part. I don't know how to test a whole command. If you do, please feel free to complete.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 17, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 17, 2022

CLA Signed

The committers are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 17, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @gaeljw!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 17, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @gaeljw. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 17, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 17, 2022
@gaeljw gaeljw marked this pull request as ready for review February 18, 2022 15:12
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 18, 2022
@natasha41575
Copy link
Contributor

/assign

1 similar comment
@natasha41575
Copy link
Contributor

/assign

@natasha41575
Copy link
Contributor

/ok-to-test

1 similar comment
@natasha41575
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 13, 2022
Copy link
Contributor

@natasha41575 natasha41575 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more things that this PR needs to go in:

  1. The same change should be made to kustomize edit add label and kustomize edit remove label

  2. I pulled your branch and ran kustomize edit set label foo:bar --fields=labels, which gave me:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
  foo: bar
labels:
- {}
- pairs:
    foo: bar

This needs to be fixed before we can merge this PR. You can try this out yourself by going into the kustomize/kustomize directory and running go install . to build your branch.

kustomize/commands/edit/set/setlabel.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 19, 2022
@gaeljw
Copy link
Author

gaeljw commented Feb 10, 2023

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Feb 10, 2023
@k8s-ci-robot
Copy link
Contributor

@gaeljw: Reopened this PR.

In response to this:

/reopen

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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gaeljw
Once this PR has been reviewed and has the lgtm label, please ask for approval from natasha41575. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@afirth
Copy link
Contributor

afirth commented Feb 22, 2023

anything I can do to help get either #4486 or this over the line?

@natasha41575
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Mar 24, 2023
@natasha41575 natasha41575 added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Mar 24, 2023
@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

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

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

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

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

This bot triages 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 PR is closed

You can:

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

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

/close

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.

@gaeljw
Copy link
Author

gaeljw commented Apr 23, 2023

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Apr 23, 2023
@k8s-ci-robot
Copy link
Contributor

@gaeljw: Reopened this PR.

In response to this:

/reopen

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.

@afirth
Copy link
Contributor

afirth commented Apr 25, 2023

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Apr 25, 2023
@nhamlh
Copy link

nhamlh commented Jun 10, 2023

I'd love to see this PR got merged soon. May I ask which is blocking this?

@nouney
Copy link

nouney commented Nov 30, 2023

Any updates?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 30, 2023
@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this 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 Feb 28, 2024
@stormqueen1990
Copy link
Member

/remove-lifecycle stale
/cc

@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 Feb 28, 2024
@stormqueen1990
Copy link
Member

Hi there, @gaeljw!

Are you still interested in contributing this feature? If yes, could you please rebase this branch and resolve the existing conflicts?

@gaeljw
Copy link
Author

gaeljw commented Mar 4, 2024

I don't have much time to rebase my work and fix the conflicts currently. If anyone else wants to take over, I don't mind at all. Given that I know nothing about Go, this will probably more efficient anyway.

@stormqueen1990
Copy link
Member

I don't have much time to rebase my work and fix the conflicts currently. If anyone else wants to take over, I don't mind at all. Given that I know nothing about Go, this will probably more efficient anyway.

I see. Appreciate the response 🙏🏼

@cunyat
Copy link

cunyat commented Mar 6, 2024

Hi there! I was looking arround for this feature and looked to rebase the PR, but i found that some similar feature was already introduced by #4486.

How can i help on this? I suppose thats better to keep already merged flags but i think it's better what this PR proposes (--include-selectors).
Also, few things that could be improved:

  • Current implementation duplicates labels entries, this PR checks if already exists on add and fails if --force was not present.
  • I think that would be good to also include --labels-without-template or --include-templates for allowing propagation of labels to templates without putting them in selectors.

@stormqueen1990
Copy link
Member

Hi there! I was looking arround for this feature and looked to rebase the PR, but i found that some similar feature was already introduced by #4486.

How can i help on this? I suppose thats better to keep already merged flags but i think it's better what this PR proposes (--include-selectors). Also, few things that could be improved:

  • Current implementation duplicates labels entries, this PR checks if already exists on add and fails if --force was not present.
  • I think that would be good to also include --labels-without-template or --include-templates for allowing propagation of labels to templates without putting them in selectors.

Hi there, @cunyat!

Sorry for my late response! If you're interested in contributing the feature yourself, you can open a PR against this repository with your proposed changes, mentioning the referenced issue in your pull request description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet