Commit 1619aee
schema: Specify config properties for capi, hnc, storage
This adds:
- common reusable things under $defs
- clusterApi
- harbor
- hnc
- objectStorage
- rookCeph
- storageClasses
- user
- velero
Common objects defined by the Kubernetes project are either prefixed
with 'kubernetes' when authored by us, using an 'io.k8s' prefix when
imported directly from the Kubernetes API definitions.
They can be found in the file kubernetes/spec/api/openapi-spec/v3/api__v1_openapi.json
The following script was used to find all referenced objects that were needed.
```bash
set -euxo pipefail
yq4 -i -P 'del(.$defs.kubernetesAffinity)' config/schemas/config.yaml
c="io.k8s.api.core.v1.Affinity" yq4 -i -P '.$defs[env(c)] = load(".../kubernetes/api/openapi-spec/v3/api__v1_openapi.json").components.schemas[env(c)]' config/schemas/config.yaml
c="io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement" yq4 -i -P '.$defs[env(c)] = load(".../kubernetes/api/openapi-spec/v3/api__v1_openapi.json").components.schemas[env(c)]' config/schemas/config.yaml
while grep -qF '#/components/schemas/' config/schemas/config.yaml; do
for component in $(grep -oP "#/components/schemas/[^'\"]*" config/schemas/config.yaml | cut -d/ -f4); do
c="${component}" yq4 -i -P '.$defs[env(c)] = load(".../kubernetes/api/openapi-spec/v3/api__v1_openapi.json").components.schemas[env(c)]' config/schemas/config.yaml
sed -i "s|#/components/schemas/${component}|#/\$defs/${component}|" config/schemas/config.yaml
done
done
```
Co-authored-by: André Arnqvist <58822152+aarnq@users.noreply.github.com>
Co-authored-by: Fredrik Liv <fredrik.liv@elastisys.com>1 parent 7614c4f commit 1619aee
File tree
4 files changed
+1253
-10
lines changed- config/schemas
- tests/common/lib
4 files changed
+1253
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
88 | 100 | | |
89 | 101 | | |
90 | 102 | | |
| |||
0 commit comments