Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.22] 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) #2351

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sync-config-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.<controlPlane-component>.image.tag will be used
# (where <controlPlane-component is apiServer, controllerManager and scheduler).
# value from controlPlane.distro.k8s.(controlPlane-component).image.tag will be used
# (where controlPlane-component is apiServer, controllerManager and scheduler).
version: ""
# APIServer holds configuration specific to starting the api server.
apiServer:
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,8 @@ type DistroK8s struct {
// 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.<controlPlane-component>.image.tag will be used
// (where <controlPlane-component is apiServer, controllerManager and scheduler).
// value from controlPlane.distro.k8s.(controlPlane-component).image.tag will be used
// (where controlPlane-component is apiServer, controllerManager and scheduler).
Version string `json:"version,omitempty"`

// APIServer holds configuration specific to starting the api server.
Expand Down
6 changes: 6 additions & 0 deletions hack/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ func getReflector() (*jsonschema.Reflector, error) {
}
r.CommentMap = commentMap

for k, comment := range commentMap {
if strings.Contains(comment, "<") || strings.Contains(comment, ">") {
return nil, fmt.Errorf("comment for %s (%s) contains '<' or '>', please remove it because it will break docs generation", k, comment)
}
}

return r, nil
}

Expand Down
Loading