kubernetes-sigs / kubebuilder-declarative-pattern

A toolkit for building declarative operators with kubebuilder
Apache License 2.0
254 stars 84 forks source link

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

Closed xuzhenglun closed 2 years ago

xuzhenglun commented 2 years ago

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

Special notes for your reviewer:

Additional documentation:

k8s-ci-robot commented 2 years ago

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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-ci-robot commented 2 years ago

[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: - **[OWNERS](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
xuzhenglun commented 2 years ago

/test

k8s-ci-robot commented 2 years ago

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

In response to [this](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/pull/210#issuecomment-1077388705): >/test Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
xuzhenglun commented 2 years ago

@atoato88

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

atoato88 commented 2 years ago

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

xuzhenglun commented 2 years ago

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

atoato88 commented 2 years ago

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?

k8s-triage-robot commented 2 years 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 2 years 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

k8s-triage-robot commented 2 years 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.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closed this PR.

In response to [this](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/pull/210#issuecomment-1227034313): >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][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
JeffLuoo commented 1 year ago

/reopen

k8s-ci-robot commented 1 year ago

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

In response to [this](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/pull/210#issuecomment-1305971965): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.