Skip to content

docs: Fix typos and regenerate samples #4766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chethanm99
Copy link
Contributor

This PR fixes multiple typos identified in documentation and comments.

The make generate-docs command was run successfully after resolving intermediate generation conflicts. This ensures that all dependent sample projects and documentation components are regenerated using the corrected source material and current project standards.

All related changes have been squashed into one commit as required.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 7, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chethanm99
Once this PR has been reviewed and has the lgtm label, please assign varshaprasad96 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 7, 2025
@k8s-ci-robot
Copy link
Contributor

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

@@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.63.4
version: v2.0.2
Copy link
Member

Choose a reason for hiding this comment

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

it is not part of the scope of this PR right?

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

Thanks for the clarification! You were right, the golangci-lint version update is being handled in another issue.

To keep this PR focused, I ran make generate-docs as required, but then manually reverted the golangci-lint version change (from v2.0.2 back to v1.63.4) in the regenerated sample files (lint.yml, Makefile) before committing and squashing.

The PR now contains only the typo fixes and the regenerated files reflecting those fixes, without the unrelated version bump. Everything is squashed into a single commit.

@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from 4b8250c to 6778b35 Compare April 7, 2025 13:26
@@ -151,7 +150,7 @@ type CronJobStatus struct {
// +optional
Active []corev1.ObjectReference `json:"active,omitempty"`

// Information when was the last time the job was successfully scheduled.
// Information when was the last time the job was successfully scheduled ?
Copy link
Member

Choose a reason for hiding this comment

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

Why ? instead of .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that is a mistake I'll rectify that please let me know if there are any other changes.

@camilamacedo86 camilamacedo86 requested a review from Copilot April 8, 2025 09:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 28 out of 31 changed files in this pull request and generated 2 comments.

Files not reviewed (3)
  • docs/book/src/cronjob-tutorial/testdata/project/Makefile: Language not supported
  • docs/book/src/cronjob-tutorial/testdata/project/config/samples/batch_v1_cronjob.yaml: Language not supported
  • docs/book/src/multiversion-tutorial/testdata/project/Makefile: Language not supported

Comment on lines 124 to 125
We’ll verify that when a CronJob has a single active downstream Job, it's CronJob.Status.The active field contains a reference to this Job.

Copy link
Preview

Copilot AI Apr 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment contains a typo: 'it's' should be 'its' and the phrase 'The active field' should be revised to 'Active field' to match convention.

Suggested change
Well verify that when a CronJob has a single active downstream Job, it's CronJob.Status.The active field contains a reference to this Job.
Well verify that when a CronJob has a single active downstream Job, its CronJob.Status.Active field contains a reference to this Job.

Copilot uses AI. Check for mistakes.

@@ -107,7 +107,7 @@ type CronJobStatus struct {
// +optional
Active []corev1.ObjectReference `json:"active,omitempty"`

// Information when was the last time the job was successfully scheduled.
// Information when was the last time the job was successfully scheduled ?
Copy link
Preview

Copilot AI Apr 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Remove the extraneous space before the question mark to improve grammatical correctness.

Suggested change
// Information when was the last time the job was successfully scheduled ?
// Information when was the last time the job was successfully scheduled.

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please revert the change here?

@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from 6778b35 to 72c6500 Compare April 8, 2025 11:02
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2025
@chethanm99
Copy link
Contributor Author

Applied the requested changes/nitpicks, @camilamacedo86

@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from 72c6500 to edcf163 Compare April 8, 2025 12:44
@@ -140,7 +140,7 @@ var _ = Describe("CronJob controller", func() {
/*
Now that we've created a CronJob in our test cluster, the next step is to write a test that actually tests our CronJob controller’s behavior.
Let’s test the CronJob controller’s logic responsible for updating CronJob.Status.Active with actively running jobs.
We’ll verify that when a CronJob has a single active downstream Job, its CronJob.Status.Active field contains a reference to this Job.
We’ll verify that when a CronJob has a single active downstream Job, it's CronJob.Status.The active field contains a reference to this Job.
Copy link
Member

Choose a reason for hiding this comment

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

I think this one is wrong right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this one is wrong right?

yes I will also correct this

@@ -151,7 +151,7 @@ var _ = Describe("CronJob controller", func() {
g.Expect(createdCronjob.Status.Active).To(BeEmpty())
}, duration, interval).Should(Succeed())
/*
Next, we actually create a stubbed Job that will belong to our CronJob, as well as its downstream template specs.
Copy link
Member

Choose a reason for hiding this comment

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

Why remove the actually?

Copy link
Contributor Author

@chethanm99 chethanm99 Apr 11, 2025

Choose a reason for hiding this comment

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

yes this is also my mistake i will also resolve this

hackutils.CheckError("add version and marker for storage version", err)

debugTargetFile := filepath.Join(sp.ctx.Dir, path) // Use 'path' directly
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this logic to just update change comments?

Copy link
Contributor Author

@chethanm99 chethanm99 Apr 11, 2025

Choose a reason for hiding this comment

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

Why do we need this logic to just update change comments?

This line was added for debugging process while I was trying to figure out why the make generate-docs script was failing. I will make sure to remove it

@@ -178,7 +178,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.2
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
GOLANGCI_LINT_VERSION ?= v1.63.4
GOLANGCI_LINT_VERSION ?= v2.0.2
Copy link
Member

Choose a reason for hiding this comment

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

It is not part of the scope of this PR?
Could you please rebase with master to ensure that all is properly updated ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will resolve this. Thanks for taking the time to notify this

@@ -128,7 +128,7 @@ func (sp *Sample) UpdateTutorial() {
sp.updateE2E()
}

// CodeGen is a noop for this sample, just to make generation of all samples
// CodeGen is a loop for this sample, just to make the generation of all samples
Copy link
Member

Choose a reason for hiding this comment

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

The comment seems wrong CodeGen will generate the code for the sample maybe is more accurate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you are right i will replace it with the comment you mentioned

@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from edcf163 to e3f5b97 Compare April 11, 2025 12:09
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 11, 2025
@@ -531,11 +531,11 @@ func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
/*
### Setup

Finally, we'll update our setup. In order to allow our reconciler to quickly
look up Jobs by their owner, we'll need an index. We declare an index key that
Finally, we'll update our setup. To allow our reconciler to quickly
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for not keep In order to?

@@ -137,7 +137,7 @@ var _ = BeforeSuite(func() {
and it'd be easy to make mistakes.

Note that we keep the reconciler running against the manager's cache client, though -- we want our controller to
behave as it would in production, and we use features of the cache (like indices) in our controller which aren't
behave as it would in production, and we use features of the cache (like indices) in our controller that aren't
Copy link
Member

Choose a reason for hiding this comment

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

why not keep which?

// jobs at (or anything we missed).
missedRun, nextRun, err := getNextSchedule(&cronJob, r.Now())
if err != nil {
log.Error(err, "unable to figure out CronJob schedule")
// we don't really care about requeuing until we get an update that
Copy link
Member

Choose a reason for hiding this comment

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

should we not keep really here? Why not?

// fixes the schedule, so don't return an error
return ctrl.Result{}, nil
}

/*
We'll prep our eventual request to requeue until the next job, and then figure
out if we actually need to run.
Copy link
Member

Choose a reason for hiding this comment

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

should we not keep actually here? Why not?

@@ -20,5 +20,6 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v7
with:

Copy link
Member

Choose a reason for hiding this comment

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

why do we need this space?

@chethanm99
Copy link
Contributor Author

Hi @camilamacedo86 I made these typo changes to enhance the readability of the users but some of these changes which you mentioned were not required . I will make sure to make the changes. I am really sorry as this is consuming a lot of your time and I will make sure that I don't make such mistakes in the upcoming contributions. Please let me know if there are any further changes. Thanks once again for your time

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 12, 2025
@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from e2d5309 to 5da467a Compare April 12, 2025 10:20
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 12, 2025
// The number of successful finished jobs to retain.
// This is a pointer to distinguish between explicit zero and not specified.
// The number of successfully finished jobs to retain.
// This pointer distinguishes between explicit zero and not specified.
Copy link
Member

Choose a reason for hiding this comment

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

I think the original text is accurate, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right I will replace it with the older text

@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from 5da467a to b73b99e Compare April 13, 2025 05:28
# Note that the option maxDescLen=0 was added in the default scaffold in order to sort out the issue
# Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
# Note that the option maxDescLen=0 was added in the default scaffold to sort out the issue
# Too long: must have at most 262144 bytes. By using kubectl to create/update resources an annotation
Copy link
Member

@camilamacedo86 camilamacedo86 Apr 14, 2025

Choose a reason for hiding this comment

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

Here kubectl apply is the command so we should keep it.
Maybe we can By using kubectl apply command

@@ -500,7 +500,7 @@ func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
}
// +kubebuilder:docs-gen:collapse=constructJobForCronJob

// actually make the job...
Copy link
Member

Choose a reason for hiding this comment

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

I think we should keep actually here

@@ -121,7 +121,7 @@ var _ = Describe("CronJob controller", func() {
/*
Now that we've created a CronJob in our test cluster, the next step is to write a test that actually tests our CronJob controller’s behavior.
Let’s test the CronJob controller’s logic responsible for updating CronJob.Status.Active with actively running jobs.
We’ll verify that when a CronJob has a single active downstream Job, its CronJob.Status.Active field contains a reference to this Job.
We’ll verify that when a CronJob has a single active downstream Job, it's CronJob.Status.The active field contains a reference to this Job.
Copy link
Member

Choose a reason for hiding this comment

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

here we need to keep as before CronJob.Status.Active is the spec

@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from b73b99e to fa42314 Compare April 21, 2025 01:05
@chethanm99
Copy link
Contributor Author

Hi @camilamacedo86 I've made the necessary changes . I would be happy to make any further changes

- A way to pause the running of a CronJob, in case something's wrong with it
- Limits on old job history

Remember, since we never read our own status, we need to have some other way to
keep track of whether a job has run. We can use at least one old job to do
Remember, since we never read our status, we need to have another way to track whether a job has run. We can use at least one old job to do
Copy link
Member

Choose a reason for hiding this comment

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

Will not it fail in the lint?
The line should still broke as before.
Also, why remove own?

# Note that the option maxDescLen=0 was added in the default scaffold in order to sort out the issue
# Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
# Note that the option maxDescLen=0 was added in the default scaffold to sort out the issue
# Too long: must have at most 262144 bytes. By using kubectl to create/update resources an annotation
Copy link
Member

Choose a reason for hiding this comment

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

Could you please revert the command is kubectl apply that is why we have it as it is.

// fixes the schedule, so don't return an error
return ctrl.Result{}, nil
}

/*
We'll prep our eventual request to requeue until the next job, and then figure
out if we actually need to run.
Copy link
Member

@camilamacedo86 camilamacedo86 Apr 21, 2025

Choose a reason for hiding this comment

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

The actually shows make sense here
Can you please revert?

// jobs at (or anything we missed).
missedRun, nextRun, err := getNextSchedule(&cronJob, r.Now())
if err != nil {
log.Error(err, "unable to figure out CronJob schedule")
// we don't really care about requeuing until we get an update that
Copy link
Member

Choose a reason for hiding this comment

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

The really shows make sense here as well.
Can you please revert?

@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from fa42314 to 00bd6b5 Compare April 21, 2025 12:21
# Note that the option maxDescLen=0 was added in the default scaffold in order to sort out the issue
# Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
# Note that the option maxDescLen=0 was added in the default scaffold to sort out the issue
# Too long: must have at most 262144 bytes. By using kubectl to create/update resources an annotation
Copy link
Member

Choose a reason for hiding this comment

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

we need the apply can you please revert

- A way to pause the running of a CronJob, in case something's wrong with it
- Limits on old job history

Remember, since we never read our own status, we need to have some other way to
keep track of whether a job has run. We can use at least one old job to do
Remember, since we never read our status, we need to have another way to track whether a job has run. We can use at least one old job to do
Copy link
Member

Choose a reason for hiding this comment

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

it should be broken in 2 lines, can you please revert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I will revert the changes👍

Corrects various typographical errors in documentation source files and code comments.

Runs 'make generate-docs' to ensure generated documentation, tutorials, and sample project files reflect the corrections and are up-to-date. Addresses generation script conflicts caused by specific typo fixes.
@chethanm99 chethanm99 force-pushed the chore/upgrade-golangci-lint-v2.0.2 branch from 00bd6b5 to 4eddf9c Compare April 22, 2025 13:26
@chethanm99
Copy link
Contributor Author

Hi @camilamacedo86 I've made the requested changes. I would happy to make any further changes.

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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants