[COMMON] Remove hostPath entries
[oom.git] / CONTRIBUTING.md
1 <!---
2 Copyright © 2021 Orange
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 -->
16
17 # Contributing to OOM
18
19 Thanks for taking the time to contribute to OOM!
20 Please see some information on how to do it.
21
22 ## How to become a contributor and submit your own code
23
24 ### Environment setup
25 In order to be able to check on your side before submitting, you'll need to install some binaries:
26
27 * helm (satisfying the targeted version as seen in [setup guide](
28 docs/oom_cloud_setup_guide.rst#software-requirements)).
29 * chartmuseum (in order to push dependency charts)
30 * helm push (version 0.10.1 as of today)
31 * make
32
33 ### Linting and testing
34 OOM uses helm linting in order to check that the template rendering is correct with default values.
35
36 The first step is to start chartmuseum:
37
38 ``` shell
39 nohup chartmuseum --storage="local" --storage-local-rootdir="/tmp/chartstorage" \
40   --port 6464 &
41 ```
42 or
43 ``` shell
44 docker-compose up
45 ```
46
47 then you add a `local` repository to helm:
48 ```shell
49 helm repo remove local || helm repo add local http://localhost:6464
50 ```
51
52 As full rendering may be extremely long (~9h), you may only want to lint the common part and the component you're working on.
53 Here's an example with AAI:
54 ```shell
55 cd kubernetes
56 make common && make aai
57 ```
58
59 If you work on a non default path, it's strongly advised to also render the
60 template of your component / subcomponent to be sure it's as expected.
61
62 Here's an example enabling service mesh on aai graphadmin:
63
64 ```shell
65 cd aai/components/
66 helm template --release-name onap --debug \
67   --set global.ingress.virtualhost.baseurl=toto \
68   --set global.ingress.enabled=true \
69   --set global.masterPassword="toto" \
70   --set global.serviceMesh.enabled=true \
71   --set global.serviceMesh.tls=true \
72   aai-graphadmin
73 ```
74 All the output will be rendered YAML if everything works as expected or an error if something goes wrong.
75 Usually the errors come from bad indentation or unknown values.
76
77 ### Contributing a Patch
78 1. Fork the desired repo, develop and test your code changes.
79 2. Sign the LFN CLA (<https://www.onap.org/cla>)
80 3. Submit a pull request.
81 4. Work with the reviewers on their suggestions.
82 5. Ensure to rebase to the HEAD of your target branch and [squash un-necessary commits](https://blog.carbonfive.com/always-squash-and-rebase-your-git-commits/)
83    before finally mergin your contribution.