Skip to content

Commit

Permalink
fix: wrong crd api version info (#68)
Browse files Browse the repository at this point in the history
Signed-off-by: amy <[email protected]>
  • Loading branch information
amyXia1994 authored Nov 14, 2023
1 parent 85914c9 commit 38719d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/kube_resource/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ func buildSwagger(crd *apiextensions.CustomResourceDefinition) (*spec.Swagger, e
if err != nil {
return nil, err
}
version := crd.Spec.Version
var version string
if len(crd.Spec.Versions) >= 0 {
version = crd.Spec.Versions[0].Name
} else {
version = crd.Spec.Version
}
setKubeNative(&schema, group, version, kind)
name := fmt.Sprintf("%s.%s.%s", group, version, kind)
schemas[name] = schema
Expand Down

0 comments on commit 38719d8

Please sign in to comment.