mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
add import_known_versions.go
This commit is contained in:
@@ -18,6 +18,7 @@ package install
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
@@ -39,6 +40,7 @@ const importPrefix = "k8s.io/kubernetes/pkg/api"
|
||||
var accessor = meta.NewAccessor()
|
||||
|
||||
func init() {
|
||||
debug.PrintStack()
|
||||
groupMeta, err := latest.RegisterGroup("")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
@@ -47,7 +49,7 @@ func init() {
|
||||
// Use the first API version in the list of registered versions as the latest.
|
||||
registeredGroupVersions := registered.GroupVersionsForGroup("")
|
||||
groupVersion := registeredGroupVersions[0]
|
||||
groupMeta = &latest.GroupMeta{
|
||||
*groupMeta = latest.GroupMeta{
|
||||
GroupVersion: groupVersion,
|
||||
Group: apiutil.GetGroup(groupVersion),
|
||||
Version: apiutil.GetVersion(groupVersion),
|
||||
|
||||
@@ -30,8 +30,10 @@ import (
|
||||
var RegisteredVersions []string
|
||||
|
||||
func init() {
|
||||
// TODO: caesarxuchao: rename this variable to validGroupVersions
|
||||
validAPIVersions := map[string]bool{
|
||||
"v1": true,
|
||||
"v1": true,
|
||||
"experimental/v1": true,
|
||||
}
|
||||
|
||||
// The default list of supported api versions, in order of most preferred to the least.
|
||||
|
||||
Reference in New Issue
Block a user