kubernetes / sample-controller

Repository for sample controller. Complements sample-apiserver
Apache License 2.0
3.17k stars 1.1k forks source link

Improve Clarity of syncHandler Comment in Sample Controller #98

Closed vMaroon closed 5 months ago

vMaroon commented 10 months ago

Overview

This PR proposes a minor yet significant update to the comment of the syncHandler function in the sample-controller. The aim is to enhance clarity and reduce potential ambiguity for developers who might not be deeply familiar with the Kubernetes controller pattern.

Changes

The original comment used the term "converge" to describe the process of aligning the actual state of a resource with its desired state. However, this term can be somewhat ambiguous, especially for newcomers or those not intimately familiar with Kubernetes' declarative approach. The proposed change in this PR replaces "converge" with a more explicit phrase to clarify the intended operation of the syncHandler function.

Original Comment

// syncHandler compares the actual state with the desired, and attempts to
// converge the two. It then updates the Status block of the Foo resource
// with the current status of the resource.

Updated Comment

// syncHandler compares the actual state with the desired, and attempts to
// align the first to the latter. It then updates the Status block of the
// Foo resource with the current status of the resource.

Rationale

The adjustment in the comment aims to make the description more accessible and straightforward, particularly for those who might be learning about Kubernetes controllers for the first time. This change is in line with best practices for code documentation, where clarity and precision are crucial for effective communication and understanding.

Impact

The change is limited to the comment and does not affect the functionality of the code. It is intended purely for educational and clarity purposes, enhancing the overall quality of the documentation in the sample-controller.

linux-foundation-easycla[bot] commented 10 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 10 months ago

Welcome @vMaroon!

It looks like this is your first PR to kubernetes/sample-controller 🎉. 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/sample-controller 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. :smiley:

k8s-ci-robot commented 10 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vMaroon Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. 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: - **[OWNERS](https://github.com/kubernetes/sample-controller/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
vMaroon commented 10 months ago

To be fair, this may be an overkill but the use of "converge" has bothered me to this point. The original comment in code uses "converge" while implicitly assuming that the reader would infer that the conversion point is at the desired state, which is very fair, yet still ambiguous.

Thank you for reading :joy:

k8s-triage-robot commented 7 months ago

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

This bot triages PRs according to the following rules:

You can:

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

/lifecycle stale

k8s-triage-robot commented 6 months ago

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

This bot triages PRs according to the following rules:

You can:

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

/lifecycle rotten

k8s-triage-robot commented 5 months ago

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:

You can:

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

/close

k8s-ci-robot commented 5 months ago

@k8s-triage-robot: Closed this PR.

In response to [this](https://github.com/kubernetes/sample-controller/pull/98#issuecomment-2118898977): >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][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-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.