Skip to content

Conversation

s-z-z
Copy link
Contributor

@s-z-z s-z-z commented Aug 28, 2025

I found that the pkg/manager/signals package is identical to the code in k8s.io/apiserver/pkg/server/.

The earliest commit comes from kubernetes/kubernetes#50439.

I think we should use it directly instead of copying it, so I propose cleaning it up.

Additionally, there's a divergence trend. In k/k: SetupSignalHandler returns a channel, while SetupSignalContext returns a context.

Moreover, the current PR only implements an alias-like redirection.

Should we directly remove the signals package and replace all signals.SetupSignalHandler references with ctrl.SetupSignalHandler, performing the redirection only once in alias.go? If allowed, I can further streamline it.

…upSignalContext as they are identical.

Signed-off-by: s-z-z <[email protected]>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: s-z-z
Once this PR has been reviewed and has the lgtm label, please assign vincepri for approval. For more information see the 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

@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 Aug 28, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @s-z-z. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 28, 2025
@s-z-z s-z-z changed the title 🌱 cleanup: replace custom signal handling with Kubernetes apiserver.SetupSignalContext as they are identical 🌱 cleanup: replace custom signal handling with apiserver.SetupSignalContext as they are identical Aug 28, 2025

return ctx
}
var SetupSignalHandler = apiserver.SetupSignalContext
Copy link
Member

Choose a reason for hiding this comment

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

I honestly prefer the copy over introducing a dependency to the apiserver code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for your reply.
apiserver is already a dependency of cr; this PR doesn't add new packages.

Copy link
Member

@sbueringer sbueringer Aug 28, 2025

Choose a reason for hiding this comment

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

Yes, but we would now depend on this code from the apiserver and we have 0 control over or visibility into how it changes over time

@s-z-z s-z-z closed this Aug 28, 2025
@s-z-z s-z-z deleted the cleanup-signals branch August 28, 2025 14:58
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-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants