sigs.k8s.io/cluster-api@v1.7.1/CONTRIBUTING.md (about) 1 # Contributing Guidelines 2 <!-- START doctoc generated TOC please keep comment here to allow auto update --> 3 <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> 4 5 - [Contributor License Agreements](#contributor-license-agreements) 6 - [Finding Things That Need Help](#finding-things-that-need-help) 7 - [Versioning](#versioning) 8 - [Codebase and Go Modules](#codebase-and-go-modules) 9 - [Backporting a patch](#backporting-a-patch) 10 - [APIs](#apis) 11 - [CLIs](#clis) 12 - [Branches](#branches) 13 - [Support and guarantees](#support-and-guarantees) 14 - [Removal of v1alpha3 & v1alpha4 apiVersions](#removal-of-v1alpha3--v1alpha4-apiversions) 15 - [Contributing a Patch](#contributing-a-patch) 16 - [Documentation changes](#documentation-changes) 17 - [Releases](#releases) 18 - [Proposal process (CAEP)](#proposal-process-caep) 19 - [Triaging E2E test failures](#triaging-e2e-test-failures) 20 - [Reviewing a Patch](#reviewing-a-patch) 21 - [Reviews](#reviews) 22 - [Approvals](#approvals) 23 - [Features and bugs](#features-and-bugs) 24 - [Experiments](#experiments) 25 - [Breaking Changes](#breaking-changes) 26 - [Dependency Licence Management](#dependency-licence-management) 27 - [API conventions](#api-conventions) 28 - [Optional vs. Required](#optional-vs-required) 29 - [Example](#example) 30 - [Exceptions](#exceptions) 31 - [CRD additionalPrinterColumns](#crd-additionalprintercolumns) 32 - [Google Doc Viewing Permissions](#google-doc-viewing-permissions) 33 - [Issue and Pull Request Management](#issue-and-pull-request-management) 34 - [Contributors Ladder](#contributors-ladder) 35 36 <!-- END doctoc generated TOC please keep comment here to allow auto update --> 37 38 Read the following guide if you're interested in contributing to cluster-api. 39 40 Contributors who are not used to working in the Kubernetes ecosystem should also take a look at the Kubernetes [New Contributor Course.](https://www.kubernetes.dev/docs/onboarding/) 41 42 ## Contributor License Agreements 43 44 We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles. 45 46 Please fill out either the individual or corporate Contributor License Agreement (CLA). More information about the CLA 47 and instructions for signing it [can be found here](https://git.k8s.io/community/CLA.md). 48 49 ***NOTE***: Only original source code from you and other people that have signed the CLA can be accepted into the 50 *repository. 51 52 ## Finding Things That Need Help 53 54 If you're new to the project and want to help, but don't know where to start, we have a semi-curated list of issues that 55 should not need deep knowledge of the system. [Have a look and see if anything sounds 56 interesting](https://github.com/kubernetes-sigs/cluster-api/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). 57 Before starting to work on the issue, make sure that it doesn't have a [lifecycle/active](https://github.com/kubernetes-sigs/cluster-api/labels/lifecycle%2Factive) label. If the issue has been assigned, reach out to the assignee. 58 Alternatively, read some docs on other controllers and try to write your own, file and fix any/all issues that 59 come up, including gaps in documentation! 60 61 If you're a more experienced contributor, looking at unassigned issues in the next release milestone is a good way to find work that has been prioritized. For example, if the latest minor release is `v1.0`, the next release milestone is `v1.1`. 62 63 Help and contributions are very welcome in the form of code contributions but also in helping to moderate office hours, triaging issues, fixing/investigating flaky tests, being part of the [release team](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/release/release-team.md), helping new contributors with their questions, reviewing proposals, etc. 64 65 ## Versioning 66 67 ### Codebase and Go Modules 68 69 > β The project does not follow Go Modules guidelines for compatibility requirements for 1.x semver releases. 70 71 Cluster API follows upstream Kubernetes semantic versioning. With the v1 release of our codebase, we guarantee the following: 72 73 - A (*minor*) release CAN include: 74 - Introduction of new API versions, or new Kinds. 75 - Compatible API changes like field additions, deprecation notices, etc. 76 - Breaking API changes for deprecated APIs, fields, or code. 77 - Features, promotion or removal of feature gates. 78 - And more! 79 80 - A (*patch*) release SHOULD only include backwards compatible set of bugfixes. 81 82 These guarantees extend to all code exposed in our Go Module, including 83 *types from dependencies in public APIs*. 84 Types and functions not in public APIs are not considered part of the guarantee. 85 The test module, clusterctl, and experiments do not provide any backward compatible guarantees. 86 87 #### Backporting a patch 88 89 We generally do not accept PRs directly against release branches, while we might accept backports of fixes/changes already 90 merged into the main branch. 91 92 Any backport MUST not be breaking for either API or behavioral changes. 93 94 We generally allow backports of following changes to all supported branches: 95 - Critical bugs fixes, security issue fixes, or fixes for bugs without easy workarounds. 96 - Dependency bumps for CVE (usually limited to CVE resolution; backports of non-CVE related version bumps are considered exceptions to be evaluated case by case) 97 - Cert-manager version bumps (to avoid having releases with cert-manager versions that are out of support, when possible) 98 - Changes required to support new Kubernetes versions, when possible. See [supported Kubernetes versions](https://cluster-api.sigs.k8s.io/reference/versions.html#supported-kubernetes-versions) for more details. 99 - Changes to use the latest Go patch version to build controller images. 100 - Changes to bump the Go minor version used to build controller images, if the Go minor version of a supported branch goes out of support (e.g. to pick up bug and CVE fixes). 101 This has no impact on folks importing Cluster API as we won't modify the version in `go.mod` and the version in the `Makefile` does not affect them. 102 103 We generally allow backports of following changes only to the latest supported branch: 104 - Improvements to existing docs (the latest supported branch hosts the current version of the book) 105 - Improvements to CI signal 106 - Improvements to the test framework 107 108 While we recommend to target following type of changes to the next minor release, CAPI maintainers will also consider 109 exceptions for backport of following changes only to the latest supported branch: 110 - Enhancements or additions to experimental Cluster API features, with the goal of allowing faster adoption and iteration; 111 Please note that stability of the branch will always be top priority while evaluating those PRs, and thus approval 112 requires /lgtm from at least two maintainers that, on top of checking that the backport is not introducing any breaking 113 change for either API or behavior, will evaluate if the impact of those backport is limited and well-scoped e.g. 114 by checking that those changes should not touch non-experimental code paths like utils and/or by applying other 115 considerations depending on the specific PR. 116 117 Like any other activity in the project, backporting a fix/change is a community-driven effort and requires that someone volunteers to own the task. 118 In most cases, the cherry-pick bot can (and should) be used to automate opening a cherry-pick PR. 119 120 We generally do not accept backports to Cluster API release branches that are [out of support](https://github.com/kubernetes-sigs/cluster-api/blob/main/CONTRIBUTING.md#support-and-guarantees). 121 122 ### APIs 123 124 API versioning and guarantees are inspired by the [Kubernetes deprecation policy](https://kubernetes.io/docs/reference/using-api/deprecation-policy/) 125 and [API change guidelines](https://github.com/kubernetes/community/blob/f0eec4d19d407c13681431b3c436be67da8c448d/contributors/devel/sig-architecture/api_changes.md). 126 We follow the API guidelines as much as possible adapting them if necessary and on a case-by-case basis to CustomResourceDefinition. 127 128 ### CLIs 129 130 Any command line interface in Cluster API (e.g. clusterctl) share the same versioning schema of the codebase. 131 CLI guarantees are inspired by [Kubernetes deprecation policy for CLI](https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli), 132 however we allow breaking changes after 8 months or 2 releases (whichever is longer) from deprecation. 133 134 ## Branches 135 136 Cluster API has two types of branches: the *main* branch and 137 *release-X* branches. 138 139 The *main* branch is where development happens. All the latest and 140 greatest code, including breaking changes, happens on main. 141 142 The *release-X* branches contain stable, backwards compatible code. On every 143 major or minor release, a new branch is created. It is from these 144 branches that minor and patch releases are tagged. In some cases, it may 145 be necessary to open PRs for bugfixes directly against stable branches, but 146 this should generally not be the case. 147 148 ### Support and guarantees 149 150 Cluster API maintains the most recent release/releases for all supported API and contract versions. Support for this section refers to the ability to backport and release patch versions; 151 [backport policy](#backporting-a-patch) is defined above. 152 153 - The API version is determined from the GroupVersion defined in the top-level `api/` package. 154 - The EOL date of each API Version is determined from the last release available once a new API version is published. 155 156 | API Version | Supported Until | 157 |--------------|-----------------------------------------------------------------------------------------| 158 | **v1beta1** | TBD (current stable) | 159 160 - For the current stable API version (v1beta1) we support the two most recent minor releases; older minor releases are immediately unsupported when a new major/minor release is available. 161 - For older API versions we only support the most recent minor release until the API version reaches EOL. 162 - We will maintain test coverage for all supported minor releases and for one additional release for the current stable API version in case we have to do an emergency patch release. 163 For example, if v1.2 and v1.3 are currently supported, we will also maintain test coverage for v1.1 for one additional release cycle. When v1.4 is released, tests for v1.1 will be removed. 164 165 | Minor Release | API Version | Supported Until | 166 |---------------|--------------|-----------------------------------------------------| 167 | v1.7.x | **v1beta1** | when v1.9.0 will be released | 168 | v1.6.x | **v1beta1** | when v1.8.0 will be released | 169 | v1.5.x | **v1beta1** | EOL since 2024-04-16 - v1.7.0 release date | 170 | v1.4.x | **v1beta1** | EOL since 2023-12-05 - v1.6.0 release date | 171 | v1.3.x | **v1beta1** | EOL since 2023-07-25 - v1.5.0 release date | 172 | v1.2.x | **v1beta1** | EOL since 2023-03-28 - v1.4.0 release date | 173 | v1.1.x | **v1beta1** | EOL since 2022-07-18 - v1.2.0 release date (*) | 174 | v1.0.x | **v1beta1** | EOL since 2022-02-02 - v1.1.0 release date (*) | 175 | v0.4.x | **v1alpha4** | EOL since 2022-04-06 - API version EOL | 176 | v0.3.x | **v1alpha3** | EOL since 2022-02-23 - API version EOL | 177 178 (*) Previous support policy applies, older minor releases were immediately unsupported when a new major/minor release was available 179 180 - Exceptions can be filed with maintainers and taken into consideration on a case-by-case basis. 181 182 ### Removal of v1alpha3 & v1alpha4 apiVersions 183 184 Both v1alpha3 and v1alpha4 have been removed from Cluster API as of release 1.7. 185 186 For more details and latest information please see the following issue: [Removing v1alpha3 & v1alpha4 apiVersions](https://github.com/kubernetes-sigs/cluster-api/issues/8038). 187 188 Note: Removal of a deprecated APIVersion in Kubernetes [can cause issues with garbage collection by the kube-controller-manager](https://github.com/kubernetes/kubernetes/issues/102641) 189 This means that some objects which rely on garbage collection for cleanup - e.g. MachineSets and their descendent objects, like Machines and InfrastructureMachines, may not be cleaned up properly if those 190 objects were created with an APIVersion which is no longer served. 191 To avoid these issues it's advised to ensure a restart to the kube-controller-manager is done after upgrading to a version of Cluster API which drops support for an APIVersion - e.g. v1.5 and v1.6. 192 This can be accomplished with any Kubernetes control-plane rollout, including a Kubernetes version upgrade, or by manually stopping and restarting the kube-controller-manager. 193 194 ## Contributing a Patch 195 196 1. If you haven't already done so, sign a Contributor License Agreement (see details above). 197 1. If working on an issue, signal other contributors that you are actively working on it using `/lifecycle active`. 198 1. Fork the desired repo, develop and test your code changes. 199 1. Submit a pull request. 200 1. All code PR must be labeled with one of 201 - β οΈ (`:warning:`, major or breaking changes) 202 - β¨ (`:sparkles:`, feature additions) 203 - π (`:bug:`, patch and bugfixes) 204 - π (`:book:`, documentation or proposals) 205 - π± (`:seedling:`, minor or other) 206 1. If your PR has multiple commits, you must [squash them into a single commit](https://kubernetes.io/docs/contribute/new-content/open-a-pr/#squashing-commits) before merging your PR. 207 208 Individual commits should not be tagged separately, but will generally be 209 assumed to match the PR. For instance, if you have a bugfix in with 210 a breaking change, it's generally encouraged to submit the bugfix 211 separately, but if you must put them in one PR, mark the commit 212 separately. 213 214 All changes must be code reviewed. Coding conventions and standards are explained in the official [developer 215 docs](https://git.k8s.io/community/contributors/devel). Expect reviewers to request that you 216 avoid common [go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. 217 218 ## Documentation changes 219 220 The documentation is published in form of a book at: 221 222 - [Current stable release](https://cluster-api.sigs.k8s.io) 223 - [Tip of the main branch](https://main.cluster-api.sigs.k8s.io/) 224 - [v1alpha4 release branch](https://release-0-4.cluster-api.sigs.k8s.io/) 225 - [v1alpha3 release branch](https://release-0-3.cluster-api.sigs.k8s.io/) 226 - [v1alpha2 release branch](https://release-0-2.cluster-api.sigs.k8s.io/) 227 228 The source for the book is [this folder](https://github.com/kubernetes-sigs/cluster-api/tree/main/docs/book/src) 229 containing markdown files and we use [mdBook][] to build it into a static 230 website. 231 232 After making changes locally you can run `make serve-book` which will build the HTML version 233 and start a web server, so you can preview if the changes render correctly at 234 http://localhost:3000; the preview auto-updates when changes are detected. 235 236 Note: you don't need to have [mdBook][] installed, `make serve-book` will ensure 237 appropriate binaries for mdBook and any used plugins are downloaded into 238 `hack/tools/bin/` directory. 239 240 When submitting the PR remember to label it with the π (:book:) icon. 241 242 [mdBook]: https://github.com/rust-lang/mdBook 243 244 ## Releases 245 246 Cluster API release process is described in [this document](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/release/release-cycle.md). 247 248 ## Proposal process (CAEP) 249 250 The Cluster API Enhancement Proposal is the process this project uses to adopt new features, changes to the APIs, changes to contracts between components, or changes to CLI interfaces. 251 252 The [template](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/YYYYMMDD-template.md), and accepted proposals live under [docs/proposals](https://github.com/kubernetes-sigs/cluster-api/tree/main/docs/proposals). 253 254 - Proposals or requests for enhancements (RFEs) MUST be associated with an issue. 255 - Issues can be placed on the roadmap during planning if there is one or more folks 256 that can dedicate time to writing a CAEP and/or implementing it after approval. 257 - A proposal SHOULD be introduced and discussed during the weekly community meetings or on the 258 [Kubernetes SIG Cluster Lifecycle mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle). 259 - Submit and discuss proposals using a collaborative writing platform, preferably Google Docs, share documents with edit permissions with the [Kubernetes SIG Cluster Lifecycle mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle). 260 - A proposal in a Google Doc MUST turn into a [Pull Request](https://github.com/kubernetes-sigs/cluster-api/pulls). 261 - Proposals MUST be merged and in `implementable` state to be considered part of a major or minor release. 262 263 ## Triaging E2E test failures 264 265 When you submit a change to the Cluster API repository as set of validation jobs is automatically executed by 266 prow and the results report is added to a comment at the end of your PR. 267 268 Some jobs run linters or unit test, and in case of failures, you can repeat the same operation locally using `make test lint [etc..]` 269 in order to investigate and potential issues. Prow logs usually provide hints about the make target you should use 270 (there might be more than one command that needs to be run). 271 272 End-to-end (E2E) jobs create real Kubernetes clusters by building Cluster API artifacts with the latest changes. 273 In case of E2E test failures, usually it's required to access the "Artifacts" link on the top of the prow logs page to triage the problem. 274 275 The artifact folder contains: 276 - A folder with the clusterctl local repository used for the test, where you can find components yaml and cluster templates. 277 - A folder with logs for all the clusters created during the test. Following logs/info are available: 278 - Controller logs (only if the cluster is a management cluster). 279 - Dump of the Cluster API resources (only if the cluster is a management cluster). 280 - Machine logs (only if the cluster is a workload cluster) 281 282 In case you want to run E2E test locally, please refer to the [Testing](https://cluster-api.sigs.k8s.io/developer/testing.html#running-unit-and-integration-tests) guide. An overview over our e2e test jobs (and also all our other jobs) can be found in [Jobs](https://cluster-api.sigs.k8s.io/reference/jobs.html). 283 284 ## Reviewing a Patch 285 286 ### Reviews 287 288 > Parts of the following content have been adapted from https://google.github.io/eng-practices/review. 289 290 Any Kubernetes organization member can leave reviews and `/lgtm` a pull request. 291 292 Code reviews should generally look at: 293 294 - **Design**: Is the code well-designed and consistent with the rest of the system? 295 - **Functionality**: Does the code behave as the author (or linked issue) intended? Is the way the code behaves good for its users? 296 - **Complexity**: Could the code be made simpler? Would another developer be able to easily understand and use this code when they come across it in the future? 297 - **Tests**: Does the code have correct and well-designed tests? 298 - **Naming**: Did the developer choose clear names for variable, types, methods, functions, etc.? 299 - **Comments**: Are the comments clear and useful? Do they explain why rather than what? 300 - **Documentation**: Did the developer also update relevant documentation? 301 302 See [Code Review in Cluster API](REVIEWING.md) for a more focused list of review items. 303 304 ### Approvals 305 306 Please see the [Kubernetes community document on pull 307 requests](https://git.k8s.io/community/contributors/guide/pull-requests.md) for more information about the merge 308 process. 309 310 - A PR is approved by one of the project maintainers and owners after reviews. 311 - Approvals should be the very last action a maintainer takes on a pull request. 312 313 ## Features and bugs 314 315 Open [issues](https://github.com/kubernetes-sigs/cluster-api/issues/new/choose) to report bugs, or discuss minor feature implementation. 316 317 Each new issue will be automatically labeled as `needs-triage`; after being triaged by the maintainers the label 318 will be removed and replaced by one of the following: 319 320 - `triage/accepted`: Indicates an issue or PR is ready to be actively worked on. 321 - `triage/duplicate`: Indicates an issue is a duplicate of another open issue. 322 - `triage/needs-information`: Indicates an issue needs more information in order to work on it. 323 - `triage/not-reproducible`: Indicates an issue can not be reproduced as described. 324 - `triage/unresolved`: Indicates an issue that can not or will not be resolved. 325 326 For big feature, API and contract amendments, we follow the CAEP process as outlined below. 327 328 ## Experiments 329 330 Proof of concepts, code experiments, or other initiatives can live under the `exp` folder or behind a feature gate. 331 332 - Experiments SHOULD not modify any of the publicly exposed APIs (e.g. CRDs). 333 - Experiments SHOULD not modify any existing CRD types outside the experimental API group(s). 334 - Experiments SHOULD not modify any existing command line contracts. 335 - Experiments MUST not cause any breaking changes to existing (non-experimental) Go APIs. 336 - Experiments SHOULD introduce utility helpers in the go APIs for experiments that cross multiple components 337 and require support from bootstrap, control plane, or infrastructure providers. 338 - Experiments follow a strict lifecycle: Alpha -> Beta prior to Graduation. 339 - Alpha-stage experiments: 340 - SHOULD not be enabled by default and any feature gates MUST be marked as 'Alpha' 341 - MUST be associated with a CAEP that is merged and in at least a provisional state 342 - MAY be considered inactive and marked as deprecated if the following does not happen within the course of 1 minor release cycle: 343 - Transition to Beta-stage 344 - Active development towards progressing to Beta-stage 345 - Either direct or downstream user evaluation 346 - Any deprecated Alpha-stage experiment MAY be removed in the next minor release. 347 - Beta-stage experiments: 348 - SHOULD be enabled by default, and any feature gates MUST be marked as 'Beta' 349 - MUST be associated with a CAEP that is at least in the experimental state 350 - MUST support conversions for any type changes 351 - MUST remain backwards compatible unless updates are coinciding with a breaking Cluster API release 352 - MAY be considered inactive and marked as deprecated if the following does not happen within the course of 1 minor release cycle: 353 - Graduate 354 - Active development towards Graduation 355 - Either direct or downstream user consumption 356 - Any deprecated Beta-stage experiment MAY be removed after being deprecated for an entire minor release. 357 - Experiment Graduation MUST coincide with a breaking Cluster API release 358 - Experiment Graduation checklist: 359 - [ ] MAY provide a way to be disabled, any feature gates MUST be marked as 'GA' 360 - [ ] MUST undergo a full Kubernetes-style API review and update the CAEP with the plan to address any issues raised 361 - [ ] CAEP MUST be in an implementable state and is fully up-to-date with the current implementation 362 - [ ] CAEP MUST define transition plan for moving out of the experimental api group and code directories 363 - [ ] CAEP MUST define any upgrade steps required for Existing Management and Workload Clusters 364 - [ ] CAEP MUST define any upgrade steps required to be implemented by out-of-tree bootstrap, control plane, and infrastructure providers. 365 366 ## Breaking Changes 367 368 Breaking changes are generally allowed in the `main` branch, as this is the branch used to develop the next minor 369 release of Cluster API. 370 371 There may be times, however, when `main` is closed for breaking changes. This is likely to happen as we near the 372 release of a new minor version. 373 374 Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. 375 These versions have consumers who expect the APIs, behaviors, etc. to remain stable during the lifetime of the patch 376 stream for the minor release. 377 378 Examples of breaking changes include: 379 380 - Removing or renaming a field in a CRD 381 - Removing or renaming a CRD 382 - Removing or renaming an exported constant, variable, type, or function 383 - Updating the version of critical libraries such as controller-runtime, client-go, apimachinery, etc. 384 - Some version updates may be acceptable, for picking up bug fixes, but maintainers must exercise caution when 385 reviewing. 386 387 There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the 388 discretion of the project's maintainers, and must be carefully considered before merging. An example of an allowed 389 breaking change might be a fix for a behavioral bug that was released in an initial minor version (such as `v0.3.0`). 390 391 ## Dependency Licence Management 392 393 Cluster API follows the [license policy of the CNCF](https://github.com/cncf/foundation/blob/main/allowed-third-party-license-policy.md). This sets limits on which 394 licenses dependencies and other artifacts use. For go dependencies only dependencies listed in the `go.mod` are considered dependencies. This is in line with [how dependencies are reviewed in Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/vendor.md#reviewing-and-approving-dependency-changes). 395 396 ## API conventions 397 398 This project follows the [Kubernetes API conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md). Minor modifications or additions to the conventions are listed below. 399 400 ### Optional vs. Required 401 402 * Status fields MUST be optional. Our controllers are patching selected fields instead of updating the entire status in every reconciliation. 403 404 * If a field is required (for our controllers to work) and has a default value specified via OpenAPI schema, but we don't want to force users to set the field, we have to mark the field as optional. Otherwise, the client-side kubectl OpenAPI schema validation will force the user to set it even though it would be defaulted on the server-side. 405 406 Optional fields have the following properties: 407 * An optional field MUST be marked with `+optional` and include an `omitempty` JSON tag. 408 * Fields SHOULD be pointers if there is a good reason for it, for example: 409 * the nil and the zero values (by Go standards) have semantic differences. 410 * Note: This doesn't apply to map or slice types as they are assignable to `nil`. 411 * the field is of a struct type, contains only fields with `omitempty` and you want 412 to prevent that it shows up as an empty object after marshalling (e.g. `kubectl get`) 413 414 #### Example 415 416 When using ClusterClass, the semantic difference is important when you have a field in a template which will 417 have instance-specific different values in derived objects. Because in this case it's possible to set the field to `nil` 418 in the template and then the value can be set in derived objects without being overwritten by the cluster topology controller. 419 420 #### Exceptions 421 422 * Fields in root objects should be kept as scaffolded by kubebuilder, e.g.: 423 ```golang 424 type Machine struct { 425 metav1.TypeMeta `json:",inline"` 426 metav1.ObjectMeta `json:"metadata,omitempty"` 427 428 Spec MachineSpec `json:"spec,omitempty"` 429 Status MachineStatus `json:"status,omitempty"` 430 } 431 type MachineList struct { 432 metav1.TypeMeta `json:",inline"` 433 metav1.ListMeta `json:"metadata,omitempty"` 434 Items []Machine `json:"items"` 435 } 436 ``` 437 438 * Top-level fields in `status` must always have the `+optional` annotation. If we want the field to be always visible even if it 439 has the zero value, it must **not** have the `omitempty` JSON tag, e.g.: 440 * Replica counters like `availableReplicas` in the `MachineDeployment` 441 * Flags expressing progress in the object lifecycle like `infrastructureReady` in `Machine` 442 443 ### CRD additionalPrinterColumns 444 445 All our CRD objects should have the following `additionalPrinterColumns` order (if the respective field exists in the CRD): 446 * Namespace (added automatically) 447 * Name (added automatically) 448 * Cluster 449 * Other fields 450 * Replica-related fields 451 * Phase 452 * Age (mandatory field for all CRDs) 453 * Version 454 * Other fields for -o wide (fields with priority `1` are only shown with `-o wide` and not per default) 455 456 ***NOTE***: The columns can be configured via the `kubebuilder:printcolumn` annotation on root objects. For examples, please see the `./api` package. 457 458 Examples: 459 ```bash 460 kubectl get kubeadmcontrolplane 461 ``` 462 ```bash 463 NAMESPACE NAME INITIALIZED API SERVER AVAILABLE REPLICAS READY UPDATED UNAVAILABLE AGE VERSION 464 quick-start-d5ufye quick-start-ntysk0-control-plane true true 1 1 1 2m44s v1.23.3 465 ``` 466 ```bash 467 kubectl get machinedeployment 468 ``` 469 ```bash 470 NAMESPACE NAME CLUSTER REPLICAS READY UPDATED UNAVAILABLE PHASE AGE VERSION 471 quick-start-d5ufye quick-start-ntysk0-md-0 quick-start-ntysk0 1 1 1 ScalingUp 3m28s v1.23.3 472 ``` 473 474 ## Google Doc Viewing Permissions 475 476 To gain viewing permissions to google docs in this project, please join either the 477 [kubernetes-dev](https://groups.google.com/forum/#!forum/kubernetes-dev) or 478 [kubernetes-sig-cluster-lifecycle](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle) google 479 group. 480 481 ## Issue and Pull Request Management 482 483 Anyone may comment on issues and submit reviews for pull requests. However, in order to be assigned an issue or pull 484 request, you must be a member of the [Kubernetes SIGs](https://github.com/kubernetes-sigs) GitHub organization. 485 486 If you are a Kubernetes GitHub organization member, you are eligible for membership in the Kubernetes SIGs GitHub 487 organization and can request membership by [opening an 488 issue](https://github.com/kubernetes/org/issues/new?template=membership.md&title=REQUEST%3A%20New%20membership%20for%20%3Cyour-GH-handle%3E) 489 against the kubernetes/org repo. 490 491 However, if you are a member of the related Kubernetes GitHub organizations but not of the Kubernetes org, you 492 will need explicit sponsorship for your membership request. You can read more about Kubernetes membership and 493 sponsorship [here](https://git.k8s.io/community/community-membership.md). 494 495 Cluster API maintainers can assign you an issue or pull request by leaving a `/assign <your Github ID>` comment on the 496 issue or pull request. 497 498 ## Contributors Ladder 499 500 New contributors are welcomed to the community by existing members, helped with PR workflow, and directed to relevant documentation and communication channels. 501 We are also committed in helping people willing to do so in stepping up through the contributor ladder and this paragraph describes how we are trying to make this to happen. 502 503 As the project adoption increases and the codebase keeps growing, weβre trying to break down ownership into self-driven subareas of interest. 504 Requirements from the [Kubernetes community membership guidelines](https://github.com/kubernetes/community/blob/master/community-membership.md) apply for reviewers, maintainers and any member of these subareas. 505 Whenever you meet requisites for taking responsibilities in a subarea, the following procedure should be followed: 506 1. Submit a PR. 507 2. Propose at community meeting. 508 3. Get positive feedback and +1s in the PR and wait one week lazy consensus after agreement. 509 510 As of today there are following OWNERS files/Owner groups defining sub areas: 511 - [Clusterctl](https://github.com/kubernetes-sigs/cluster-api/tree/main/cmd/clusterctl) 512 - [kubeadm Bootstrap Provider (CABPK)](https://github.com/kubernetes-sigs/cluster-api/tree/main/bootstrap/kubeadm) 513 - [kubeadm Control Plane Provider (KCP)](https://github.com/kubernetes-sigs/cluster-api/tree/main/controlplane/kubeadm) 514 - [Cluster Managed topologies, ClusterClass](https://github.com/kubernetes-sigs/cluster-api/tree/main/internal/controllers/topology) 515 - [Infrastructure Provider Docker (CAPD)](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/infrastructure/docker) 516 - [Infrastructure Provider in-memory](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/infrastructure/inmemory) 517 - [Test](https://github.com/kubernetes-sigs/cluster-api/tree/main/test) 518 - [Test Framework](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/framework) 519 - [Docs](https://github.com/kubernetes-sigs/cluster-api/tree/main/docs)