kubebuilder-declarative-pattern icon indicating copy to clipboard operation
kubebuilder-declarative-pattern copied to clipboard

don't remove objects with ignore annotation when prune is enabled

Open xuzhenglun opened this issue 3 years ago • 10 comments

What this PR does / why we need it: fix #209

Special notes for your reviewer:

Additional documentation:

xuzhenglun avatar Mar 24 '22 08:03 xuzhenglun

Hi @xuzhenglun. 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 avatar Mar 24 '22 08:03 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xuzhenglun To complete the pull request process, please assign justinsb after the PR has been reviewed. You can assign the PR to them by writing /assign @justinsb in a comment when ready.

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

k8s-ci-robot avatar Mar 24 '22 08:03 k8s-ci-robot

/test

xuzhenglun avatar Mar 24 '22 08:03 xuzhenglun

@xuzhenglun: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test

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 avatar Mar 24 '22 08:03 k8s-ci-robot

@atoato88

remove labels if ignore annotation is applied, does this solution ok for you?

xuzhenglun avatar Mar 25 '22 06:03 xuzhenglun

@xuzhenglun IMHO, labels set in r.options.labelMaker are quite important on some situations. e.g. Filter objects by those labels, ...

@justinsb Any ideas which don't delete those labels?

atoato88 avatar Mar 25 '22 07:03 atoato88

@xuzhenglun IMHO, labels set in r.options.labelMaker are quite important on some situations. e.g. Filter objects by those labels, ...

@justinsb Any ideas which don't delete those labels?

@atoato88

Or maybe we can put a label addons.k8s.io/ignore on the object which contains the annotation addons.k8s.io/ignore.

Later, In prune progress, we can append a selector: !addons.k8s.io/ignore. The corresponding kubectl command could be kubectl apply --prune --selector=<user-labels>,!addons.k8s.io/ignore

Both of the two situations are ok for me. After deciding which one we should choose, then I'm willing to update this PR.

xuzhenglun avatar Mar 25 '22 09:03 xuzhenglun

Thank you to comment your ideas. I think 2nd one is more reasonable for me;

Or maybe we can put a label addons.k8s.io/ignore on the object which contains the annotation addons.k8s.io/ignore.

But it's a breaking change from current codebase, so we should decide this with other approvers.

@justinsb WDYT?

atoato88 avatar Mar 28 '22 06:03 atoato88

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 Jun 26 '22 09:06 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 Jul 26 '22 09:07 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:

  • Reopen this issue or PR with /reopen
  • Mark this issue or 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-triage-robot avatar Aug 25 '22 09:08 k8s-triage-robot

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

  • Reopen this issue or PR with /reopen
  • Mark this issue or 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.

k8s-ci-robot avatar Aug 25 '22 09:08 k8s-ci-robot

/reopen

JeffLuoo avatar Nov 07 '22 17:11 JeffLuoo

@JeffLuoo: You can't reopen an issue/PR unless you authored it or you are a collaborator.

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 avatar Nov 07 '22 17:11 k8s-ci-robot