mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #39457 from zhouhaibing089/gcc
Automatic merge from submit-queue (batch tested with PRs 37845, 39439, 39514, 39457, 38866) Log a warning message when failed to find kind for resource in garbage collector controller at this time, I do not think thirdparty api group version resources should be taken care by garbage collector controllers, and this line of call will fail actually: https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/garbagecollector/garbagecollector.go#L565, and as a result, the garbagecollector controller failed to start.
This commit is contained in:
commit
3c56041384
@ -564,6 +564,14 @@ func NewGarbageCollector(metaOnlyClientPool dynamic.ClientPool, clientPool dynam
|
||||
}
|
||||
kind, err := gc.restMapper.KindFor(resource)
|
||||
if err != nil {
|
||||
if _, ok := err.(*meta.NoResourceMatchError); ok {
|
||||
// ignore NoResourceMatchErrors for now because TPRs won't be registered
|
||||
// and hence the RestMapper does not know about them. The deletableResources
|
||||
// though are using discovery which included TPRs.
|
||||
// TODO: use dynamic discovery for RestMapper and deletableResources
|
||||
glog.Warningf("ignore NoResourceMatchError for %v", resource)
|
||||
continue
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
monitor, err := gc.monitorFor(resource, kind)
|
||||
|
1
pkg/master/thirdparty/thirdparty.go
vendored
1
pkg/master/thirdparty/thirdparty.go
vendored
@ -284,6 +284,7 @@ func (m *ThirdPartyResourceServer) InstallThirdPartyResource(rsrc *extensions.Th
|
||||
m.genericAPIServer.HandlerContainer.Add(genericapi.NewGroupWebService(api.Codecs, path, apiGroup))
|
||||
|
||||
m.addThirdPartyResourceStorage(path, plural.Resource, thirdparty.Storage[plural.Resource].(*thirdpartyresourcedataetcd.REST), apiGroup)
|
||||
registered.AddThirdPartyAPIGroupVersions(schema.GroupVersion{Group: group, Version: rsrc.Versions[0].Name})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user