mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #63202 from deads2k/api-10-selflink
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. remove self linker from group info The self-link is related to RESTStorage, not to the scheme/codec. Also, no one every customized it. This moves it to the single point of use and retains the override potential. @kubernetes/sig-api-machinery-pr-reviews ```release-note NONE ```
This commit is contained in:
commit
c929ec153a
@ -14,7 +14,6 @@ go_library(
|
||||
importpath = "k8s.io/apimachinery/pkg/apimachinery",
|
||||
deps = [
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
],
|
||||
|
@ -150,11 +150,8 @@ func (gmf *GroupMetaFactory) Register(m *registered.APIRegistrationManager, sche
|
||||
gmf.GroupArgs.AddInternalObjectsToScheme(scheme)
|
||||
}
|
||||
|
||||
accessor := meta.NewAccessor()
|
||||
|
||||
groupMeta := &apimachinery.GroupMeta{
|
||||
GroupVersions: externalVersions,
|
||||
SelfLinker: runtime.SelfLinker(accessor),
|
||||
RootScopedKinds: gmf.GroupArgs.RootScopedKinds,
|
||||
}
|
||||
groupMeta.RESTMapper = gmf.newRESTMapper(scheme, externalVersions, groupMeta)
|
||||
|
@ -18,7 +18,6 @@ package apimachinery
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
)
|
||||
@ -30,12 +29,6 @@ type GroupMeta struct {
|
||||
|
||||
RootScopedKinds sets.String
|
||||
|
||||
// SelfLinker can set or get the SelfLink field of all API types.
|
||||
// TODO: when versioning changes, make this part of each API definition.
|
||||
// TODO(lavalamp): Combine SelfLinker & ResourceVersioner interfaces, force all uses
|
||||
// to go through the InterfacesFor method below.
|
||||
SelfLinker runtime.SelfLinker
|
||||
|
||||
// RESTMapper provides the default mapping between REST paths and the objects declared in a Scheme and all known
|
||||
// versions.
|
||||
RESTMapper meta.RESTMapper
|
||||
|
@ -98,6 +98,7 @@ go_library(
|
||||
"//vendor/github.com/pborman/uuid:go_default_library",
|
||||
"//vendor/golang.org/x/net/http2:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apimachinery:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"github.com/emicklei/go-restful-swagger12"
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/apimachinery"
|
||||
"k8s.io/apimachinery/pkg/apimachinery/registered"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@ -422,7 +423,7 @@ func (s *GenericAPIServer) newAPIGroupVersion(apiGroupInfo *APIGroupInfo, groupV
|
||||
UnsafeConvertor: runtime.UnsafeObjectConvertor(apiGroupInfo.Scheme),
|
||||
Defaulter: apiGroupInfo.Scheme,
|
||||
Typer: apiGroupInfo.Scheme,
|
||||
Linker: apiGroupInfo.GroupMeta.SelfLinker,
|
||||
Linker: runtime.SelfLinker(meta.NewAccessor()),
|
||||
RootScopedKinds: apiGroupInfo.GroupMeta.RootScopedKinds,
|
||||
|
||||
Admit: s.admissionControl,
|
||||
|
Loading…
Reference in New Issue
Block a user