blob: a66b7b721b55ea97dc017b7218f06ba83d5b3930 [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
MichaelMorrisd4a002d2022-11-08 14:14:18 +000023Latest 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>`
Tomasz Wrobelac69ef12021-05-18 16:04:25 +020024
25
26Validation
27----------
28Application executes two types of validation:
29
30* Deployable (basic validation) - verify correct chart rendering.
31* Lint (optional) - verify syntax of charts, it can be turned on/off by request parameter.
32
33**Request parameters:**
34
35* versionDesired - Helm Client version, which will be used to validation (list of supported versions can be received */versions* endpoint), available formats:
36
37 - Semantic version [X.Y.Z] e.g 3.5.2
38 - Major version [vX] - uses latest of available major version, e.g: v3 uses latest 3.Y.Z version.
39
40* isLinted - turn on/off lint validation
41* isStrictLinted - turn on/off strict lint - if lint validation detects any warning, it marks chart as invalid.
42
43
44Example usage
45-------------
46
47**Supported versions** (/versions)
48Request:
49
50.. code-block:: bash
51
52 curl -X 'GET' \
53 'http://<host>:<port>/versions' \
54 -H 'accept: */*'
55
56E.g:
57
58.. code-block:: bash
59
60 curl -X 'GET' \
61 'http://localhost:8080/versions' \
62 -H 'accept: */*'
63
64Sample response:
65
66.. code-block:: json
67
68 {"versions":
69 ["3.5.2",
70 "3.4.1",
71 "3.3.4"]}
72
73**Validation** (/validate)
74
75Request:
76
77.. code-block:: bash
78
79 curl -X 'POST' \
80 'http://<HOST>:<PORT>/validate' \
81 -H 'accept: application/json' \
82 -H 'Content-Type: multipart/form-data' \
83 -F 'versionDesired=<Helm client version>' \
84 -F 'file=@<path to file in .tgz format>;type=application/x-compressed-tar' \
85 -F 'isLinted=true' \
86 -F 'isStrictLinted=true'
87
88E.g:
89
90.. code-block:: bash
91
92 curl -X 'POST' \
93 'http://localhost:8080/validate' \
94 -H 'accept: application/json' \
95 -H 'Content-Type: multipart/form-data' \
96 -F 'versionDesired=3.5.2' \
97 -F 'file=@correct-apiVersion-v2.tgz;type=application/x-compressed-tar' \
98 -F 'isLinted=true' \
99 -F 'isStrictLinted=true'
100
101Sample response:
102
103.. code-block:: json
104
105 {
106 "renderErrors": [],
107 "lintWarning": [],
108 "lintError": [],
109 "versionUsed": "3.5.2",
110 "valid": true,
111 "deployable": true
112 }
113
114
115
116Usage within SDC
117----------------
118
119The Helm validator is triggered by the SDC onboarding BE in CNF package onboarding use-cases.
120
121
122.. _sdc_helm_validator_repository:
123
124Project repository
125------------------
126
127`SDC Helm Validator repository <https://gerrit.onap.org/r/admin/repos/sdc/sdc-helm-validator>`_