Skip to content

Commit

Permalink
book: use generated RuntimeSDK schema YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Jul 6, 2022
1 parent c8b474f commit 8f8a851
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
13 changes: 11 additions & 2 deletions docs/book/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ MDBOOK := $(TOOLS_BIN_DIR)/mdbook
$(MDBOOK):
$(CRATE_INSTALL) --git rust-lang/mdBook --tag v0.4.11 --to $(TOOLS_BIN_DIR) --force

RUNTIME_OPENAPI_GEN_BIN := runtime-openapi-gen
RUNTIME_OPENAPI_GEN := $(abspath $(TOOLS_BIN_DIR)/$(RUNTIME_OPENAPI_GEN_BIN))

runtimesdk-yaml:
$(MAKE) -C $(ROOT_DIR)/../../ $(RUNTIME_OPENAPI_GEN_BIN)
$(RUNTIME_OPENAPI_GEN) --version book --output-file ./src/tasks/experimental-features/runtime-sdk/runtime-sdk-openapi.yaml

BOOK_DEPS := runtimesdk-yaml

.PHONY: serve
serve: $(MDBOOK) $(TABULATE) $(EMBED) $(RELEASELINK)
serve: $(MDBOOK) $(TABULATE) $(EMBED) $(RELEASELINK) runtimesdk-yaml
$(MDBOOK) serve

.PHONY: build
build: $(MDBOOK) $(TABULATE) $(EMBED) $(RELEASELINK)
build: $(MDBOOK) $(TABULATE) $(EMBED) $(RELEASELINK) runtimesdk-yaml
$(MDBOOK) build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated via make
runtime-sdk-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ message: "error message if status == Failure"
retryAfterSeconds: 10
```
For additional details, refer to the [Draft OpenAPI spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/kubernetes-sigs/cluster-api/main/docs/proposals/images/runtime-hooks/runtime-hooks-openapi.yaml).
For additional details, you cann see the schema in <button onclick="openSwaggerUI()">Swagger UI</button>.
(*) The objects which are part of a Cluster topology are the infrastructure Cluster, the Control Plane, the
MachineDeployments and the templates derived from the ClusterClass.
Expand Down Expand Up @@ -253,3 +253,10 @@ retryAfterSeconds: 10
```

For additional details, refer to the [Draft OpenAPI spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/kubernetes-sigs/cluster-api/main/docs/proposals/images/runtime-hooks/runtime-hooks-openapi.yaml).

<script>
function openSwaggerUI() {
var schemaURL = new URL("runtime-sdk-openapi.yaml", document.baseURI).href
window.open("https://editor.swagger.io/?url=" + schemaURL)
}
</script>
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@
to = "http://main.cluster-api.sigs.k8s.io/:splat"
status = 301
force = true

[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "*"
Access-Control-Allow-Methods = "*"

0 comments on commit 8f8a851

Please sign in to comment.