Change:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is security related, please disclose it privately via --What happened: When joining a new control plane node with stacked , while the local server starts and joins the cluster, can't connect to it and panics: What you expected to happen: Not sure if this is a bug per se, because in the end the static pod restarts and starts successfully after the server joins the cluster, but that panic should probably be gracefully handled. How to reproduce it (as minimally and precisely as possible): Join a new control plane node. Anything else we need to know?: Environment: Kubernetes version (use ): 1.18.0 Cloud provider or hardware configuration: Hetzner VPS OS (e.g: ): Ubuntu 18.04.4 LTS Kernel (e.g. ): 5.3.0-45-generic (Ubuntu's default HWE kernel) Install tools: kubeadm Network plugin and version (if this is a network-related bug): Others:
/sig api-machinery
Yeah, the storage signature needs adjusting to propagate the error: /remove-kind bug /kind cleanup /priority backlog
/assign

Discussion:
if apiResourceConfig.VersionEnabled(v1beta1.SchemeGroupVersion) { storage := map[string]rest.Storage{} // customresourcedefinitions <del> customResourceDefintionStorage := customresourcedefinition.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter) storage["customresourcedefinitions"] = customResourceDefintionStorage storage["customresourcedefinitions/status"] = customresourcedefinition.NewStatusREST(Scheme, customResourceDefintionStorage) </del> <ins> customResourceDefinitionStorage, err := customresourcedefinition.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter) if err != nil { return nil, err } storage["customresourcedefinitions"] = customResourceDefinitionStorage storage["customresourcedefinitions/status"] = customresourcedefinition.NewStatusREST(Scheme, customResourceDefinitionStorage) </ins> apiGroupInfo.VersionedResourcesStorageMap[v1beta1.SchemeGroupVersion.Version] = storage } if apiResourceConfig.VersionEnabled(v1.SchemeGroupVersion) { storage := map[string]rest.Storage{} // customresourcedefinitions <del> customResourceDefintionStorage := customresourcedefinition.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter) </del> <ins> customResourceDefintionStorage, err := customresourcedefinition.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter) if err != nil { return nil, err } </ins> storage["customresourcedefinitions"] = customResourceDefintionStorage storage["customresourcedefinitions/status"] = customresourcedefinition.NewStatusREST(Scheme, customResourceDefintionStorage)

} // NewREST returns a RESTStorage object that will work against API services. <del> func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) *REST { </del> <ins> func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*REST, error) { </ins> strategy := NewStrategy(scheme) store := &genericregistry.Store{

} options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: GetAttrs} if err := store.CompleteWithOptions(options); err != nil { <del> panic(err) // TODO: Propagate error up </del> <ins> return nil, err </ins> } <del> return &REST{store} </del> <ins> return &REST{store}, nil </ins> } // Implement ShortNamesProvider