sample-controller icon indicating copy to clipboard operation
sample-controller copied to clipboard

Improve Clarity of syncHandler Comment in Sample Controller

Open vMaroon opened this issue 2 years ago • 5 comments

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.

vMaroon avatar Dec 20 '23 16:12 vMaroon

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: vMaroon / name: Maroon Ayoub (2a527cbdcae5296bb339c210a5eb01365122d724)

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 avatar Dec 20 '23 16:12 k8s-ci-robot

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

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 Dec 20 '23 16:12 k8s-ci-robot

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:

vMaroon avatar Dec 20 '23 16:12 vMaroon

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-triage-robot avatar Mar 19 '24 16:03 k8s-triage-robot

The Kubernetes project currently lacks enough active 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 rotten
  • Close this 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 Apr 18 '24 17:04 k8s-triage-robot

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-triage-robot avatar May 18 '24 17:05 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 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-sigs/prow repository.

k8s-ci-robot avatar May 18 '24 17:05 k8s-ci-robot