mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-24 02:51:33 +00:00
improve the panic message of GroupOrDie
This commit is contained in:
parent
c2f76e4ce7
commit
9c2202a771
@ -66,7 +66,12 @@ func (g GroupMetaMap) Group(group string) (*GroupMeta, error) {
|
||||
func (g GroupMetaMap) GroupOrDie(group string) *GroupMeta {
|
||||
groupMeta, found := g[group]
|
||||
if !found {
|
||||
panic(fmt.Sprintf("no version is registered for group %v", group))
|
||||
const msg = "Please check the KUBE_API_VERSIONS environment variable."
|
||||
if group == "" {
|
||||
panic("The legacy v1 API is not registered. " + msg)
|
||||
} else {
|
||||
panic(fmt.Sprintf("No version is registered for group %s. ", group) + msg)
|
||||
}
|
||||
}
|
||||
return groupMeta
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user