You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -15,22 +15,22 @@ Follow either of the two links above to access the appropriate CLA and instructi
15
15
16
16
## Composition of This Repository and Where/How to Contribute
17
17
18
-
The repository of the Kubernetes Python client consists of this main repository and a submodule, the [python-base](https://github.com/kubernetes-client/python-base) repository. The main repository contains mostly files that are generated by the OpenAPI generator from [this OpenAPI spec](scripts/swagger.json). The base repo is the utility part of the python client and allows developers to create their own kubernetes clients.
18
+
The Kubernetes Python client consists of this main repository (repo) and the base repo, the [python-base](https://github.com/kubernetes-client/python-base) repository. The main repository contains mostly files that are generated by the OpenAPI generator from [this OpenAPI spec](scripts/swagger.json). The base repo is the utility part of the python client and allows developers to create their own kubernetes clients. The base repo is a submodule of the main repo.
19
19
20
20
### Where to Submit Your Patch
21
21
22
-
These folders are automatically generated. You will need to submit a patch to the upstream kubernetes repo [kubernetes](https://github.com/kubernetes/kubernetes) or the OpenAPI generator repo [openapi-generator](https://github.com/OpenAPITools/openapi-generator). This contains:
22
+
The following folders are automatically generated. You will need to submit a patch to the upstream Kubernetes repo [kubernetes](https://github.com/kubernetes/kubernetes) or the OpenAPI generator repo [openapi-generator](https://github.com/OpenAPITools/openapi-generator).
23
23
-[kubernetes/client](kubernetes/client)
24
24
-[kubernetes/test](kubernetes/test)
25
25
-[kubernetes/docs](kubernetes/docs).
26
26
27
-
These folders contain developer written codes in the main repo and the patches should be submitted here:
27
+
In this main repo, the following folders contain developer written codes and the patches should be submitted as pull requests here:
28
28
-[kubernetes/e2e_test](kubernetes/e2e_test)
29
29
-[kubernetes/utils](kubernetes/utils)
30
30
-[examples](examples)
31
31
-[scripts](scripts).
32
32
33
-
The base repo contains developer written codes only. The patches should be sent to the base repo instead. The scope covers these repos and symbolic links in the main repo:
33
+
The following folders and symbolic links in this main repo are in fact from the base repo. The base repo contains developer written codes only. The patches should be sent to the base repo instead:
34
34
- kubernetes/base
35
35
- kubernetes/config
36
36
- kubernetes/stream
@@ -50,39 +50,39 @@ If your patch depends on new packages, add those packages to [requirements.txt](
50
50
51
51
### Commits
52
52
53
-
Generally we would like to see one commit per pull request. However, if the pull request is reasonably large, the PR can be divided into several commits that make logical sense. The commit message should be clear and indicative of the aim of the fix.
53
+
Generally we would like to see one commit per pull request. However, if the pull request is reasonably large, the PR can be divided into several commits that make logical sense. The commit message should be clear and indicative of the aim of the fix. Sometimes multiple commits in a single pull request is acceptable if it meets the Kubernetes [pull request guidelines](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#6-squashing-and-commit-titles).
54
54
55
55
If you have several commits in a pull request and have been asked to squash your commits, please use ```git reset --soft HEAD~N_COMMITS``` and commit again to make your PR a single commit.
56
56
57
57
### Windows Developers
58
58
59
-
The symbolic links contained in this repo does not work for Windows operating systems. If you are a Windows developer, please run the [fix](scripts/windows-setup-fix.bat) inside the scripts folder or manually copy the content of the [kubernetes/base](https://github.com/kubernetes-client/python-base) folder into the [kubernetes](kubernetes) folder.
59
+
The symbolic links contained in this repo do not work for Windows operating systems. If you are a Windows developer, please run the [fix](scripts/windows-setup-fix.bat) inside the scripts folder or manually copy the content of the [kubernetes/base](https://github.com/kubernetes-client/python-base) folder into the [kubernetes](kubernetes) folder.
60
60
61
61
### Writing Tests
62
62
63
-
In addition to running the your fix yourself and tell us that your fix works, you can demonstrate that your fix really works by using unit tests and end to end tests. These unit tests are mainly located in three places. You should put your tests into the places that they fit in.
63
+
In addition to running the fix yourself and telling us that your fix works, you can demonstrate that your fix really works by using unit tests and end to end tests. Tests are mainly located in three places. You should put your tests into the places that they fit in.
64
64
65
65
1.[Generated tests](kubernetes/test) by OpenAPI generator: these tests should pass and do not require modification.
66
66
2.[End to end tests](kubernetes/e2e_test): these are tests that can only be verified with a live kubernetes server.
67
67
3. Base repo tests in the [base](https://github.com/kubernetes-client/python-base) repo, in which the test files are named ```test_*.py```: These tests use the package ```Mock``` and confirms the functionality of the base repo files.
68
68
69
69
### Coding Style
70
70
71
-
We use an automatic coding style checker by using the ```diff``` of the autopep8 output and your code file. To make sure that your code passes the coding style checker, run ```autopep8 --in-place --aggressive --aggressive your_code.py``` before committing and submission.
71
+
We use an automatic coding style checker by using the ```diff``` of the autopep8 output and your code file. To make sure that your code passes the coding style checker, run ```autopep8 --in-place --aggressive --aggressive your_code.py``` before committing and submitting.
72
72
73
73
## Running Tests Locally
74
74
75
75
If you write a new end to end (e2e) test, or change behaviors that affect e2e tests, you should set up a local cluster and test them on your machine. The following steps will help you run the unit tests.
76
76
77
-
1. Acquire a local cluster. [Minikube](https://github.com/kubernetes/minikube) is a good choice for Windows and Linux developers. Alternatively if you are on Linux, you can clone the [kubernetes](https://github.com/kubernetes/kubernetes) and run [install-etcd.sh](https://github.com/kubernetes/kubernetes/blob/master/hack/install-etcd.sh) and then [local-up-cluster.sh](https://github.com/kubernetes/kubernetes/blob/master/hack/local-up-cluster.sh) to get a local cluster up and running.
77
+
1. Acquire a local cluster. [Minikube](https://github.com/kubernetes/minikube) is a good choice for Windows and Linux developers. Alternatively if you are on Linux, you can clone the [kubernetes](https://github.com/kubernetes/kubernetes)repo and run [install-etcd.sh](https://github.com/kubernetes/kubernetes/blob/master/hack/install-etcd.sh) and then [local-up-cluster.sh](https://github.com/kubernetes/kubernetes/blob/master/hack/local-up-cluster.sh) to get a local cluster up and running.
78
78
79
79
2. Run the unit tests. In the root directory of the main repo, run ```python -m unittest discover```.
80
80
81
81
3. Check the test results and make corresponding fixes.
82
82
83
83
## Update the Base Submodule in the Main Repo After Your python-base PR Is Merged
84
84
85
-
Your contribution of the base repo will not be automatically reflected in the main repo after your PR is merged. Instead, please update the ```base``` submodule in your fork of the main repo as follows:
85
+
Your contribution to the base repo will not be automatically reflected in the main repo after your PR is merged. Instead, please update the ```base``` submodule in your fork of the main repo as follows:
0 commit comments