blob: cb4c85f21139e5faecd113eed0cbd5eaa0b07ed9 [file] [log] [blame]
Tomasz Wrobelac69ef12021-05-18 16:04:25 +02001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2021 NOKIA
4
5.. _sdc_helm_validator:
6
7SDC Helm Validator
8==============================
9
10
11General information
12------------------------------
13
14This application can be used to validate CNF Helm charts using a Helm Client. It allows to select Helm version, which will be used to execute validation.
15
16More information could be found in project repository, see :ref:`sdc_helm_validator_repository`.
17
18
19
20Offered API
21-----------
22
23.. Latest Open API model: :download:`OpenAPI.yaml <https://gerrit.onap.org/r/gitweb?p=sdc/sdc-helm-validator.git;a=blob_plain;f=OpenAPI.yaml;hb=refs/heads/master>`
24
25
26Latest Open API model: |sdc-helm-validator-open-api|_
27
28
29Validation
30----------
31Application executes two types of validation:
32
33* Deployable (basic validation) - verify correct chart rendering.
34* Lint (optional) - verify syntax of charts, it can be turned on/off by request parameter.
35
36**Request parameters:**
37
38* versionDesired - Helm Client version, which will be used to validation (list of supported versions can be received */versions* endpoint), available formats:
39
40 - Semantic version [X.Y.Z] e.g 3.5.2
41 - Major version [vX] - uses latest of available major version, e.g: v3 uses latest 3.Y.Z version.
42
43* isLinted - turn on/off lint validation
44* isStrictLinted - turn on/off strict lint - if lint validation detects any warning, it marks chart as invalid.
45
46
47Example usage
48-------------
49
50**Supported versions** (/versions)
51Request:
52
53.. code-block:: bash
54
55 curl -X 'GET' \
56 'http://<host>:<port>/versions' \
57 -H 'accept: */*'
58
59E.g:
60
61.. code-block:: bash
62
63 curl -X 'GET' \
64 'http://localhost:8080/versions' \
65 -H 'accept: */*'
66
67Sample response:
68
69.. code-block:: json
70
71 {"versions":
72 ["3.5.2",
73 "3.4.1",
74 "3.3.4"]}
75
76**Validation** (/validate)
77
78Request:
79
80.. code-block:: bash
81
82 curl -X 'POST' \
83 'http://<HOST>:<PORT>/validate' \
84 -H 'accept: application/json' \
85 -H 'Content-Type: multipart/form-data' \
86 -F 'versionDesired=<Helm client version>' \
87 -F 'file=@<path to file in .tgz format>;type=application/x-compressed-tar' \
88 -F 'isLinted=true' \
89 -F 'isStrictLinted=true'
90
91E.g:
92
93.. code-block:: bash
94
95 curl -X 'POST' \
96 'http://localhost:8080/validate' \
97 -H 'accept: application/json' \
98 -H 'Content-Type: multipart/form-data' \
99 -F 'versionDesired=3.5.2' \
100 -F 'file=@correct-apiVersion-v2.tgz;type=application/x-compressed-tar' \
101 -F 'isLinted=true' \
102 -F 'isStrictLinted=true'
103
104Sample response:
105
106.. code-block:: json
107
108 {
109 "renderErrors": [],
110 "lintWarning": [],
111 "lintError": [],
112 "versionUsed": "3.5.2",
113 "valid": true,
114 "deployable": true
115 }
116
117
118
119Usage within SDC
120----------------
121
122The Helm validator is triggered by the SDC onboarding BE in CNF package onboarding use-cases.
123
124
125.. _sdc_helm_validator_repository:
126
127Project repository
128------------------
129
130`SDC Helm Validator repository <https://gerrit.onap.org/r/admin/repos/sdc/sdc-helm-validator>`_