refactoring latest.go GroupVersion;

clean up latest.go GroupVersions;
remove latest.GroupMeta.Group;
remove latest.GroupMeta.Version.
This commit is contained in:
Chao Xu
2015-11-16 10:34:28 -08:00
parent 851ed7a9f2
commit 6e192760e3
32 changed files with 82 additions and 107 deletions

View File

@@ -23,6 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/registered"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
)
@@ -97,7 +98,7 @@ func (g GroupMetaMap) AllPreferredGroupVersions() string {
}
var defaults []string
for _, groupMeta := range g {
defaults = append(defaults, groupMeta.GroupVersion)
defaults = append(defaults, groupMeta.GroupVersion.String())
}
sort.Strings(defaults)
return strings.Join(defaults, ",")
@@ -105,16 +106,8 @@ func (g GroupMetaMap) AllPreferredGroupVersions() string {
// GroupMeta stores the metadata of a group, such as the latest supported version.
type GroupMeta struct {
// GroupVersion represents the current external default version of the group. It
// is in the form of "group/version".
GroupVersion string
// Version represents the current external default version of the group.
// It equals to the "version" part of GroupVersion.
Version string
// Group represents the name of the group
Group string
// GroupVersion represents the current external default version of the group.
GroupVersion unversioned.GroupVersion
// Versions is the list of versions that are recognized in code. The order
// provided is assumed to be from the oldest to the newest, e.g.,
@@ -125,7 +118,7 @@ type GroupMeta struct {
// GroupVersions is Group + Versions. This is to avoid string concatenation
// in many places.
GroupVersions []string
GroupVersions []unversioned.GroupVersion
// Codec is the default codec for serializing output that should use
// the latest supported version. Use this Codec when writing to