Skip to content

Commit

Permalink
Merge pull request #315 from cbron/duration-to-string
Browse files Browse the repository at this point in the history
Switch duration to string to handle k8s metav1.duration
  • Loading branch information
ibuildthecloud committed Oct 30, 2019
2 parents cc004d3 + 8c240cc commit ebecbda
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/types/reflection.go
Expand Up @@ -537,6 +537,9 @@ func (s *Schemas) determineSchemaType(t reflect.Type) (string, error) {
if err != nil {
return "", err
}
if t.Name() == "Duration" && strings.Contains(schema.PkgName, "k8s.io/apimachinery/pkg/apis/meta/v1") {
return "string", nil
}
return schema.ID, nil
default:
return "", fmt.Errorf("unknown type kind %s", t.Kind())
Expand Down

0 comments on commit ebecbda

Please sign in to comment.