Skip to content

Commit

Permalink
Merge pull request #116 from alexzielenski/add-apiregistratoin
Browse files Browse the repository at this point in the history
add apiregistration schema
  • Loading branch information
k8s-ci-robot authored Apr 17, 2024
2 parents 7e1f1c6 + b0a949e commit 69421c1
Show file tree
Hide file tree
Showing 8 changed files with 14,023 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/download-builtin-schemas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ func main() {
}

// Versions 1.0-1.22 did not have OpenAPIV3 schemas.
one27Fetcher := openapiclient.NewGitHubBuiltins("1.27")
one27Paths, err := one27Fetcher.Paths()

if err != nil {
panic(err)
}

apiregistrationV1Path := "apis/apiregistration.k8s.io/v1"
one27APIRegistrationV1 := one27Paths[apiregistrationV1Path]

for i := 23; ; i++ {
version := fmt.Sprintf("1.%d", i)
fetcher := openapiclient.NewGitHubBuiltins(version)
Expand All @@ -47,6 +57,13 @@ func main() {
break
}

if i < 27 {
// Copy over the APIRegistrationV1 schema from 1.27 in older
// releasees due to
// https://github.com/kubernetes/kubernetes/pull/118879
schemas[apiregistrationV1Path] = one27APIRegistrationV1
}

for k, v := range schemas {
data, err := v.Schema("application/json")
if err != nil {
Expand Down
Loading

0 comments on commit 69421c1

Please sign in to comment.