Make NewPodController function validate that provider is set

In NewPodController we validate that the rest of the config is
set to non-nil values. The provider must be non-nil as well.
This commit is contained in:
Sargun Dhillon
2019-07-21 16:19:00 -07:00
parent 46591ad811
commit ce60fb81d4

View File

@@ -138,6 +138,9 @@ func NewPodController(cfg PodControllerConfig) (*PodController, error) {
if cfg.ServiceInformer == nil {
return nil, errdefs.InvalidInput("missing service informer")
}
if cfg.Provider == nil {
return nil, errdefs.InvalidInput("missing provider")
}
rm, err := manager.NewResourceManager(cfg.PodInformer.Lister(), cfg.SecretInformer.Lister(), cfg.ConfigMapInformer.Lister(), cfg.ServiceInformer.Lister())
if err != nil {