forked from kubernetes/minikube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning when no groupMeta exists for verison
Reference: kubernetes/kubernetes#44771 Fixes kubernetes#1252 TPRs are incorrectly coupled with the RestMapper right now. The real solution is for TPRs to not register themselves with the RestMapper. This is a short term patch for minikube until the work is done upstream. On start/stop, the namespace controller and the garbage collector controller both call this code and panic since TPRs have registered themselves with enabled versions but have no group metadata.
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/vendor/k8s.io/apimachinery/pkg/apimachinery/registered/registered.go b/vendor/k8s.io/apimachinery/pkg/apimachinery/registered/registered.go | ||
index f2e32c88c..f1c96c43d 100644 | ||
--- a/vendor/k8s.io/apimachinery/pkg/apimachinery/registered/registered.go | ||
+++ b/vendor/k8s.io/apimachinery/pkg/apimachinery/registered/registered.go | ||
@@ -282,7 +282,11 @@ func (m *APIRegistrationManager) RESTMapper(versionPatterns ...schema.GroupVersi | ||
for enabledVersion := range m.enabledVersions { | ||
if !unionedGroups.Has(enabledVersion.Group) { | ||
unionedGroups.Insert(enabledVersion.Group) | ||
- groupMeta := m.groupMetaMap[enabledVersion.Group] | ||
+ groupMeta, found := m.groupMetaMap[enabledVersion.Group] | ||
+ // TODO(r2d4): hack until tprs are decoupled from restMapper | ||
+ if !found { | ||
+ glog.Warningf("Could not find groupMeta for %s", enabledVersion.Group) | ||
+ } | ||
unionMapper = append(unionMapper, groupMeta.RESTMapper) | ||
} | ||
} |
6 changes: 5 additions & 1 deletion
6
vendor/k8s.io/apimachinery/pkg/apimachinery/registered/registered.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.