Skip to content

Commit

Permalink
chore: use git sparse-checkout for kubernetes files (#93)
Browse files Browse the repository at this point in the history
move input-spec/*.json files out of src/ directory
  • Loading branch information
shinebayar-g authored Feb 6, 2025
1 parent a8de795 commit b552816
Show file tree
Hide file tree
Showing 93 changed files with 186,097 additions and 62,161 deletions.
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ SHELL := /bin/bash
k8sVersion := v1.32.1


# Download Kubernetes OpenAPI schemas to packages/cli/files/kubernetes/api/openapi-spec/v3/*.json
# Download Kubernetes OpenAPI schemas to packages/cli/input-spec/*.json
.PHONY: download-schema
download-schema:
@echo "Downloading Kubernetes schema version $(k8sVersion)"
@cd packages/cli && \
if [ -d "files/kubernetes" ]; then \
echo "kubernetes directory already exists"; \
echo "Updating to version $(k8sVersion)"; \
cd files/kubernetes && git fetch --tags && git checkout $(k8sVersion); \
else \
git clone --depth=1 --branch $(k8sVersion) --single-branch --filter=blob:none \
https://github.com/kubernetes/kubernetes.git files/kubernetes; \
cd files/kubernetes && git fetch --tags && git checkout $(k8sVersion); \
fi
@git clone --depth 1 --branch $(k8sVersion) --filter=blob:none --sparse https://github.com/kubernetes/kubernetes.git temp-k8s && \
cd temp-k8s && \
git sparse-checkout set --no-cone /api/openapi-spec/v3
@rsync -a --delete temp-k8s/api/openapi-spec/v3/ packages/cli/input-spec/
@rm -rf temp-k8s


# Generate packages/cli/src/input-spec/*.json files
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"components": {
"securitySchemes": {
"BearerToken": {
"description": "Bearer Token authentication",
"in": "header",
"name": "authorization",
"type": "apiKey"
}
}
},
"info": {
"title": "Kubernetes",
"version": "unversioned"
},
"openapi": "3.0.0",
"paths": {
"/.well-known/openid-configuration/": {
"get": {
"description": "get service account issuer OpenID configuration, also known as the 'OIDC discovery doc'",
"operationId": "getServiceAccountIssuerOpenIDConfiguration",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
},
"description": "OK"
},
"401": {
"description": "Unauthorized"
}
},
"tags": [
"WellKnown"
]
}
}
}
}
Loading

0 comments on commit b552816

Please sign in to comment.