docs: write the Kubebuilder reference, translate first-commiter - #44
Open
whg517 wants to merge 2 commits into
Open
docs: write the Kubebuilder reference, translate first-commiter#44whg517 wants to merge 2 commits into
whg517 wants to merge 2 commits into
Conversation
Replaces a one-line placeholder that also misspelled the title as "Kuberbuilder". Scoped to the parts of Kubebuilder this project actually uses rather than restating the upstream book. Facts come from the repositories: the PROJECT file and its domain/layout, the controller-gen and kustomize versions pinned in the Makefile, and a marker inventory taken by grepping the API packages of operator-go, zookeeper-operator and spark-k8s-operator so the tables list markers that are genuinely in use. Documents two failure modes this project has already hit. Markers are case-sensitive. `+kubebuilder:validation:optional` with a lowercase o is not a marker; controller-gen ignores it silently and the field falls back to the rule that a field without omitempty is required. Nothing warns, the build succeeds, and the field lands in the CRD's required list. zookeeper-operator has exactly this on ClusterConfigSpec.ListenerClass today, and the generated CRD shows `required: [listenerClass]` as a result. The page gives the grep that reveals it. The second is +kubebuilder:default on fields inside `config`, which breaks the role to role group fold — same reason already recorded in the development guideline, restated here because this is where someone reaches for the marker. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…in it The English page held Chinese prose and was byte-identical to its zh counterpart — the second of the two cases AGENTS.md flags, and the last one. The English tree is now English throughout. Translating surfaced two errors that were in both copies: The upstream remote was `https://github.com/kubedoop.dev/docs`. kubedoop.dev is the documentation site's domain, not a GitHub organisation, so that command could never have worked. It is zncdatadev/docs. The merge section explained the problem in terms of "远程的 upstream (swoole/swoole-src)" — a leftover from the Swoole project this text was adapted from. While rewriting: replaced the two-entry feature/fix list with the full branch-naming table the project actually uses, switched `git checkout` to `git switch`, added the force-with-lease step that a first-time contributor hits the moment they rebase an already-pushed branch, and pointed the pre-PR check at `npm run verify`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two pages, both language trees. After this, every placeholder that can be filled from source is filled — the three remaining ones are blocked on things source research cannot supply.
docs(reference): write the Kubebuilder referenceReplaces a one-line placeholder that also misspelled its own title as "Kuberbuilder". Scoped to the parts of Kubebuilder this project actually uses rather than restating the upstream book.
Facts come from the repositories: the
PROJECTfile and itsdomain: kubedoop.dev/layout: go.kubebuilder.io/v4, thecontroller-genv0.19.0 andkustomizev5.7.1 versions pinned in the Makefile, and a marker inventory taken by grepping the API packages ofoperator-go,zookeeper-operatorandspark-k8s-operator— so the tables list markers genuinely in use, not everything Kubebuilder offers.It documents a live bug as the worked example
Markers are case-sensitive.
+kubebuilder:validation:optionalwith a lowercaseois not a marker.controller-genignores it silently, and the field falls back to the rule that a field withoutomitemptyis required. Nothing warns, the build succeeds, and the field lands in the CRD'srequiredlist.zookeeper-operatorhas exactly this today, onClusterConfigSpec.ListenerClass:and the generated CRD shows the consequence:
A field with a default, clearly intended to be optional, is marked required. The page gives the
grepthat reveals this class of problem. This is a bug inzookeeper-operator, not in this repository — worth a separate issue there.docs(developer-manual): translate first-commiter, and fix two errors in itThe English page held Chinese prose and was byte-identical to its
zhcounterpart — the second of the two casesAGENTS.mdflags, and the last one. The English tree is now English throughout.Translating surfaced two errors present in both copies:
git remote add upstream https://github.com/kubedoop.dev/docskubedoop.devis the documentation site's domain, not a GitHub organisation. That command could never have worked. It iszncdatadev/docsWhile rewriting: replaced the two-entry feature/fix list with the full branch-naming table the project actually uses, switched
git checkouttogit switch, added the--force-with-leasestep a first-time contributor hits the moment they rebase an already-pushed branch, and pointed the pre-PR check atnpm run verify.Testing
npm run verifyexits 0 — 52 files linted with 0 errors, both locales builtonBrokenLinks: 'throw')docs/— checked by scanning every fileStage 2 status
3 placeholders remain, none of them fillable from source:
core-concepts/resources/database.mdDatabaseConnection; credential keys and default ports are undefined (see #38)faq.mdrelease-notes.mdThe last two need maintainer input rather than research.
🤖 Generated with Claude Code