[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 ## Local setup
23
24 ### Install helm-push plugin
25
26 In order to push locally built charts to chartmuseum, the `helm-push` plugin must be installed. You can do that with:
27
28 ```sh
29 $ helm plugin install https://github.com/chartmuseum/helm-push
30 Downloading and installing helm-push v0.10.4 ...
31 https://github.com/chartmuseum/helm-push/releases/download/v0.10.3/helm-push_0.10.4_linux_amd64.tar.gz
32 Installed plugin: cm-push
33 ```
34
35 ### Run chartmuseum
36
37 ``` shell
38 mkdir -p charts && docker-compose up
39 ```
40 or
41 ``` shell
42 nohup chartmuseum --storage="local" --storage-local-rootdir="/tmp/chartstorage" \
43   --port 6464 &
44 ```
45
46 ### Add a `local` chart repository
47
48 OOM contains `make` files that build the charts and push them to the local chartmuseum.
49 For that to work, helm needs to know about the `local` helm repository.
50 ```shell
51 helm repo remove local; helm repo add local http://localhost:6464
52 ```
53
54 ### Linting and testing
55 OOM uses helm linting in order to check that the template rendering is correct with default values.
56
57 As full rendering may be extremely long (~9h), you may only want to lint the common part and the component you're working on.
58 Here's an example with AAI:
59 ```shell
60 cd kubernetes
61 make common && make aai
62 ```
63
64 If you work on a non default path, it's strongly advised to also render the
65 template of your component / subcomponent to be sure it's as expected.
66
67 Here's an example enabling service mesh on aai graphadmin:
68
69 ```shell
70 cd aai/components/
71 helm template --release-name onap --debug \
72   --set global.ingress.virtualhost.baseurl=toto \
73   --set global.ingress.enabled=true \
74   --set global.masterPassword="toto" \
75   --set global.serviceMesh.enabled=true \
76   --set global.serviceMesh.tls=true \
77   aai-graphadmin
78 ```
79 All the output will be rendered YAML if everything works as expected or an error if something goes wrong.
80 Usually the errors come from bad indentation or unknown values.
81
82 ### Contributing a Patch
83 1. Fork the desired repo, develop and test your code changes.
84 2. Sign the LFN CLA (<https://www.onap.org/cla>)
85 3. Submit a pull request.
86 4. Work with the reviewers on their suggestions.
87 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/)
88    before finally mergin your contribution.