mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #66403 from deads2k/api-03-panic-track
Automatic merge from submit-queue (batch tested with PRs 66341, 66405, 66403, 66264, 66447). 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>. indicate which scheme has conflicting data An oversight when adding scheme origination to error messages. There are a couple state dependent panics which are useful to gain info on. @sttts @kubernetes/sig-api-machinery-misc ```release-note NONE ```
This commit is contained in:
commit
267dd6b6a2
@ -159,7 +159,7 @@ func (s *Scheme) AddUnversionedTypes(version schema.GroupVersion, types ...Objec
|
||||
gvk := version.WithKind(t.Name())
|
||||
s.unversionedTypes[t] = gvk
|
||||
if old, ok := s.unversionedKinds[gvk.Kind]; ok && t != old {
|
||||
panic(fmt.Sprintf("%v.%v has already been registered as unversioned kind %q - kind name must be unique", old.PkgPath(), old.Name(), gvk))
|
||||
panic(fmt.Sprintf("%v.%v has already been registered as unversioned kind %q - kind name must be unique in scheme %q", old.PkgPath(), old.Name(), gvk, s.schemeName))
|
||||
}
|
||||
s.unversionedKinds[gvk.Kind] = t
|
||||
}
|
||||
@ -200,7 +200,7 @@ func (s *Scheme) AddKnownTypeWithName(gvk schema.GroupVersionKind, obj Object) {
|
||||
}
|
||||
|
||||
if oldT, found := s.gvkToType[gvk]; found && oldT != t {
|
||||
panic(fmt.Sprintf("Double registration of different types for %v: old=%v.%v, new=%v.%v", gvk, oldT.PkgPath(), oldT.Name(), t.PkgPath(), t.Name()))
|
||||
panic(fmt.Sprintf("Double registration of different types for %v: old=%v.%v, new=%v.%v in scheme %q", gvk, oldT.PkgPath(), oldT.Name(), t.PkgPath(), t.Name(), s.schemeName))
|
||||
}
|
||||
|
||||
s.gvkToType[gvk] = t
|
||||
|
Loading…
Reference in New Issue
Block a user