Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Aug 5, 2022
1 parent 6fd5980 commit 95e610b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions kyaml/openapi/README.md
Expand Up @@ -31,6 +31,12 @@ You may need to update the version of Kind these scripts use by changing `KIND_V
In this directory, fetch the openapi schema, generate the
corresponding swagger.go for the kubernetes api, and update `kubernetesapi/openapiinfo.go`:

```
make all
```

You can run the steps individually with the following commands:

```
make kustomizationapi/swagger.go
make kubernetesapi/swagger.go
Expand Down
9 changes: 4 additions & 5 deletions kyaml/openapi/openapi.go
Expand Up @@ -573,13 +573,12 @@ func SetSchema(openAPIField map[string]string, schema []byte, reset bool) error

// use builtin version
kubernetesOpenAPIVersion = version
if version == "" {
version = kubernetesapi.DefaultOpenAPI
if kubernetesOpenAPIVersion != "" {
if _, ok := kubernetesapi.OpenAPIMustAsset[kubernetesOpenAPIVersion]; !ok {
return fmt.Errorf("the specified OpenAPI version is not built in")
}
}

if _, ok := kubernetesapi.OpenAPIMustAsset[version]; !ok {
return fmt.Errorf("the specified OpenAPI version is not built in")
}
customSchema = nil
// if the schema is changed, initSchema should parse the new schema
globalSchema.schemaInit = false
Expand Down

0 comments on commit 95e610b

Please sign in to comment.