From 4ff82b39aaf3c64793d26dcbdb55703c3729ae1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bojanowski?= Date: Wed, 18 Dec 2024 16:22:26 +0100 Subject: [PATCH] add checking for invalid characters that will break .mdx generation in docs to hack/schema/main.go; fix sync-config-schema.yaml vcluster-config syncing (#2348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Bojanowski --- .github/workflows/sync-config-schema.yaml | 2 +- chart/values.schema.json | 2 +- chart/values.yaml | 4 ++-- config/config.go | 4 ++-- hack/schema/main.go | 6 ++++++ 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-config-schema.yaml b/.github/workflows/sync-config-schema.yaml index c34a22fdd..179a2fb25 100644 --- a/.github/workflows/sync-config-schema.yaml +++ b/.github/workflows/sync-config-schema.yaml @@ -135,8 +135,8 @@ jobs: GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} RELEASE_TAG: ${{ steps.release.outputs.release_tag }} run: | + rm -rf vcluster-config/ || true git clone --single-branch https://github.com/loft-sh/vcluster-config.git - # copy generated schema from vcluster chart values to vcluster-config cp chart/values.schema.json vcluster-config/values.schema.json cp -R config/. vcluster-config/config/ diff --git a/chart/values.schema.json b/chart/values.schema.json index 10e49e539..c6394de1f 100755 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -1041,7 +1041,7 @@ }, "version": { "type": "string", - "description": "Version specifies k8s components (scheduler, kube-controller-manager \u0026 apiserver) version.\nIt is a shortcut for controlPlane.distro.k8s.apiServer.image.tag,\ncontrolPlane.distro.k8s.controllerManager.image.tag and\ncontrolPlane.distro.k8s.scheduler.image.tag\nIf e.g. controlPlane.distro.k8s.version is set to v1.30.1 and\ncontrolPlane.distro.k8s.scheduler.image.tag\n(or controlPlane.distro.k8s.controllerManager.image.tag or controlPlane.distro.k8s.apiServer.image.tag)\nis set to v1.31.0,\nvalue from controlPlane.distro.k8s.\u003ccontrolPlane-component\u003e.image.tag will be used\n(where \u003ccontrolPlane-component is apiServer, controllerManager and scheduler)." + "description": "Version specifies k8s components (scheduler, kube-controller-manager \u0026 apiserver) version.\nIt is a shortcut for controlPlane.distro.k8s.apiServer.image.tag,\ncontrolPlane.distro.k8s.controllerManager.image.tag and\ncontrolPlane.distro.k8s.scheduler.image.tag\nIf e.g. controlPlane.distro.k8s.version is set to v1.30.1 and\ncontrolPlane.distro.k8s.scheduler.image.tag\n(or controlPlane.distro.k8s.controllerManager.image.tag or controlPlane.distro.k8s.apiServer.image.tag)\nis set to v1.31.0,\nvalue from controlPlane.distro.k8s.(controlPlane-component).image.tag will be used\n(where controlPlane-component is apiServer, controllerManager and scheduler)." }, "apiServer": { "$ref": "#/$defs/DistroContainerEnabled", diff --git a/chart/values.yaml b/chart/values.yaml index 0490e84fb..2091eec97 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -161,8 +161,8 @@ controlPlane: # controlPlane.distro.k8s.scheduler.image.tag # (or controlPlane.distro.k8s.controllerManager.image.tag or controlPlane.distro.k8s.apiServer.image.tag) # is set to v1.31.0, - # value from controlPlane.distro.k8s..image.tag will be used - # (where .image.tag will be used - // (where ") { + return nil, fmt.Errorf("comment for %s (%s) contains '<' or '>', please remove it because it will break docs generation", k, comment) + } + } + return r, nil }