Skip to content

Commit 2eb9e72

Browse files
committed
schema: Import various Affinity definitions from Kubernetes API
From kubernetes/spec/api/openapi-spec/v3/api__v1_openapi.json Imported with their original names under components.schemas to simplify ```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 ``` schema: import k8s resources related to affinity
1 parent cc062df commit 2eb9e72

File tree

1 file changed

+264
-23
lines changed

1 file changed

+264
-23
lines changed

0 commit comments

Comments
 (0)