Merge pull request #90659 from configurator/patch-1

Simplify GroupVersion.String()
This commit is contained in:
Kubernetes Prow Robot 2020-05-11 10:11:52 -07:00 committed by GitHub
commit 9b44fa4a07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,15 +176,6 @@ func (gv GroupVersion) Empty() bool {
// String puts "group" and "version" into a single "group/version" string. For the legacy v1
// it returns "v1".
func (gv GroupVersion) String() string {
// special case the internal apiVersion for the legacy kube types
if gv.Empty() {
return ""
}
// special case of "v1" for backward compatibility
if len(gv.Group) == 0 && gv.Version == "v1" {
return gv.Version
}
if len(gv.Group) > 0 {
return gv.Group + "/" + gv.Version
}