Skip to content

Commit

Permalink
add apiregistration schema
Browse files Browse the repository at this point in the history
was not being published until mid 1.27 release cycle

kubernetes/kubernetes#118879
  • Loading branch information
alexzielenski committed Apr 17, 2024
1 parent e1c86cc commit a1ea4a2
Show file tree
Hide file tree
Showing 7 changed files with 14,021 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 a1ea4a2

Please sign in to comment.