mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-15 11:39:24 +00:00
refactoring latest.go GroupVersion;
clean up latest.go GroupVersions; remove latest.GroupMeta.Group; remove latest.GroupMeta.Version.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user