Skip to content

Commit 8df6feb

Browse files
committed
adjust contrib guide to current project layout
Signed-off-by: Sebastian Hoß <[email protected]>
1 parent 646a94d commit 8df6feb

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To add new custom resource definitions to this project, please follow the steps
1313

1414
### 0. Required Software
1515

16-
In order to run all the commands mentioned below, you will need the following installed on your computer:
16+
To run all the commands mentioned below, you will need the following software installed on your computer:
1717

1818
- `rust`/`cargo`: https://www.rust-lang.org/tools/install
1919
- `kopium`: https://github.com/kube-rs/kopium
@@ -22,10 +22,10 @@ In order to run all the commands mentioned below, you will need the following in
2222

2323
### 1. Add CRD to catalog
2424

25-
All CRDs of this project are managed in the [catalog](https://github.com/metio/kube-custom-resources-rs/blob/main/code-generator/src/catalog.rs) which contains a long list of projects along with the CRDs they are producing. We try to sort this list alphabetically in order to make it easier finding things, but this is not a hard requirement for your contribution. Each entry requires the following details:
25+
All CRDs of this project are managed in the [catalog](https://github.com/metio/kube-custom-resources-rs/blob/main/code-generator/src/catalog.rs) which contains a long list of projects along with the CRDs they are producing. We try to sort this list alphabetically to make it easier finding things, but this is not a hard requirement for your contribution. Each entry requires the following details:
2626

2727
- `project_name`: The organization and name of a project, e.g. `prometheus-operator/prometheus-operator` is used for the project at https://github.com/prometheus-operator/prometheus-operator.
28-
- `license`: The SPDX license identifier for the CRD files. This is usually the same license as the project and the catalog file already contains constants for the most common licenses.
28+
- `license`: The SPDX license identifier for the CRD files. This is usually the same license as the project, and the catalog file already contains constants for the most common licenses.
2929
- `urls`: The list of URLs where CRDs are located. It does not matter if that file contains other Kubernetes resources, our tooling will only extract CRDs from those files.
3030

3131
### 2. Generate Custom Resources
@@ -44,45 +44,22 @@ $ ./code-generator/generate.sh prometheus-operator/prometheus-operator
4444

4545
If no `<project_name>` argument was given, code for all CRDs in the catalog will be generated.
4646

47-
### 3. Check output
47+
### 3. Fix Cargo Warnings
4848

49-
Certain CRDs cannot be correctly converted to Rust code yet. Make sure that each newly generated resource can be compiled by calling:
50-
51-
```console
52-
$ ./code-generator/test-custom-resources.sh <feature_name>
53-
```
54-
55-
The `<feature_name>` argument corresponds to the newly generated folder in `kube-custom-resources-rs/src` for the new CRDs added by yourself.
56-
57-
### 4. Fix Cargo Warnings
58-
59-
The generated code trigger Cargo warnings, fix those automatically with:
49+
The generated code might trigger Cargo warnings, fix those automatically with:
6050

6151
```console
6252
$ ./code-generator/fix-cargo-warnings.sh <feature_name>
6353
```
6454

65-
### 5. Adjust Output
66-
67-
By default, we call kopium with the following arguments:
68-
69-
- `--docs`
70-
- `--filename=...`
71-
- `--derive=Default`
72-
- `--derive=PartialEq`
73-
74-
Some CRDs cannot implement the `Default` trait. In those cases, add an `.args` file next to the downloaded `.yaml` file in the catalog and specify the **derive** directives to use (docs and filename will always be set), e.g.:
75-
76-
```
77-
--derive=PartialEq
78-
```
55+
### 4. Adjust Output
7956

8057
Some CRDs cannot be converted to Rust code at all. In those cases, add an `.ignore` file next to the downloaded `.yaml` file in the catalog and write the reason why this CRD was ignored into the file, e.g.:
8158

8259
```
8360
CRD has no spec field
8461
```
8562

86-
### 6. Open Pull Request
63+
### 5. Open Pull Request
8764

8865
Commit your changes, push them into your fork and open a pull request. Don't worry if certain steps did not work on your machine, we will sort them out during review. Thanks again for contributing :tada::+1:

0 commit comments

Comments
 (0)